Most Useful Linux Commands You Need Everyday
What are the basic and most useful Linux commands you need every day to speed-up your execution?
In this tutorial, I am listing some of the important Linux commands that you will find very useful in your daily work routine.
One of the best things about Linux is that you will find many useful commands. Keeping those commands handy, you feel doing a lot of things in just a few seconds.
If you get habitat using these useful Linux commands, gradually, your productivity will start increasing.
Without any ado, let’s see.
Table of Contents:
Note: I will keep this list updated with more of such useful commands as I come across.
How to sort the files and directory by Time:
The basic command to list all the files and directory inside the current directory path.
You can see that the directories listed are not sorted.
If you want to sort the files by their modification time, you need to run following command.
$ ls -lrt
- “l” is for the long listing format. It shows detail about each directory like read/write permission, user, time and date of modification…
- “r” is to reverse the order of the directory listing. If you don’t use this parameter, it shows the directories in descending order of modification.
- “t” is to sort the directories by modification time.
How to change the Current directory temporarily to execute the command in Linux Bash?
Do you want to execute the command in a temporary directory in your bash?
Here is a simple command you can use to change the current directory temporarily and then execute your command.
We all the command to change the directory.
After this command, your current directory will be changed permanently. You can check the current directory using
Now, instead of changing directory permanently you can club
cd command with the command you want to execute.
(cd <your_directory_path> && <your_command_to_execute>)
Don’t forget to enclose the commands inside the opening and closing the bracket (parenthesis).
Rather than changing your directory, it executes the command in the directory you have mentioned.
Let check the current directory first.
Change the current directory temporarily and execute the command.
$ (cd /tmp && ls)
It will list out all the files in the /tmp directory.
You can see that the current directory is not changed.
Where you can use this command?
This command is very useful if you writing any script and you want to execute certain commands in a specific directory. You don’t need to change the current directory path.
Some More Useful Linux Commands You Should Learn:
- 7 Hostname Linux Commands to know more about your Linux host
- Commands to find the size of each directory
- Commands to mount/unmount devices
What are the useful Linux commands you use every day? Please mention in the comment, we will add it to this list.
Keep Wrestling and Start Learning Linux!