0% found this document useful (0 votes)
17 views

Chapter 2 - The Shell (Exercise) ANSWER

the shell

Uploaded by

Syafiq ikhwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Chapter 2 - The Shell (Exercise) ANSWER

the shell

Uploaded by

Syafiq ikhwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CMPD153 System Administration

CHAPTER 2: The Shell

Name: MUHAMMAD SYAFIQ IKHWAN BIN JAZMI (DC97549)


Name: MUHAMMAD RIFQI DANISH BIN AKHBAR NOBIS (DC97483)

There are specific commands for all the following tasks. Write the complete correct command.
(Assume that you run Ubuntu Server)

(a) Exit current user environment. [1 Mark]


exit

(b) Protect variable VALUE1 from reassignment. [2 Marks]


readonly VALUE1

(c) Go to home directory. [1 Mark]


cd

(d) Remove directory Data. [2 Marks]


rmdir

(e) Display current user(s) logged-in. [1 Mark]


who

(f) Create the directory with the name of ‘Final’. [2 Marks]


mkdir final

(g) Go into the ‘Final’ directory. [2 Marks]


cd final
CMPD153 System Administration

(h) Display current working directory. [1 Mark]


pwd

(i) Display the content of the ‘host_name’ file. [2 Marks]


pwd host_name

(j) Display current date and time. [1 Mark]


date

(k) Display name of the machine. [1 Mark]


hostname

(l) Create an empty file restaurant in current subdirectory. [2 Marks]


touch restaurant

(m) Delete restaurant file. [2 Marks]


rm restaurant

(n) Move the /all folder to current directory. [3 Marks]


mv /all

(o) Rename ‘host_name’ file as ‘my_hostname’. [3 Marks]


mv host_name my_hostname

The following questions related to Absolute and Relative Pathnames. Write the complete
correct command for both pathnames.

(a) Present location is /usr/local.


Remove abc.txt file located in current directory? [4 Marks]
CMPD153 System Administration

Absolute: rm abc.txt
Relative: cd ..

(b) Present location is /abc/xyz.


Remove hello.txt file in /abc/xyz/read/. [4 Marks]
Absolute: rm /read/hello.text
Relative: cd ../../..

(c) Present location is /etc/samba.


Change directory to /etc. [4 Marks]
Absolute: cd etc
Relative: cd ..

(d) Present location is /var/ftp/.


Change directory to /var/log. [4 Marks]
Absolute: cd /var/log
Relative: cd ../log

You might also like