Ultimate list of Linux Commands
In this post, we have created a list of all the most useful Linux commands with their uses that are frequently used from Beginner to Intermediate.
Ultimate list of Linux Commands
1. Current directory
The pwd
command is used to get the full path of the current working directory.
pwd
2. Create new directory
The mkdir
allows you to create an empty folder in a specific directory.
mkdir {{name_of_your_directory}}
3. Change directory
CD Command stands for Change Directory, which can be used for changing working directory.
cd {{relative_path_of_new_directory}}
There are some other uses cases of cd to navigate quickly
- cd : To move to the home directory of that user
- cd .. : To go one directory up
- cd- : To go to your previous directory
4. List all files in a directory
This command used for List directory contents, It lists the contents of the folders which includes file or folder from active directory.
ls
you can use ls -a
to show the hidden files as well.
6. List all files with timestamps, sizes, and permissions
ls -l
7. List all hidden files with timestamps, sizes, and permissions
ls -la
8. Create a new file
The touch
command Allows you to create an empty file in a specific folder
touch {{name_of_file}}
9. Move a file
This commands is used for move a file from one location to another location, we can also rename file using this command.
mv {{name_of_file}} {{relative_path_of_new_location}}
10. Rename a file
mv {{name_of_file}} {{name_of_new_file}}
11. Copy a file
cp {{name_of_file}} {{relative_path_of_new_location}}
12. Copy a directory
cp -r {{name_of_file}} {{relative_path_of_new_location}}
13. Delete a file
rm {{name_of_file}}
14. Delete a directory
rm -r {{name_of_file}}
15. Read the whole file content
more {{name_of_file}}
16. Read the last ten lines usually for log files
tail {{name_of_file}}
17. Search inside a file
grep {{text_to_search}} {{name_of_file}}
18. Save the results of the command in a file and overwrite it
grep {{text_to_search}} {{name_of_file}} > {{filename}}
19. Append the results of the command in a file
grep {{text_to_search}} {{name_of_file}} >> {{filename}}
Conclusion:
Do let me know If you face any difficulties please feel free to comment below we love to help you.
If you have any feedback suggestion then please inform us by commenting.
Don’t forget to share this tutorial with your friends on Facebook and Twitter