Lab#2

Lab 2 Description

In this lab we will test the following commands: mkdir, cp, mv, rm, help, man, whatis, alias.

Command mkdir:

This command creates a new directory or a sequence of new directories. In the following the directories mk4, mk5, and mk6 are created.

mkdir command

Command cp:

This command is used to copy files or directories. In the following case there are two files in directory kd1 and the text file kd2 is copied into directory kd2. In addition, there five options with cp -a which copies ownership and permissions as well, -i which asks the user before copying, -r which is used for copying directories and the folders and files inside, -u for copying files from one directory to another that are updated or non-existent, and -v which shows the information while the copy is taking place.

cp command

Command mv:

This command is used to move files and directories around as well as renaming them. In the following case the file myname in directory kd1 is moved out to directory kd3. In addition, there are three options that go with command as well -i which asks the user before performing the moving, -u which will move files that are either new or non existent in the location moving to, -v which displays information while the move is happening.

mv command

Command rm:

The following command rm is used to remove files or directories. In the case of the following there is a file name myname in directory kd1, when rm myname is entered and then followed by the command ls what is seen is that the file is no longer existent. In addition, there are four additional options with this command -i which asks the user before removing, -r which is used for deleting directories and subdirectories, -f does not ask the user and do not bother telling the user if file or directory does not exist, and -v which displays information while the removal is happening.

rm command

Command help:

The following command help when used with Linux commands outputs information about that command. In this case the following being help echo where it displays information on what the echo command does the options available for it.

help command

Command man:

The following command displays a manual for Linux command that is entered after it. In this case the command used is man mtr which displays the manual the network check tool (ping/traceroute). This command functions similar to help in the sense that is describes what the command does and list the options available with it.

man command

Command whatis:

The following command provides a short description of what the command does. In the following case the whatis command is used with rm, mv, and ls in which case after each one it lists the command followed by a short description of what each one of these commands do.

whatis command

Command alias:

The following command allows the user to create their own commands using already existing Linux commands and make shortcuts as well using existing commands. In the following case ls ls alias to the keyboard button l and pwd is alias to the keyboard button p. So in order to use the command ls the letter l just needs to be entered and the same thing for pwd by entering the letter p.

alias command

Leave a Reply

Your email address will not be published. Required fields are marked *