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

Week 1 Graded Assignment

Uploaded by

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

Week 1 Graded Assignment

Uploaded by

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

System Commands, Week 1

Graded Assignment
Problem 1
The option used along with 'ls' command to display the hidden files is ......... (Do not add hyphen).
(NAT)

Answer
a

Problem 2
Which directory contains the information related to host specific system configuration files?

A. /bin
B. /opt
C. /media
D. /etc

Answer
(D)

Problem 3
What does the first column of the output of the command "ls -l" represent? (CQ)

A. Name of the user


B. Name of the group
C. Type of files and permissions
D. Number of hard links

Answer
(C)

Problem 4
Given below is the output of the command ls -l . What can you know about the file/directory
abc.ab from the output?

total 4
drwxr-xr-x 1 runner runner 0 Dec 20 09:37 abc.ab
-rw-r--r-- 1 runner runner 16 Sep 23 02:52 main.sh

(MSQ)
A. All users can execute the file abc.ab .
B. All users can cd into the directory abc.ab , i.e. make it their working directory.
C. All users can edit the contents of the directory abc.ab .
D. All users can list the contents of the directory abc.ab .
E. Only the owner can read the file abc.ab .
F. All users can read the file abc.ab .
G. Only the owner can read the directory abc.ab .

Answer
(B) and (D)

Problem 5
What is the command to change the permission of the file myfile.sh such that the owner has
full access, the group has read and execute access and other users have only read access? (MCQ)

A. chmod 457 myfile.sh


B. chmod 754 myfile.sh
C. chmod 751 myfile.sh
D. chmod 157 myfile.sh

Answer
(B)

Problem 6
What is the expected output of the command date myfile.txt ? (MCQ)

A. Displays the date at which file was last edited.


B. Modifies the time stamp of the file.
C. date: invalid date ‘myfile.txt’
D. None of the above

Answer
(C)

Problem 7
The file "longFile.txt" has 5000 lines. From the commands given below which command can be
used to read the file in a page by page manner? (MSQ)

A. more
B. less
C. cat
D. echo

Answer
(A) and (B)

Problem 8
Match the following:

Commands Uses

1. mv A. Delete a file

2. rm B. Display the type of file

3. file C. See memory statistics

4. free D. rename a file

A. 1-B, 2-D, 3-A, 4-C


B. 1-D, 2-A, 3-C, 4-B
C. 1-C, 2-B, 3-D, 4-A
D. 1-D, 2-A, 3-B, 4-C

Answer
(D)

Problem 9
A workstation is being shared by two users who are on different groups.

When the User 1 runs ls -l on their terminal, the output is

--w-r--r-- 1 user_1 group_a 4148 Jan 8 10:50 FileA.txt


-r--r--r-- 1 user_1 group_a 3888 Jan 20 16:00 FileB.txt
--w-r--r-- 1 user_1 group_a 3849 Jan 10 13:33 FileC.txt
-rw-r--r-- 1 user_1 group_a 5952 Jan 10 11:40 FileD.txt
-rw-r--r-- 1 user_1 group_a 3053 Jan 10 23:11 FileE.txt
-rw-r--r-- 1 user_1 group_a 5450 Feb 15 10:40 FileF.txt
d--------- 4 user_1 group_a 128 Feb 17 17:30 More_Files

When the User 2 runs ls -l on their terminal, the output is

-r--r--r-- 1 user_2 group_b 4148 Jan 8 10:50 FileA.txt


-rw-r--r-- 1 user_2 group_b 3888 Jan 20 16:00 FileB.txt
-r--r--r-- 1 user_2 group_b 3849 Jan 10 13:33 FileC.txt
-rw-r--r-- 1 user_2 group_b 5952 Jan 10 11:40 FileD.txt
-r--r--r-- 1 user_2 group_b 3053 Jan 10 23:11 FileE.txt
-rwxr--r-- 1 user_2 group_b 5450 Feb 15 10:40 FileF.txt
dr--r----- 4 user_2 group_b 128 Feb 17 17:30 More_Files

Which of the following commands can be run by User 1?

(A) cat FileA.txt

(B) cat FileD.txt

(C) echo "Hello World" >> FileB.txt

(D) ls More_Files
Answer
(B)

Problem 10
Ram is new to Linux, and wants to delete a file file_to_delete.txt in the current directory,
using command line. Upon using the command rm ./file_to_delete.txt , he was unsuccessful.
If the output of ls -l is as follows, then which of the following commands must be run inorder to
delete the file?

-rwxr--r--@ 1 ram staff 104706 Nov 17 17:00 file_1.sh


-rw-r--r-- 1 ram staff 119125 Nov 17 17:00 file_2.sh
-r--r--r-- 1 ram staff 0 Nov 17 17:00 file_to_delete.txt
-rwxr-xr-x@ 1 ram staff 0 Nov 17 17:00 test.sh

(A)

chmod 110 file_to_delete.txt


rm file_to_delete.txt

(B)

chmod 400 file_to_delete.txt


rm file_to_delete.txt

(C)

chmod 600 file_to_delete.txt


rm file_to_delete.txt

(D)

chmod 500 file_to_delete.txt


rm file_to_delete.txt

Answer
(C)

You might also like