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: *
Make directory. With this command, you can create a folder easily
After creating a directory/folder we need to go to that directory. We can do so with cd
#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.
So, you created a directory/folder now you want to delete it. You can do so with this command
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.
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:
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
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.
// remove file rm file.text //remove directory rm folder-name -r
This command is a fun one. It just prints out today's date, just for fun.
This command print out the current directory you are in.
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.
connect with me on Twitter at coderamrin
Top comments (9)
Thanks for the article , does this work for windows?🤔
If you use WSL2 (Windows Subsystem for Linux), you can find Windows files and directories at
/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
e, etc depending which drive you have Windows installed in.
Few don't work on windows such as "touch" and "ls" commands.
dude these are based on linux
with git bash I use them all the time on windows machine
few work in the Windows. Using powershell or Git bash.
I use windows,
with git bash
I have a request please edit your post and add linux and git bash in it it would be good if there are tags
Can I use these commands without terminal application? best tantrik in Borivali