Hello folks,
You might be working on GUI based interfaces to do your daily tasks. But do you know that you can do the same and some advance tasks just using the terminal but more efficiently. Also having a deep understanding of the terminal commands comes handy when you want to be more productive and fast. Terminal commands can do more than just installing the softwares on your Linux distro. In this blog I have share commands which you should definitely try and use in you daily life. I guarantee you that you will feel the power of terminal commands after you use them couple of times.
Without wasting anymore time let's jump into it.
-
cd directory_name
==> Changes the path to directory_name -
cd ..
==> Go back to previous directory -
cd
orcd ~
==> Go back to root directory -
mkdir directory_name
==> Makes a new directory at that location -
rmdir directory_name
==> This will delete the directory (Cannot be undone) -
ls
==> Lists all the directories in the location -
touch file_name
==> Creats a file of file_name (File extension is compulsary) -
echo random_text
==> Will print random_text on the terminal screen -
echo random_text > file_name
==> It will put the random_text into the file_name instead of printing on the terminal screen -
man command_name
==> This will display all the information about the specific terminal command_name -
help
==> This will help you by providing some comman commands if you are unable to recall them -
history
==> Shows all the history of your commands -
ps
==> This will show all the processes running on you machine -
pwd
==> This will show your current path in terminal -
cat file_name
==> Prints all the content in the given file_name. -
cp file_name location
==> This will copy the file at the specific location -
cp file_name copyed_file_name
==> This makes the copy of the file_name with name as copyed_file_name. -
mv file_name location
==> This will move the file_name to the given location. -
mv file_name new_file_name
==> This will rename the file_name to new_file_name. -
rm -rf directory_name
==> This will recursively(-r) and forcefully (-f) will delete the directory -
find .
==> Finds everything in the directory. -
find directory_name/
==> Finds everything in the given directory_name. -
find directory_name -type d
==> Finds only directory in the directory_name -
find directory_name -type f
==> Finds only file_name in the directory_name -
find . -type f -name "file_name"
==> Finds everything with type file and name as file_name -
find . -type f -name "*.txt"
==> Finds everything with type file and whatever has extention as .txt -
find . -empty
==> Finds all the directories and files that are empty -
clear
==> clears the terminal screen -
grep "random_text" file_name
==> Finds the random_text in the file_name only if the exact word is found (it is case sensitive as well) -
grep "random_text" file_name -w
==> Finds the random_text in the file_name only prints if random_text is found as a whole word(-w) -
grep "random_text" file_name -i
==> Finds the random_text in the file_name and prints regardless of the case sensitiveness. It doesn't mind the case sensitiveness if (-i) is added -
grep "random_text" file_name -n
==> Finds the random_text in the file_name and prints the the line number (-n) as well. -
grep "random_text" -win ./*.txt
==> Finds the random text in all the text (.txt) files in the directory and ensure that the word found is whole word (-w), regardless of case sensitiveness (-i), and with line number (-n) -
diff file_1 file_2
==> Shows the difference in two files -
ping www.example_website.com
==> This will show your internet speed for recieving the pacakages. -
curl www.example_website.com
==> This will show the html of that example_website -
top
==> This will show cpu usage, memory usage etc at current time -
nslookup -type=type service_name
==> Change the type of the information query -
nslookup -debug example_website
==> used to find the IP address that corresponds to a host, or the domain name that corresponds to an IP address. -
curl -O pdf_url_on_internet
==> It downloads the media from the url to the location
❤️ Thank you for reading ❤️
🌏 Like | Follow | Share 🌏
Top comments (17)
cd
orcd ~
does not go to the root directory, but to the users home directory. They may be the same, but this is highly unlikely.In addition,
cd -
goes back the the previous directory. So, when in a project, typecd
to go the your home directory, andcd -
to go back to the project directory.Correct. Thanks for your detailed explanation so that I don't need to do that :).
Thanks, I am learning too. Thanks for the detailed explaination. I will edit the blog soon! :)
This
rmdir directory_name ==> This will delete the directory (Cannot be undone)
explanation should change into:rmdir directory_name ==> This will delete the directory (Cannot be undone if the directory is not empty.)
.And it will be better than previous explanation.
The
curl
command is not installed on Linux distribution by default. It should use the package install command (such as apt-get, yum and dnf commands) to install that before using thecurl www.example_website.com
command.Thanks for that I would rephrase that soon! Thanks for the comment, I appreciate that
I think you need to rename your article
Yes, this is every possible linux command in one handbook! Not complete and not a handbook. Maybe the title should be "Some basic, useful linux commands"
Yup nice article but "complete handbook" is a bit of a stretch ;)
Sorry for the inconvinience. I meant "Complete hadbook for beginners", as this commands are more than enough to get started as beginner. btw thanks for your comment I appreciate that!
No worries! It's useful anyway
Sorry for the inconvinience. I meant "Complete hadbook for beginners", as this commands are more than enough to get started as beginner. btw thanks for your comment I appreciate that!
Sorry for the inconvinience. I meant "Complete hadbook for beginners", as this commands are more than enough to get started as beginner. btw thanks for your comment I appreciate that!
Sorry for the inconvinience. I meant "Complete hadbook for beginners", as this commands are more than enough to get started as beginner. btw thanks for your comment I appreciate that!
Sorry for the inconvinience. I meant "Complete hadbook for beginners", as this commands are more than enough to get started as beginner. btw thanks for your comment I appreciate that!
"complete" ...yeah, sure. :-)
Sorry for the inconvinience. I meant "Complete hadbook for beginners", as this commands are more than enough to get started as beginner. btw thanks for your comment I appreciate that!