This is a list of terminal [or command line] commands every beginner should familiarize themselves with. This gist file is a manual for this video:
- Up Arrow — Shows the previous command executed. If you continue to press it, it gives you more and more commands you executed. YOu can also press the down arrow to see the previous command after pressing Up arrow.
- Home button — Takes the cursor to the start of the command line
- End button — Takes the cursor to the end of the command line
CTRL + F
— Takes the cursor one character forwardCTRL + B
— Takes the cursor one character backwardALT + F
— Takes the cursor one word forwardALT + B
— Takes the cursor one word backwardCTRL + A
— Takes the cursor to the start of the command lineCTRL + L
— Clears the terminalCTRL + XX
— Switch the cursor position between the current and last positionCTRL + C
— Bursts the currently executing commandCTRL + D
— Closes the terminal
whoami
— Prints the user information.clear
— Clears the command line. In the standard windows command line, you have to entercls
to do the same thing.sudo ...
— The command you have to attach prepend to any command that requires administrative permisions.echo <string>
— The echo command outputs a string to the terminalman
— Stands for "manual". It displays the user manual of any commandcommand --help
— Shows the help menu of a command
A flag modifies what a command does. As I proceed, I'll talk about the flags of a particular command.
pwd
— Shows the current working directory.cd <path>
— Stands for "change directory". It channges the present working directory to the specified directory.ls
— List the content (files and folders) of the present working directory. In the windows command line, you have to enterdir
to do the same thing.mkdir
— Stands for "make directory". It creates a new folder.rmdir
— Stands for "remove directory". It deletes a folder.
touch <filename>
— Creates a new filemv <old name> <new name>
— Renames a file or folder. You can also use it to move a file to a particular folder.rm
— Deletes a filecp <old name> <new name>
— Copies and pastes a file. The old name is the name of the file and the new name is the name you want to assign to the pasted copy of the file.head <filename>
— Prints the first 10 lines of a file. YOu can use the-n
flag with it to print more than 10 lines.tail <filename>
Prints the last 10 lines of a file. YOu can also use the-n
flag with it.cat <filename>
— Prints all the content of a file. You can also use it to add more content to a file.wc
— Stands for word count. It shows the number of lines, number of words, and the byte size in a file.find
— Prints the file tree of the CWDfind -name <filename> or <foldername>
— Searches and locates a file or folder