Linux Commands Made Simple: Learn by Doing!

Sattyam SamaniaSattyam Samania
3 min read

If you’ve ever opened a terminal and felt like you were staring into the Matrix then you’re not alone.

Learning Linux commands can seem overwhelming at first, especially when you're used to graphical interfaces. But trust me, once you get the hang of it, the terminal becomes one of the most powerful tools in your developer toolkit. Here's a list of basic Linux commands grouped by category.

File & Directory Management

CommandDescriptionExample
pwdshow current working directory pathpwd
lsList files and directoriesls
cdChange directorycd Documents/ cd Downloads
mkdirCreate new directorymkdir new_folder
rmdirRemove Empty directoryrmdir old_folder
touchCreate new filetouch file.txt
rmRemove filerm file.txt
rm -rRemove directory and contentsrm -r folder
mvMove or Rename filesmv old.txt new.txt
cpCopy files or folderscp file.txt backup.txt or cp -r folder/ backup/

Viewing and Reading Files

CommandDescriptionExample
catView entire file contentscat file.txt
headView first few lineshead -n 5 file.txt
tailView last few linestail -n 5 file.txt
lessView file with scroll supportless file.txt
moresimilar to less, paginated viewmore file.txt

Searching Files and Text

CommandDescriptionExample
grepSearch for text in filesgrep “root“ file.txt or grep “root” /folder/file.txt
findFind files in the directoryfind . -name “*.txt“
find . -perm 777Shows files with all permissions(read,write, execute)find . -perm 777

Compressing and Archiving

CommandDescriptionExample
zipCompress file or folderzip -r archive.zip /folder
unzipExtract zip fileunzip archive.zip
tarArchive/Compress filetar -czvf archive.tar.gz folder/
tar -xExtract tar archivetar -xzvf archive.tar.gz

Environment and System Info

CommandDescriptionExample
exportSet Environment Variableexport my_var=”Hello”
echoDisplay message or Variableecho "$my_var
envList environment variablesenv
whoamiShow current userwhoami
uname -aShow system infouname -a
ps auxProcess which are runningps aux
sudoAdmin commandsudo
dfCheck the capacity and storage detailsdf
duDisk usage capacitydu
topWhat processes are runningtop

Conclusion

In this blog, we explored some of the most essential Linux commands, from creating files and directories to searching through files, compressing folders, changing permissions, and even downloading files directly from the terminal.

Hope you enjoyed reading this blog. Follow me for more such content 😊

#linuxcommands #learninginpublic #devops

0
Subscribe to my newsletter

Read articles from Sattyam Samania directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sattyam Samania
Sattyam Samania

I am a Passionate Frontend Developer from India. I like to build attractive web pages. Here I will share my journey with all the other folks.