Linux Commands: Beginner to Intermediate

Tejas Gupta
7 min readMar 2, 2022

--

LINUX IS EASY

Most people are afraid or feel uncomfortable when they hear about using Linux. There is a myth that only programmers or coders can work on Linux. A fact states that more than 90% of CLOUD servers use Linux as their main operating system.

There is not one particular Linux operating system that is used worldwide, It totally depends on the use-case and the dependency. For example, If you are a beginner in Linux then you would start with UBUNTU or CENTOS, If you are into security and vulnerability testing then you would prefer KALI.

Table of content

· Introduction
· Agenda
· Beginner Commands
· Intermediate Commands

Linux has a very long list of commands which is not possible to be covered in a single blog, so here are some of the important commands that are frequently used from Beginner to Intermediate.

Beginner Commands

1. CTRL + ALT + T

It is not exactly a command but an awesome shortcut. You can open the terminal by using this shortcut instead of using the GUI manual process.

2. Sudo

This word should be known by everyone using Linux. A single operating system can have multiple users who may or may not have permission to do everything but the main user i.e “root” has every privilege in that operating system. So to use root privileges, sudo should be added before any command

eg: sudo vi hello.txt

3. pwd

pwd command is used to know the full path of the present working directory (folder)

4. cd

cd command is used to change the directory. for instance, you are in /user/home and you want to go in a temp folder which is located inside the home, so you will do: cd temp
There are some shortcuts in cd to navigate quickly

  • cd : It directly goes to the home directory of that user
  • cd .. : It goes one directory up
  • cd- : It goes to your previous directory

5. ls

It lists all the files and folders that exist in a particular directory. you can use ls -a to show the hidden files as well.

6. touch

It allows you to create an empty file in a particular directory
eg: touch example.txt

7. mkdir

It allows you to create an empty directory (folder) in a particular directory.
eg: mkdir folder1

8. rm and rmdir

It allows you to remove files and folders respectively. However by using rmdir you can only delete an empty directory, so to make a directory empty you can use rm -r /* where -r stands for recursive.

9. mv

It allows you to move a particular file from one location to another location
eg: mv file.txt /[path]
It can be also used for renaming the file mv oldname.txt newname.txt

10. cp

It allows you to copy a particular file from one location to another location
eg: cp file.txt /[path]

11. cat

It allows you to see the content of a file in the terminal
eg: cat file.txt

12. man

man stands for the manual which is used for getting the uses, function of a particular command.
eg: man ls

13. history

history is the command that will get you all the commands that you ran previously on the terminal.

14. echo

It is used to print the string passed as an argument inside quotes.
eg: echo “hello world”

15. ping

It is used to check your connectivity status to a particular server.
eg: ping google.com

16. ifconfig

It is used to view and change the configuration of network interfaces that are present in your system.

17. wget

It is used to download files from the internet.
eg: wget [URL]

18. zip and unzip

zip is used to compress your file into a zip archive and unzip is used to extract the file from that zip archive.

19. vi

It is a terminal-based text editor that is used to create and edit files.
eg: vi hello.txt
you can also use vim instead of vi which is an upgraded version of vi
Get more details here: https://www.linkedin.com/pulse/do-you-know-all-vi-editor-tejas-gupta

20. clear

It helps you to clear the content from the terminal.

Intermediate Commands

21. chmod

It allows you to change the read (r), write (w), and execute (x) permission of files and directories.

22. useradd

It allows you to add a new user.
eg: useradd tejas

23. passwd

It allows you to create or change the password for a particular user.
eg: passwd tejas

24. jobs

It allows you to see all the jobs or the process which are currently running started by the shell.

25. kill

It allows you to kill or stop a current process by using its PID or process ID.

26. alias

It is a very useful command in case of very long commands. you can create an alternate name for the command and use the alternate name to run that command.
eg: alias pri=’cat hello.txt’

27. df

It allows you to keep track of the disk usage in the system.

28. |

piping — A form of stream redirection whereby the output of a command is used as an input the other command
eg: ls -l | less

29. export

It is used to set an environment variable and use that variable in a particular terminal.
eg: export name=”hello world”

30. fg

It allows you to send a job to the foreground.

31. grep

grep is one of the most used commands by Linux admins. It is used to search for a string of characters in a specified file. It can also be used with a combination of other commands.
eg: grep hello file.txt

32. scp

It makes it very simple to copy files between hosts on a network securely using SSH without any external program.
eg: scp user@hostname1:file1 user@hostname2:path

33. ssh

SSH is not a new concept, it's been used everywhere. It is used for logging in to a remote machine. It provides encrypted communication between the hosts.
eg: ssh user@ip

34. w

It is the smallest command in length but plays a very important role in Linux. This command is used to show who is logged on in the system and what process they are currently running.

35. init 0

It is used to shut down the Linux system.

I am using Linux daily to UP my productivity — so UP yours!

--

--

Tejas Gupta

AWS Community Builder ★ AWS/Azure/Alibaba Certified ★ Redhat Certified ★Cloud & DevOps Engineer ★ Content Creator