Basic Linux Commands (Part-2)

Pritam Panda's photo
Pritam Panda
·Jul 28, 2022·

3 min read

Basic Linux Commands (Part-2)

Photo by Gabriel Heinzer on Unsplash

Subscribe to our newsletter and never miss any upcoming articles

Hey, everyone, I hope you liked part 1 of Basic Linux commands. If you still haven't checked it out go check it out here Part 1.

Coming to this part, here are some basic Linux Commands 👇

1.find command

find command searches for files and directories similar to locate command. The difference is that find command is used to locate files within a given directory.


2. grep command

Another basic Linux command that helps us to search through all the text in a given file.


3.sudo command

sudo stands for "superuser do".It helps us perform tasks that require administrative or root permissions. You must be very careful using this command as this is a very powerful command and some errors might occur if it is not used properly.


4.du command

du(disk usage) command is used to check how much space a file or directory takes.


5.df command

df command is used to get a report on the system’s disk space usage. If you want to see the report in megabytes, type df -m.


6.diff command

diff command is used to compare contents of two files line by line and print output the lines that do not match.


6. head command

The head command is used to view the first few lines of any file. For mentioning the number of lines use -n then use the number of lines you want to print. Eg-head -n 2 file.txt prints the first 2 lines of the file.


7. tail command

This command has a similar function to the head command, but instead of showing the first lines, the tail command will display the last lines of a text file. For example, tail -n 2 file.txt.


8. jobs command

The jobs command will display all current jobs along with their statuses. A job is basically a process that is started by the shell.

9.kill command

kill command is used to terminate any program. To kill or terminate a program we need to know the process identification number (PID) and the signal option. If you don’t know the PID, simply run the command ps ux.

There are a total of 64 signal options out of which people generally use 2 -

  • SIGTERM (15) — requests a program to stop running and gives it some time to save all of its progress. If you don’t specify the signal when entering the kill command, this signal will be used.
  • SIGKILL (9) — forces programs to stop immediately. Unsaved progress will be lost.

eg-kill [signal option] PID command

ping command to check your connectivity status to a server.


I hope you liked this part. More commands to come soon 🙌.

Did you find this article valuable?

Support Community Classroom by becoming a sponsor. Any amount is appreciated!

See recent sponsors Learn more about Hashnode Sponsors
Share this