Skip to main content

Posts

Showing posts with the label LINUX

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...

Install Docker on Linux [Beginners Guide]

Install Docker on Linux No matter your distribution of choice, you’ll need a 64-bit installation and a kernel at 3.10 or newer. Kernels older than 3.10 do not have the necessary features Docker requires to run containers; data loss and kernel panics occur frequently under certain conditions. Check your current Linux version with uname -r . You should see something like 3.10.[alphanumeric string].x86_64 . Debian and Ubuntu Docker runs on: Ubuntu Xenial 16.04 LTS Ubuntu Wily 15.10 Ubuntu Trusty 14.04 LTS Ubuntu Precise 12.04 LTS Debian testing stretch Debian 8.0 Jessie Debian 7.0 Wheezy (you must enable backports) Debian Wheezy If so, you need to enable backports (if not, ignore this section): Log into the system and open a terminal with sudo or root privileges (or run sudo -i from your terminal). Open /etc/apt/sources.list.d/backports.list with your favorite text editor (if the file does not exist, create it). Remove existing entries. ...

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...

df Command & Examples in Linux [Beginners Guide]

There might come a situation while using Linux when you want to know the amount of space consumed by a particular file system on your LINUX system or how much space is available on a particular file system. LINUX being command friendly provides a command line utility for this i.e df command that displays the amount of disk space available on the file system containing each file name argument. If no file name is passed as an argument with df command then it shows the space available on all currently mounted file systems . This is something you might wanna know cause df command is not able to show the space available on unmounted file systems and the reason for this is that for doing this on some systems requires very deep knowledge of file system structures. By default, df shows the disk space in 1 K blocks. df displays the values in the units of first available SIZE from –block-size (which is an option) and from the DF_BLOCK_SIZE, BLOCKSIZE AND BLOCK_SIZE environmen...