IT Knowledgebase
< All Topics
Print

16 Windows Terminal commands every user should know

1. Change Directory

Command: cd

What it does: Changes the directory of the command line path.

Example: cd “path/to/directory/” (Figure A)

Figure A

terminalcommandsfiga021116.jpg

2. Listing Directory

Command: ls

What it does: Lists the contents of a directory.

Example: ls “path/to/directory/” (Figure B)

Figure B

terminalcommandsfigb021116.jpg

3. Open files

Command: open

What it does: Opens a file.

Example: open “filename” (Figure C)

Figure C

terminalcommandsfigc021116.jpg

4. Copy a file to another directory

Command: cp

Example: cp “filename” “newfilename” (Figure D)

Figure D

terminalcommandsfigd021116.jpg

5. Move a file

Command: mv

Example: mv “filename” “path/to/new/file/location” (Figure E)

Figure E

terminalcommandsfige021116.jpg

6. Renaming a file

Command: mv

Example: mv “path/to/filename” “path/to/newfilename” (Figure F)

Figure F

terminalcommandsfigf021116.jpg

7. Create a directory

Command: mkdir

Example: mkdir “path/to/new/directory” (Figure G)

Figure G

terminalcommandsfigg021116.jpg

8. Remove an empty directory

Command: rmdir

Example: rmdir “path/to/directory” (Figure H)

Figure H

terminalcommandsfigh021116.jpg

9. Remove nested directories

Command: rm -R

Example: rm -R “/path/to/root/directory” (Figure I)

Figure I

terminalcommandsfigi021116.jpg

10. Execute commands with superuser privileges

Command: sudo

Example: sudo “command” (Figure J)

Figure J

terminalcommandsfigj021116.jpg

11. List actively running computer processes

Command: top

Example: top (Figure K)

Figure K

terminalcommandsfigk021116.jpg

12. Quit sub-screen and return to Terminal

Command: q

Example: After executing a command, such as “top” to view active processes, press “q” to exit. (Figure L)

Figure L

terminalcommandsfigl021116.jpg

13. Clear the Terminal screen of all previous commands

Command: Clear

Example: clear (Figure M)

Figure M

terminalcommandsfigm021116.jpg

14. Get help for a command

Command: help

Example: help “command” (Figure N)

Figure N

terminalcommandsfign021116.jpg

15. Get one-line description for a command

Command: whatis

Example: whatis “command” (Figure O)

Figure O

terminalcommandsfigo021116.jpg

16. Show manual page for a command

Command: man

Example: man “command” (Figure P)

Figure P

terminalcommandsfigp021116.jpg

The “exit” command

A special note goes out to the “exit” command, which closes the Terminal session.

Command: exit

Example: exit (Figure Q)

Figure Q

terminalcommandsfigq021116.jpg

Ref: http://www.techrepublic.com/article/16-terminal-commands-every-user-should-know/

Messenger