Linux hard link vs. soft link

Linux hard link vs. soft link

Soft links and hard links are the two types of links that can be created on a Linux system. Without realizing it, you have undoubtedly interacted with tons of hard links on your own system. And, most likely, you have encountered some soft links (also called symbolic links or symlinks), too. That is because the files you work with on your system every day are either hard links or soft links that point to data on your hard drive. What we usually think of as a “file” is actually an inode that points to a data block on our hard drive, and the hard link is how we interact with it.

Read more

How to check command version on Linux

How to check command version on Linux

When working with various Linux commands, you may be wondering what version of the command you are using. Of course, the version relates to the binary executable file itself, and traditionally is maintained by the system package manager, which is responsible for checking on updated versions and installing them at the user’s discretion. Commands in Linux typically undergo slow, subtle changes. Some commands have not changed much at all since the 70s, when they were introduced on Unix. Others have new versions developed regularly, and you need to check your version to know which features it has. In this tutorial, you will learn how to check the version of a command on a Linux system.

Read more

Bash base64 decode and encode on Linux

Bash base64 decode and encode on Linux

Linux commonly uses base64 to encode and decode data. This method of encoding provides a reliable way for data to be transmitted and stored. The encoding process will convert binary data to ASCII characters, making it usable by a variety of services (such as OpenSSL) that require readable ASCII character transmission as opposed to binary. Afterwards, the data can be decoded back to binary data. In this tutorial, you will see how to use the base64 command to decode and encode data on a Linux system.

Read more

How to say YES to ALL with cp command

How to say YES to ALL with cp command

The cp command is used to copy files and directories on a Linux system. If a user tries to copy a file over to a location that already contains the same file name, the default behavior of cp is to overwrite the destination file with the source file. However, on some Linux systems, this behavior can be configured differently, and the user might see a prompt to confirm overwriting in their terminal. When copying many files, this prompt can get repetitive and annoying to deal with. In this tutorial, you will learn how to say YES to ALL with the cp command when trying to copy files via the Linux command line.

Read more

Linux shutdown commands explained

Linux shutdown commands explained

New users are often surprised by the number of commands that can be used to shut down a Linux system. Thanks to the flexibility of Linux and its storied history, there is almost always more than one – or more than a few – ways to accomplish the same task. Although Linux is always giving users plenty of choices on how to operate their system, one method usually proves better for certain scenarios, and all come with their pros and cons.

Read more

How to ZIP file with password on Linux

How to ZIP file with password on Linux

If you have one or more files that you need to send to a friend or store for a long time, compressing the files into a .zip archive is a good way to save on space and combine all files into a single object. If you need to keep the file contents private, for fear that they could be intercepted by the wrong party, or that someone could try to access them on your own system, then it is possible to add a password to your zip file. In this tutorial, you will learn how to zip files and add a password to your zip archive on a Linux system.

Read more

How to kill process by port

How to kill process by port

Processes that utilize the network connection of your Linux system will occupy a port whenever they are uploading or downloading data, or listening for incoming connections. A common example present on many Linux servers would be the SSH protocol, which listens for and accepts incoming connections on port 22 by default. Ordinarily, administrators can kill a process using the PID number, or by specifying the process name. But in some cases, we may want to kill a process according to which port number it is using.

Read more

How to kill process by ID

How to kill process by ID

Everything that is currently running on your Linux system is a process. Some processes are meant to run in the background (application updates, for example), so you may not be readily aware of their existence. And other processes (a web browser, for example) are very apparent, and get started or stopped by the user on a constant basis. All of these processes are assigned an ID number, called PID or “Process ID”, and can be referenced in various situations, including killing a running process via the process ID.

Read more

How to echo environment variable on Linux

How to echo environment variable on Linux

Environment variables contain data about the current system configuration. These variables are mostly referenced by scripts and system programs that need some information on the current configuration in order to adapt to various scenarios. For example, a script might check an environment variable to see what language is set on the computer, and then output prompts in the target language. One of the most commonly accessed environment variables is the PATH environment variable.

Read more