DEV Community

Simc Dev
Simc Dev

Posted on • Originally published at cmsinstallation.blogspot.com

15 Best Terminal Commands That You Should Know

As a developer, they are working with SSSL(Server Site Scripting Language), Programming languages, and other languages and software too. So, they work with a terminal which is a tool, that gives information about your pc, allowing unknown sources, etc. Terminal wants a particular command to run and there are lots of commands are available to use. Here, you can see the one of best commands for a terminal. So, let's see the commands for the terminal.

List of Best Commands For Terminal

  1. PWD(present working directory)
  2. cd(change directory)
  3. ls
  4. mkdir(make directory)
  5. echo
  6. touch
  7. cat
  8. diff
  9. head
  10. tail
  11. rm(remove directory)
  12. clear
  13. Redirection operators (> & >>)
  14. cp
  15. mv

1. PWD - best command for terminal

PWD command stands for present working directories from your computer device. It reflects your prevailing location to the file.

Syntax of PWD:
pwd -L: Prints the symbolic path.
pwd -P: Prints the actual path.
Enter fullscreen mode Exit fullscreen mode

2. CD - best command for windows

CD command stands for changing your directory from your current location.

It is used to change your current location on the computer by selecting a different part in your pc. But you want to define the particular part below to change your location. It's one of the best commands for terminal.

And there are some tricks to go back and ahead. If you want to go back simply type the .. for it and you want back multiple times you add in it / sign.

Syntax of  CD:
cd /
cd
../cd 
Enter fullscreen mode Exit fullscreen mode

3. ls

ls gives you a content list of current directory.

Syntax of ls:
ls
ls -l
ls -a
Enter fullscreen mode Exit fullscreen mode

4. MkDir - Best Command For Windows

MkDir command is used to make directories in the computers. It is also known as make directory in terminal. You can also create multiple directories using this command, it takes permission accepted by you.

Syntax of  MKDIR:
mkdir [options...] [directories ...]
Enter fullscreen mode Exit fullscreen mode

5. echo - Best Command in PHP

By using echo you can print anything as you want. It prints strings/parameter also for best outputs. To print a string you need to assign $ sign before the variable to print.

Synyax of echo:
echo [option] [string]
Enter fullscreen mode Exit fullscreen mode

6. touch - Most used command in terminal

Mostly touch command is used to create a file in pc. It also used for change file access and modification time of particular file. If the file is not available in directory then it create new file.

Syntax of touch:
touch file_name
Enter fullscreen mode Exit fullscreen mode

7. cat - best shortest command in terminal

cat command is used to concatenate the strings and variable to get the best outputs. It is generally used for combine code in single line.

Syntax of cat:
$cat filename
Enter fullscreen mode Exit fullscreen mode

8. diff - Best command to compare strings

diff command is used to compare lines or strings and get the difference between each file. Let's see the syntax of diff command. It's one of the best commands in terminal.

Syntax of diff:
diff [OPTION]... FILES
Enter fullscreen mode Exit fullscreen mode

9. head - Best command to print content in terminal

head command is used to print the content of file from beginning. It is used to print headings in a file. Its one of the best commands in terminal.

Syntax of head:
head [OPTION]... [FILE]...
Enter fullscreen mode Exit fullscreen mode

10. tail - Best commands for terminal

tail command is used to print content of file from the end. It is generally used to print the conclusions or massages. It's one of the most used commands in terminal.

Syntax of tail:
tail [OPTION]... [FILE]...
Enter fullscreen mode Exit fullscreen mode

11. RM - Best commands for windows

rm command is used to delete directory from file in pc. You need to just define part of directory and then it removed by the using command. Let's see the syntax of the command.

Syntax of rm:
rm -i mydir
rm -i mydir/*
Enter fullscreen mode Exit fullscreen mode

12. clear - Most used commands for terminal

This command is used to clear the screen of pc. It is used to clear out the current terminal window and takes back the prompt to the top position of the terminal window.

Syntax of clear:
Ctrl+L
Enter fullscreen mode Exit fullscreen mode

13. Redirection Operators

is used to redirect the output from command to pass the another file. It will overwrite the content of file. Its one of the best commands for terminal.

Syntax of operator:
ls -al > listings

  1. cp - Best command for terminal & windows users cp command is used to copy file from one directory to another one.
Syntax of cp:
cp [OPTION] Source Destination
cp [OPTION] Source Directory
cp [OPTION] Source-1 Source-2 Source-3 Source-n Directory
Enter fullscreen mode Exit fullscreen mode

15. mv - Most used commands for terminal

mv command is used to move file in one directory to another directory. Its one of the most used commands in terminal.

Syntax of mv:
$ mv [options] source dest
Enter fullscreen mode Exit fullscreen mode

Top comments (12)

Collapse
 
vlajd profile image
Vlajd • Edited

Did youean ls instead of 1s or did I never know you can type 1s as well?

Collapse
 
devsimc profile image
Simc Dev

it was a typo error... i corrected it.. Thanks for update

Collapse
 
devsimc profile image
Simc Dev

even on my blog its like that only.... i never noticed it...thanks man...
cmsinstallation.blogspot.com/2021/...

Collapse
 
gajjardarshithasmukhbhai profile image
Darshit Gajjar

Great, Make more content

Collapse
 
devsimc profile image
Simc Dev

You can visit my blog for more content

Collapse
 
devsimc profile image
Simc Dev

Link is there in original post link

Collapse
 
souksyp profile image
Souk Syp. • Edited

clear instead of Ctrl + L.
Also arrow up and down to use previous commands.

Collapse
 
devsimc profile image
Simc Dev

There is difference in Ctrl + L and clear
Ctrl + L --> it will clear last fired Command
Clear --> it will clear the whole window

Collapse
 
chrisgreening profile image
Chris Greening

Great introduction, thanks for sharing!

Collapse
 
andrewbaisden profile image
Andrew Baisden

Amazing list!

Collapse
 
dantedenzel profile image
Dante Burnett

great blog, thanks for the post!

Collapse
 
devsimc profile image
Simc Dev

Cheers