Skip to content

Basics commands

CiamalaKombeGreg edited this page Oct 5, 2023 · 24 revisions

Basic commands of linux shell


man

The command man display a small manual with a explanation of how to use a command. You can write it man <command>. It is really useful as it give you all prefix that you can use with the command.

man ls
man mv

cd

The command cd allow you to navigate between directories. You can change from the current directory to another one by typing the name of the directory you want to go in cd <directory>, with the directory path cd /<directory>/<directory>/<directory>.

#I'm in system and I want to go in the directory documents

cd /home/system/documents
cd documents

There is also the possibility of using cd to step back in the parents directory by using cd alone which send you back to the root directory or cd .. and cd ../ who make you return to the parent directory of the current one.

#I'm in documents and doing cd while send me back to system

cd /home/system/documents
cd ..

pwd

This command give your current location. You can just type pwd.

mkdir

It create a simple directory if it doesn't exist. You can write it mkdir <directory>.

mkdir test1

touch

It can help create a simple file if it doesn't exit, but it principally update the access and modification time of a existing file to the current one. You can type it touch <file>.

touch test

cat

The command cat show the output of a file if it exist. You can use by typing cat <file>.

cat test

mv

Could be use for different result, you can use it to move a file or directory (mv <source> <destination>) but it is also possible to rename them by putting the exact same location as a destination, in short typing mv <source> <new name>.

Clone this wiki locally