Skip to main content

Posts

Showing posts with the label Linux command

How to Undo and Redo in Vim / Vi

Sometimes, when editing a file, you may delete a wrong line or change your mind about an edit, and you’ll want to revert the changes. This article explains how to undo and redo changes in Vim / Vi. Either Vi or Vim is installed by default on macOS and almost all Linux distributions. Knowing the basics of Vim might be very useful when you encounter a situation where your favorite editor is not available. Undo Changes in Vim / Vi   Vim keeps track of all the changes you made in the current session. The undo command undoes one or more changes in the order in which they were made. To undo changes in Vim and Vi use the u, :u or :undo command: If you are in insert or any other mode, press the Esc key to go back to the normal mode, which is also known as command mode. Type u to undo the last change. In Vim, the u command also accepts quantifiers. For example, if you want to undo the 4 last changes, you would use 4u. Make sure you’re typing lowercase u, not the uppercase U comman...

Understanding the /etc/shadow File : information about the system’s users’ passwords : [Beginners Guide]

There are several different authentication schemes that can be used on Linux systems. The most commonly used and standard scheme is to perform authentication against the /etc/passwd and /etc/shadow files. /etc/shadow is a text file that contains information about the system’s users’ passwords. It is owned by user root and group shadow, and has 640 permissions. /etc/shadow Format   The /etc/shadow file contains one entry per line, each representing a user account. You can view the contents of the file, with a text editor or a command such as cat: sudo cat /etc/shadow Typically, the first line describes the root user, followed by the system and normal user accounts. New entries are appended at the end of the file. Each line of the /etc/shadow file contains nine comma-separated fields: 01. Username. The string you type when you log into the system. The user account that exist on the system. 02. Encrypted Password. The password is using the $type$salt$hashed f...

Apt-fast for Increasing Download Speed while Installing and Updating Packages Ubuntu/Debian [Beginners Guide]

Have you ever experienced slow download speed when downloading or updating packages in Ubuntu even when your network connection is running fine? You encounter this issue especially when updating and installing packages for the first time after installing a new Ubuntu/Debian OS. However, there is a way to get around this by speeding up the download speed using apt-fast command in Linux. Apt-fast is a shell script wrapper for “apt-get” and “aptitude” that uses the power of either  axel  or  aria 2  download managers to accelerate the download process. It improves download performance by downloading packages simultaneously in parallel with multiple packages per connection. In this article, we will walk through some steps to install apt-fast in order to accelerate the update and downloading process in Ubuntu. We will use Ubuntu 18.04 LTS for describing the procedure mentioned in this article.   Step 1: Installing prerequisites We need to install...

apt-get Command & Examples in Linux [Beginners Guide]

apt-get command & Examples in Linux apt-get is a command-line tool which helps in handling packages in Linux. Its main task is to retrieve the information and packages from the authenticated sources for installation, upgrade and removal of packages along with their dependencies. Here APT stands for the Advanced Packaging Tool. APT (Advanced Package Tool) is the command line tool to interact with this packaging system. There are already dpkg commands to manage it, but apt is a more user-friendly way to handle packages. You can use it to find and install new packages, upgrade packages, clean your packages, etc. Syntax : Command : apt-get [options] command or Command : apt-get [options] install|remove pkg1 [pkg2 ...] or Command : apt-get [options] source pkg1 [pkg2 ...] Most Used Commands: You need to provide one of the commands below, if -h option is not used. update : This command is used to synchronize the package index files from their sources ag...