Must Know — Linux Terminal Commands

Vikas Tiwari
2 min readJan 5, 2023

Hello awesome people, Hope you are doing well. In this blog, we will explore Linux terminal commands and will try to cover all must-know Linux commands.

Terminal

Basic Linux Commands

Lists Command
ls — Lists all files and directories in the present working directory
ls-R — Lists files in sub-directories as well
ls -a — Lists hidden files as well
ls -al — Lists files and directories with detailed information like permissions, size, owner, and more
ls -l— Lists file type and access permission

Directory Command
cd or cd ~ — Navigate to the HOME directory
cd .. — Move one level up
cd — To change to a particular directory
cd / — Move to the root directory

File Related Command
cat > newfilename — Creates a new file
cat filename — Displays the file content
cat file-1 file-2 > file-3 — Joins two files (file-1, file-2) and stores the output in a new file in our case it will be file-3.
mv file “new file path” — Moves the files to the new path location
mv oldfilename newfilename— Renames the oldfilename to a newfilename
rm filename — Deletes a file
mkdir directoryname — Creates a new directory in the present working directory
rmdir — Deletes a directory
mv filename— Renames a directory ( filename should be present in the current path )

Misc Commands
sudo — Allows privileges of the superuser or root ( if the password is set you need to enter it )
man man— Gives help information on a command
history — Gives a list of all past commands typed in the current terminal session
clear — Clears the terminal

File Permission Commands

VARIABLE_NAME=variable_value— Create a new variable
echo $VARIABLE_NAME— To display the value of a variable
export Variable=value— To set the value of an environment variable
env— Displays all environment variables
unset exported_variable_name— Delete an exported environment variable name

Conclusion

We explored different must-know Linux commands.
Obviously, there are more Linux commands with respect to Networking, Processes, VIM, and more. But to get started with Linux and get familiar with Linux terminal these commands are more than enough.
Hope you extracted some knowledge from it. In case of any doubt or if you just want to say Hi! feel free to reach me on LinkedIn or GitHub.

If you like the blog make sure to take a look at my YouTube channel for more amazing stuff.

--

--