How to build command lines from standard input with xargs

How to use xargs to build command lines from standard input

Even the most basic installation of any Linux distribution comes with a set of really useful utilities: “xargs” is undoubtedly one of those. By using xargs we can build and execute command lines using items from standard input as arguments of a command. This is especially useful when dealing with programs which don’t read standard input directly.

Read more

How to use xclip on Linux

How to use xclip on Linux

The xclip tool can be used to interact with the system clipboard from the command line. This can come in handy in instances where you want to send information directly to the user’s clipboard, without requiring that they highlight and copy the text themselves. It also works in the other direction, so the xclip command can check the contents of the clipboard.

Read more

Linux xxd command explained

Linux xxd command explained

Once a program has been compiled, it is not easy to get a peek at the source code or to manipulate its behavior. But there is one thing we can do, which is look at the hexadecimal values inside the binary files. We can also make changes to the data and compile it back to a binary file. This will sometimes reveal information about a file, or allow us to modify its behavior if we can manage to edit the right bit.

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