Must Know — Linux Terminal Commands
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.
Basic Linux Commands
Lists Commandls
— Lists all files and directories in the present working directoryls-R
— Lists files in sub-directories as wellls -a
— Lists hidden files as wellls -al
— Lists files and directories with detailed information like permissions, size, owner, and morels -l
— Lists file type and access permission
Directory Commandcd or cd ~
— Navigate to the HOME directorycd ..
— Move one level upcd
— To change to a particular directorycd /
— Move to the root directory
File Related Commandcat > newfilename
— Creates a new filecat filename
— Displays the file contentcat 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 locationmv oldfilename newfilename
— Renames the oldfilename
to a newfilename
rm filename
— Deletes a filemkdir directoryname
— Creates a new directory in the present working directoryrmdir
— Deletes a directorymv filename
— Renames a directory ( filename should be present in the current path )
Misc Commandssudo
— Allows privileges of the superuser or root ( if the password is set you need to enter it )man man
— Gives help information on a commandhistory
— Gives a list of all past commands typed in the current terminal sessionclear
— Clears the terminal
File Permission Commands
VARIABLE_NAME=variable_value
— Create a new variableecho $VARIABLE_NAME
— To display the value of a variableexport Variable=value
— To set the value of an environment variableenv
— Displays all environment variablesunset 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.