Basic Linux Commands you must know

(Last Updated On: October 3, 2018)

Basic Linux commands for beginner



                             If I start to tell you about Linux then the discussion will continue for a long time. Frankly speaking, I am in love with Linux. You know, it has everything to make you excited to learn about it. But I know this too, if someone is very new or never used Linux before, they might have a lot of problem dealing with it.

So if you don’t know what to do next, or what is the appropriate command for executing a particular task then believe me you will be stuck at the beginning. It will show you a black screen along with a cursor blinking.

So today I am writing about some of the basic linux commands that you need to know if you are a beginner in this platform.



The Basic Linux Commands you need to know.

Basic Linux Commands for the beginner, you need to know before preparing for Linux L1 interview. All the daily use command you must know whether you are employed or preparing for an interview.


1. Available free Disk space ==> fdisk -l
2. See Hostname       ==>  hostname
3. Set Hostname       ==>  hostnamectl set-hostname "hostname"
4. Create directory   ==>  mkdir “dir name”
5. Remove directory   ==>  rmdir “dir name”
6. Rename directory   ==>  mv “old dir name ” “new dir name”
7. Create a file      ==>   touch “file name”
8. Move a file        ==>  mv “file name” /path/
9. Delete a file      ==>   rm “file name”  or rm -rf “file name “
10. See IP address    ==>  ifconfig  or  ip -a
11. Clear screen      ==>  clear  or ctrl key + l
12. Query running ports  ==>   netstat -tulpn
13. Create user       ==> useradd “username”
14. Delete a user     ==>  userdel  “username”
15. Give password to a user  ==>   su – “username” , then passwd or  passwd -a ‘username’
16. Query a package    ==> rpm -q “package name”
17. Install a package  ==>  yum install “package name” -y
18. Remove a package   ==>  yum remove “package name” -y
19. List Directory     ==>  ls  / ls -ld / ls – Zd  / ls -lrt
20. Print current Director  ==>  pwd
21. Check Firewall configuration     ==>   firewall-cmd –list –all
22. Add Firewall  Service    ==>  firewall-cmd--add-service==http --permanent
23. Add port  in Firewall    ==>  firewall-cmd --add-port=443 --permanent
24. Restart Firewall     ==>  firewall-cmd --reload
25. See running process   ==>   ps , ps -aux
26. Change owner of a Directory   ==>  chown "user name" "directory name"
27. Change permission of a Directory ==>  chmod 777 "directory name"
28. Download something using cli ==>  wget "target url"
29. Mount a directory ==>  mount -t "file type(ext4)" "what you want to mount (/run/media)"  "where you want to mount (/mnt)"
30. Check log files  ==>  tail /var/log/messeges
31. Compress a file using "tar"  ==>  tar -czvf  "name-of-archive.tar.gz"    /path/to/directory-or-file
32. Extract a file   ==>  tar -xzvf archive.tar.gz  -C /tmp
33. Create a file directly with some detail   ==>  echo "hello"  >> "file name".txt
34. See that file information in detail      ==>  ls -lrt  "file name"
35. Check free disk usage  ==>  df -Th
36. Check file size   ==>  du -sh  "file name"
37. Show the information about the Linux distro  ==>  uname -a
38. Copy and paste  ==>  "ctrl + c"  and " shift+ctrl+v "
39. Go back to previous directory    ==>  cd ..
40. Bring the last command to action  ==> " esc key " and " . "



Note *:

These are basic but important commands that you must know before you attend for a Linux interview  (L1 level). One more thing you need to check about the Linux boot process. I will write another blog on this topic.




So, guys, I have tried my best to simplify things so that you can have a better understanding and user experience. Now it’s your turn to pay me back.

I am expecting your responses. If you like this content inspire me by just commenting or liking this article. Your responses will motivate me to do better and deliver better. Even if you do not like this article then also tell me by commenting below. I will try my best to improve my skill.

So thank you guys, Have a good day.

Rate this content
User Review
5 (3 votes)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ad Blocker Detected

Ad Blocker Detected, please disable it to help this page in many ways. Thank you so much.