Console Commands Every Developer Should Know

Natalia Wit
3 min readAug 10, 2020

--

Console Commands can make your life as a developer so much easier once one becomes comfortable with using it. Using the Terminal for the first time may be a little intimidating at first but very rewarding once you get a lot more practice with it.

1. ls

$ ls is used to list out files and directories in the current path. If the pathname is a file, it will show you all the information about that file. Otherwise, if the pathname is a directory, it will show you all the files inside that directory as well as its subdirectories.

2. pwd

$ pwd command is used to print out the current working directory. The output result will print out the full system path.

3. cat

$ cat filename.js is used to displaying files as well as combining them. The most common use of cat command tool is to read the content files.

4. echo

$ echo “example text” the echo command is used to display a line of text or string that may be used in an argument. The echo is mainly used in shell scrips and batch files to output status text to the screen or a file.

5. touch

$ touch filename is used to create a new blank file. This command is widely used when users start a new project and don’t have any data to store in it.

6. mkdir

$ mkdir new-directory-name may seem pretty obvious once you read it but it is used to make a new empty directory in the current path. Instead of clicking add a new directory in your editor, you can manually do it in your terminal.

7. rm

$ rm existingFileName is used to remove an existing file. It is important to note that by default rm does not remove directories and to do so, use $ rm -rf directory-name.

  • *Command used to remove an existing directory will remove it regardless if there is any files/content in it or not.

8. rmdir

$ rmdir directory-name command is used to remove a directory if there isn’t any content inside of the directory.

9. tail

$ tail existingfile command is used to rea da file and outputs the last part of it. It is most useful when going through crash reports or previous history logs.

10. find

$ find command is used to search for files. The find command lets you search for the same type of files in a directory (and its subdirectories).

11. mv

$ mv exisitingFile /to/another/path command moves files or directories from one place to another.

Conclusion

These are the commands I found myself using the most on my journey of learning how to code. At first, I found myself being very intimidated using the terminal but after a while, I realized it only makes your life easier. If you guys have any other commands that you find yourself using often then please reach out so I can include it in the list.

--

--