Lab 2

mkdir – creates a directory.

mkdir

On the terminal screen, nothing will appear but when you go to the home folder, a new directory (folder) was created called lab1.

mkdir_1


cp – copies a file or directory.

cp

In the picture above, a file ‘gm’ is in the home folder. When we type ‘cp gm gm1’, the original file gm is copied and a duplicate is created but it is now named gm1 as shown in the picture below. The contents in ‘gm’ and ‘gm1’ are still the same.

cp_1


mv – performs file moving or file renaming.

mv

In the picture above, the file ‘gm1’ is in the home folder. When you type ‘mv gm1 Document ‘ in the terminal screen, the file ‘gm1’ is removed from the home folder and is placed in the Documents folder as shown in the picture below.

mv_1


rm – used to remove files and directories.

rm

 

In the picture above, the file ‘gm’ is in the home folder. After typing “rm gm’ on the terminal screen, the file ‘gm’ is removed as shown in the picture below.

rm_1


help – display information about a command.

When you type ‘help cd’ on the terminal screen, a list of information will be displayed on the screen about the command ‘cd’.

help


man – displays the manual of a command.

When you type ‘man bash’ on the terminal screen, the manual for the command ‘bash’ will appear on the terminal screen.

man


whatis – displays the name and a one-line description of a man page matching a specified keyword.

whatis


alias – to create your own composite commands.

On the terminal screen, when you type ” alias food=’ls’ “,you assign the command ‘ls’ to the word food. Then, when you type the word food in the terminal screen, the program will run the word food as the command ‘ls’ and it will display the files and sub-directories in the current working directory.

alias