DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Linux Commands (a cheatsheet)
Mia
Mia

Posted on • Updated on

Linux Commands (a cheatsheet)

This is just a quick overview of the basic terminal commands that I use on a daily basis and I believe, most of the developers use as well.

If you're completely new to this or if you want to learn more about the Linux terminal, I strongly recommend that you check on the links that I put down below in the resources. They will provide you with more in-depth explanations :)


pwd (Print Working Directory) - use this command to know in which directory you are currently in.

ls (list) - list all the files and directories of the directory you are currently in.

mkdir mydir (make directory) - create a new, empty directory.

cd mydir (change directory) - go to a directory.

rmdir mydir (remove directory) - delete a directory, but this will only work if the directory is empty. If it isn't and you still want to delete it, use rm -r mydir. I advise you to use this command very cautiously since you could end up deleting all or most of your files.

touch newfile - easiest way to create new, empty files.

cp filelocation newlocation (copy) - copy a file from one location to a new one.

mv myfile newfile (move) - the primary purpose of this command line is moving files and folders. It can also rename them since the act of renaming a file is interpreted by the filesystem as moving it from one name to another.

rm myfile (remove) - delete a file.

man mycommand (user manual) - if don't know how to use a command or if you just want to know more about it, use man. You can't go wrong with that one.

Resources :

Cover photo : Photo by Erol Ahmed on Unsplash

Top comments (3)

Collapse
 
marveen profile image
Rodrigo Valenzuela • Edited on

hi Mia ! i use de "tail" command a lot , perfecto to see the logs , and live logs from the machine using "tail -f /logfolder/logfile , and other great command is "grep" , when you need to find some TextCode inside de Filesystem that's the tool !!

i like your article and thakns to this and your twitter post now i get a Dev.to profile !
Take care #safeathome

sorry about the tarzan writing style !
rusty but allways trying!

Collapse
 
miabarbir profile image
Mia

Ha np, welcome to the DEV community and thank you for your feedback Rodrigo ! Those two commands are indeed really useful :)

Collapse
 
hottabxp profile image
Sergey

touch myfile - I do it so - > newfile

Let's Get Hacking

Join the DEV x Linode Hackathon 2022 and use your ingenuity and creativity to build using Linode.

β†’ Join the Hackathon <-