Mand Line

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

shell:

a program that takes input from the user and sends it to the operating system.

terminal:
a program that launches a shell.

basic commands:
echo : prints the arguments to the command line.
pwd : prints the full path of the current working directory.
cd : change directory.

.. : moves up one level in the directory tree.


/ : moves to the root directory.
~ : moves to the home directory.
- : moves to the previous directory.
ls : lists the directories and files in the current directory.
-a : lists hidden files/directories in the directory.
-l : lists files/directories in long format.
touch : create an empty file or update the timestamp of an existing file.
file : displays the type of data contained in a file.
cat : read a file/concatenate files.
less : display the contents of a file one screen at a time.
q : quit out to shell.
g : move to the beginning of the file.
G : move to the end of the file.
/ : search in a file.

history : display a list of previously executed commands.


clear : clears the terminal screen.
cp : copy a file.
-r : recursively operates on all files in a directory.
-i : prompts the user before operating on a file.
mv : move or rename a file/directory.
-b : back-up before over-writing a file.
mkdir : create new directory.
-p : create sub-directories simultaneously while creating a directory.
rm : remove a file.
-f : remove all files including write-protected file.
rmdir : removes an empty directory.
find : find a file/directory.
<<find absolute_path option>>
-type : d - search for directories.
f - search for files.
-name : search for files with a specific name/pattern.
alias : create an alias for a command.
*to create a permanent alias, append the alias to the end of the .bashrc
file.
unalias : remove an alias.
exit : exit the terminal.

You might also like