What Is /dev/null in Linux?

In technical terms, “/dev/null” is a virtual device file. As far as programs are concerned, these are treated just like real files. Utilities can request data from this kind of source, and the operating system feeds them data. But, instead of reading from disk, the operating system generates this data dynamically. An example of such a file is “/dev/zero.” In this case, however, you will write to a device file. Whatever you write to “/dev/null” is discarded, forgotten, thrown into the void. To understand why this is useful, you must first have a basic understanding of standard output and standard error… Read more

How to Use the Tee Command in Linux

If you ever use pipes and redirections under your Linux shell, chances are you will also sometimes need to make use of the tee utility. What Does Tee Do? A command such as ls will display the contents of your current directory. In other words, it displays these contents to stdout (standard output), which is normally your screen, or to be more precise, your virtual terminal display. A command like ls > file123 will display nothing on your screen. That’s because the >… Read more

How to Find a Specific Word in a File on Linux

By default, most search tools look at file names, not file contents. However, the most famous GNU search program, grep, will look inside files with the correct flags. Here we will show you how you can find specific word(s) in a file on Linux. Using grep to Find a Specific Word in a File By default, grep searches through the contents of files as well as their file names. It’s included on the majority of Linux systems and is generally identical across distros. That said, smaller or less powerful Linux boxes might prefer to run a different command, like ack. Depending on how the file… Read more

How to Use fd to Quickly Find Files in Linux and macOS

fd is a simpler alternative to the find command. It uses a truncated syntax and an abbreviated command structure to keep your typed commands short and to the point. However, that lack of verbosity that makes fd easy to type makes it more difficult to understand. fd also runs pattern-matching more rapidly than the default find commands. Learn how to use fd on Linux and macOS. Install fd on Linux fd doesn’t ship on many systems by default. You’ll need to use your preferred package manager to download and install the application, and then you can run it from within Terminal. Ubuntu It will ship… Read more

How to Use cURL Command in Linux

No matter what you use your computer for, there has probably been at least one occasion where you needed to download something, and opening a browser felt like overkill. This would be a great use case for cURL. As the name suggests, cURL is a command-line tool for transferring data with URLs. One of the simplest uses is to download a file via the command line. This is deceptive, however, as cURL is an incredibly powerful tool depending on how you use it. Even if you’re somewhat familiar with the command, you probably aren’t using it to its full potential. Basic cURL Functionality One of… Read more