In this section, we will show you some other very important Linux commands you don't want to miss. These programs are not included in the CentOS 7 minimal installation, so we first need to install it in order to install them. This section is about learning additional command-line programs. Additional because these tools are not included in the CentOS 7 minimal installation, so let's first install all of these programs using the CentOS 7 package manager, yum. In order to install new software, the root user is needed. So, first log in as root. Before we start, let's install the epel repository, which is an additional third-party repository for software that is not found in the official CentOS 7 sources, but is highly trustable and secure.
First, let's install some tools to make our user life easier. rsync is a file transfer program, pv is the pipe viewer; git is for version control; net-tools contains tools to display network information; bind-utils contain tools to query DNS information; telnet and nmap are for basic network troubleshooting; nc stands for netcat, wget is used to download files from the internet; and links is a command-line web browser.
Next, let's install some programs that give you a kind of life view on the system. This will install htop, iotop, and iftop. Finally, let's install some essential tools, which are screen, a calculator, bc, and lsof. First, let's introduce rsync. Every Linux user needs to know it as it's an awesome tool with many useful features. Basically, rsync is a file transfer program, but it does not simply copy files between a source and destination; instead, it synchronizes them, which means it only transfers a file if the source file is different from the destination qfile. This saves a lot of data overhead and time. I often use rsync with the -rav flags, which is the default to copy files verbosely and recursively with a common set of parameters.
cp copies the olip-home folder to a new location recursively. Now, if you change the source file and restart the copying process afterward, rsync first checks whether there are any differences in the source and destination files, and only transfers changes:
As shown in the preceding screenshot, we touch the bashrc file in the olip-home directory, which means update the file's timestamp, and afterward rsync checks and sees that the bashrc file has an updated timestamp, so the file gets transferred to the destination again because it's different. To copy files remotely to another server running the SSH service, and rsync is installed, use the following syntax: rsync -rav. As you can see, the colon at the end of the IP address starts the destination. Here, we will copy the olip-home directory to the /tmp directory and the other way around, to copy remote files to the local server, using rsync .rav /home/olip/ /tmp/new-olip-home. rsync has a lot of different features and is just awesome. You can refer to the manual to learn more about it. Another example of useful tools that I often use is the -- progress flag, which shows you the progress of the file transfer. pv is the pipe viewer, which is a very useful program to display traffic through stdout. For example, we can use it to display progress when piping big amounts of data streams, for example, using the dd command. git is a program for file version control, which can help you keep track of your file versions, as well as be used for installing programs from the Git repositories, such as the very popular GitHub service. For example, we can download the latest pv source code using the following command: $ git clone https://github.com/icetee/pv.git.