Discover the Magic of NYC with Night Cruises

New York City is a magical place, especially at night. The city that never sleeps truly comes to life as the sun sets and the lights turn on. One of the best ways to experience the city at night is…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




15 Linux Commands Every User Must Know!

Every command I list here has multiple options and several uses. If I try giving even the most common examples of each command, it will easily turn into a pocketbook of more than 10,000 words.

I will not go into detail with any of these commands. I’ll list the purpose of each command with its basic syntax.

This is among the first few commands a new Linux user learns. This command lets you see what files and folders are in your current folder.

You can use the long listing option ls -l to see details like file size, permission, modified time, etc. You can sort and control these options if you want to.

By default, you start in your home directory. You’ll often require to change the directory and move to another one.

For example, you downloaded a deb file or script. Now you want to run it. You can do that from your present working directory by providing the full path but switching to that location makes things easier.

The cd command stands for change directory; with this, you can change your location and move to another directory.

If you quickly want to see the contents of a text file in Linux, cat is the command you use. It displays the contents on the screen.

There are multiple ways of creating new files in the Linux terminal. The cat command you saw above can also create new files.

However, I prefer the touch command for this purpose.

While there is no specific command for creating new files, there is a dedicated command for making new folders (or directories, as we call them in Linux).

The mv command stands for ‘move’. When you copy a file to another location, it remains in its original place.

The mv command moves the files and folders to the other location. You can think of it as a cut-paste operation.

You can use the mv command to rename the file as well.

The same mv command also moves or renames folders without any special options.

To delete files in the Linux terminal, you use the rm (short for remove) command.

There is no undo option after you delete files in the command line. This is why you should be extremely careful while deleting files. If you are afraid of deleting the wrong file, use the interactive mode with option -i, which gives you an additional prompt to confirm the action.

Nano feels like a complicated one, right? Let me share a simple command.

The clear command clears the terminal. That’s it.

And why do you need to do that? Well, if your terminal screen is flooded with random stuff and you want to do something new. Cleaning the terminal is like cleaning the board or opening a new page in your notebook.

The ps command is for handling the processes running on your system. Each process has an associated ID called PID, which can be used for various purposes, such as terminating a process.

But a system cannot run just 2–3 processes, can it? To see all the processes running by all users, use:

This will give a massive list of processes and more details about them. If you run this command, now will be an excellent time to use the clear command.

While the ps command gives you all the running processes, the top command gives you a real-time view of the processes and the system resource consumption.

Consider it like the terminal variant of the task manager in Linux. You’ll see a lot of interesting details with the top command.

The lsblk command lists all the block devices on your system. In really simple (and not entirely technically accurate) terms, it displays the disks and partitions.

Even as a desktop user, you’ll encounter cases where you may have to search for files in the Linux command line.

The find command is an extensive and versatile command for this purpose. It has more than fifty options, and you will probably never need all of them.

Here’s an example of the find command that will give you all the files that end with the .txt extension in the current directory.

The find command search for files based on their name and type. If you want to search based on the content of the files, you use the grep command.

So, instead of looking for all files ending with .txt, you look for all files containing the text ‘foss’ with grep.

As you can see in the above command, you need to know the process ID (PID) or the name to terminate it. You can use the ps or the top command to get the PID or exact process name.

So, you used a specific Linux command a few days ago. Now you need to run it again, but you cannot recall it correctly.

You can press the up and down arrow keys.

That’s a familiar scenario for many Linux users; this is where the history command helps.

In Ubuntu, your shell keeps a history of the commands you run. Enter history in the terminal, and you should see a history of commands you ran in the past.

There is another way to access the command history and search it. Press Ctrl+R and then enter the search term.

Add a comment

Related posts:

Saw Mill Log Flume Malfunctions at Six Flags Great Adventure in New Jersey

As health officials ease on health restrictions brought by the pandemic, more people are visiting amusement parks again. Unfortunately, Six Flags Great Adventure in New Jersey had an accident last…

7 Surprising Benefits of Drinking Green Tea Every Day.

Green tea is a popular drink that has been consumed for centuries. It is made from the leaves of Camellia sinensis and is full of health-promoting compounds. Green tea is popularly used in…

FED white paper on CBDC

The United States Federal Reserve published a white paper detailing its investigation of developing a Central Bank Digital Currency on January 20, 2022, and the window for public comment is open…