You are on page 1of 6

National University of Technology

Department of Computer Science


CS4012 Database Systems Lab

Instructor Name: Madam Tabinda Grade:


Batch: 2018 Session: Spring 2021
Assessment Type: Inlab Assessment No. 01
Student Name: Ansar Iqbal Registration No. F18605005

Q. INLAB

TASK No. 01

In this activity, you are required to perform tasks given below:

1. Display your current directory.


2. Change to the /etc directory.
3. Go to the parent directory of the current directory.
4. Go to the root directory.
5. List the contents of the root directory.
6. List a long listing of the root directory.
7. Stay where you are, and list the contents of /etc.
8. Stay where you are, and list the contents of /bin and /sbin.
9. Stay where you are, and list the contents of ~.

1. Displaying the current Directory:


By running PWD Command in CLI we can find the current Directory as follows.

2. Change to the /etc directory:

3. Go to the parent directory of the current directory:


The parent directory can be found by running cd.. commad. The parent directory of current directory
is ansar@RealPC:~/home$ cd..

4. Go to the root directory:


By running command CD/ we can go into root directory.

Page |1
5. List the contents of the root directory.
By running command of ls ( stand for lists) we get the contents of our root directory. As shown
below

6. List a long listing of the root directory:


By running ls – l Command we will get detailed and long list of the root directory as shown below in
screen shot of CLI Terminal.

7. Stay where you are, and list the contents of /etc:


By running Linux command of ls /etc , I will still be there where currently I am and parallel I have get
the list of contents of /etc.

Page |2
8. Stay where you are, and list the contents of /bin and /sbin:
Ls /bin command is used to list down the contents of /bin and below is the very long list that are
shown below.

I have run the command of ls /sbin and display all the possible contents of it as shown below.

9. Stay where you are, and list the contents of ~:


With the help of ls ~ command , I have display the contents of ~ command that are Desktop,
Documents, Downloaads, Musics, Pictures, public, Templates and Videos.

<***********************Task 1 END************************>

Page |3
Task 2
Perform the following tasks using Linux CLI
1. Create a directory “mydir1” in Desktop Directory. Inside mydir1 create another
directory “mydir2”.
2. Change your current directory to “mydir2” using absolute path
3. Now, change your current directory to Documents using relative path
4. Create mydir3 directory in Documents directory and go into it
5. Now, change your current directory to mydir2 using relative path

1. Create a directory “mydir1” in Desktop Directory. Inside mydir1 create another directory
“mydir2”.

I have run following 4 lines command to make mydir1 in Desktop Directory, then mydir2 in mydir1.
Codes is shown below and and created directory is also attached below.

Screen shot of mkdir2 in mydir1 and mydir1 is in desktop and desktop is in home.

2. Change your current directory to “mydir2” using absolute path


So I have used the absolute path and change the current directory from mydir1 to mkdir2 as shown
below. Current directory was mydir1 and now directory has become mkdir2. So I have changed it.

3. Now change your current directory to Document using relative path


I was in directory of mkdir2, so I have changed my directory from mkdri2 to Documents from
following relative path.

4. Create mydir3 directory in Documents directory and go into it


I have created the mydir3 in Documents and then I went to in this directory as shown below.

Page |4
5. Now, change your current directory to mydir2 using relative path

Currenty I was in mydir3 under Documents, so by running following relative path, I changed my
current directory to mkdir2 that was in mydir1 on Desktop.

Page |5
Post Lab Task

Considering the above activities, perform the following tasks


1. move myfile to mydir1
2. copy myfile to mydir2
3. copy mydir2 on Desktop
4. delete mydir1 (get confirmation before deleting)
5. Rename myfile to mynewfile

1. move myfile to mydir1


First I created a myfiel by using touch command and move myfile to mydir1 as shown below.

<*********************************************>

Respected ma’am,I am Feeling difficulties in post lab, and unable to complete my post lab task.

<***************************END**************************>

Page |6

You might also like