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

Cover image for 10 terminal commands every developer should know
Amrin
Amrin

Posted on • Updated on • Originally published at coderamrin.hashnode.dev

10 terminal commands every developer should know

As a developer command line is a crucial skill to have. So, in this article, I’ll share the top 10 command line command every developer should know.

Let’s get started.

*If you prefer video then check it out: *

#1. mkdir

Make directory. With this command, you can create a folder easily

mkdir folder-name
Enter fullscreen mode Exit fullscreen mode

#2. cd

After creating a directory/folder we need to go to that directory. We can do so with cd

cd folder-name
Enter fullscreen mode Exit fullscreen mode

#3. cd ../

The next one is cd ../ this command used to go one step back. For example, if you are inside β€œfolderA” and it’s on the desktop. You can use this command to go back to desktop.

cd ../
Enter fullscreen mode Exit fullscreen mode

#4. rmdir

So, you created a directory/folder now you want to delete it. You can do so with this command

rmdir folder-name
Enter fullscreen mode Exit fullscreen mode

#5. touch

We need to create files a lot. we can do that easily with this command.

this command will create a .html file. when creating a file don’t forget to add the extension.

touch index.html 
Enter fullscreen mode Exit fullscreen mode

#6. ls

If you want to see how many folders and files a directory have. You can use this command to see. All you need to do is go to that directory and run this:

ls
Enter fullscreen mode Exit fullscreen mode

#7. mv

With this command, you can move a file to another directory. You need to provide the file name and the directory you want to move the file. like this:

mv file.txt moveTo
Enter fullscreen mode Exit fullscreen mode

#8. rm

With is the command you can delete a file and a folder. When you want to delete a folder with this command just add an -r flag at the end.

like this:

// remove file
rm file.text

//remove directory
rm folder-name -r
Enter fullscreen mode Exit fullscreen mode

#9. date

This command is a fun one. It just prints out today's date, just for fun.

date
Enter fullscreen mode Exit fullscreen mode

#10. pwd

This command print out the current directory you are in.

pwd
Enter fullscreen mode Exit fullscreen mode

Conclusion

Working with the command line makes a programmer's life a lot easier. If you don’t use the command line, I highly recommend starting using it.

If you enjoyed reading this article, I think you’ll also enjoy my newsletter where I share my articles and videos, and resources I found online.

Subscribe Now!

connect with me on Twitter at coderamrin

Top comments (9)

Collapse
 
davidbug profile image
davidildefonso

Thanks for the article , does this work for windows?πŸ€”

Collapse
 
lionelrowe profile image
lionel-rowe • Edited on

If you use WSL2 (Windows Subsystem for Linux), you can find Windows files and directories at /mnt/c* (e.g. /mnt/c/Users/<Your Username>/Documents), then traverse and manipulate them as if they were Linux files. You can even set it as your default terminal, then you get easy access to it though Windows Explorer > right click > Open in Terminal.

Git Bash will work for the commands in this article but doesn't give you the full power of Linux. WSL2 is much more powerful.

* Replace with d, e, etc depending which drive you have Windows installed in.

Collapse
 
alsharqawy25 profile image
Mohamed Elsharqawy

Few don't work on windows such as "touch" and "ls" commands.

Collapse
 
azlan_syed profile image
Azlan-Syed

dude these are based on linux

Collapse
 
coderamrin profile image
Amrin

with git bash I use them all the time on windows machine

Collapse
 
romulo2735 profile image
Romulo Sousa

few work in the Windows. Using powershell or Git bash.

Collapse
 
coderamrin profile image
Amrin

I use windows,
with git bash

Collapse
 
azlan_syed profile image
Azlan-Syed

I have a request please edit your post and add linux and git bash in it it would be good if there are tags

Collapse
 
keithymayes profile image
KeithyMayes

Can I use these commands without terminal application? best tantrik in Borivali

We are hiring! Do you want to be our Senior Platform Engineer? Are you capable of chipping in across sysadmin, ops, and site reliability work, while supporting the open source stack that runs DEV and other communities?

This role might just be for you!

Apply now