NEW
Font size
WorksheetsUNIX and Shell Programming: Module 3 – File Attributes (MCQs)
Total questions: 42
Worksheet time: 21mins
Which command is used to list the attributes of a file?
cp
list
ls
attr
Which one of the following is not an attribute displayed by ls command?
file permissions
file ownership
links
word count of file
Hard linked files are provided with the same inode number as the original one.
True
False
Soft linked files are provided with different inode number as the original one.
True
False
Which option is used with ls command to list the directory attributes rather than its contents?
-b
-a
-l
-d
A file can be recognized as an ordinary file or directory by ____ symbol.
$
-
*
/
How many types of permissions a file has in UNIX?
1
2
3
4
Permissions of a file are represented by which of the following characters?
r, w, x
e, w, x
x, w, e
e, x, w
A file named abd.txt has the following set of permissions -rwxrwxrwx All the three operations i.e read, write and execute can be performed on the file by file owner, group owner and others.
True
False
Which of the following symbol is used to indicate the absence of a permission of a file?
$
&
+
-
What is group ownership?
group of users who can access the file
group of users who can create the file
group of users who can edit the file
group of users who can delete the file
A file has permissions as rwx r– –. A user other than the owner cannot edit the file.
True
False
If a file is read protected, we can write to the file.
True
False
The write permission for a directory determines that ____________
we can write to a directory file
we can read the directory file
we can execute the directory file
we can add or remove files to it
Which of the following is default permission set for ordinary files?
rw-rw-rw-
rwxrwxrwx
r–r–r–
rw-rw-rwx
Which of the following is default permission set for directories?
rw-rw-rw-
rwxrwxrwx
r–r–r–
rw-rw-rwx
A file owner does not have a permission to edit the file but the group to which the file owner belong do have the permission to edit it. Can owner edit the file?
Yes
No
Cannot be defined
Error will be encountered
Which command is used to change the permissions of a file?
chmod
ch
chown
chgrp
chmod command can be used in ____ ways.
3
2
5
0
The expression used with chmod command to change permissions in a relative manner contains ____ components.
5
2
4
3
Which of the following characters specify the user and group category?
'u' and 'g'
'g' and 'o'
'us' and 'gr'
'u' and 'o'
Which of the following symbol is used with chmod to assign permission to a file?
-
/
+
*
To assign execute permission to the user (owner) for a file named file01.txt, which of the following command will be used?
chmod u+r file01.txt
chmod u+w file01.txt
chmod u-x file01.txt
chmod u+x file01.txt
A file named file01 should be readable, writable and executable only by the user(owner). Which one of the following set of command will be used?
chmod 700 file01
chmod 000 file01
chmod 477 file01
chmod 777 file01
Which command is used to change the ownership of a file?
chmod
change
ch
chown
Which option is used for the recursive functioning of chmod command?
-R
-r
-l
-i
Which command is used to change the group owner of the file?
chown
ch
chgrp
chmod
Like chmod, chown and chgrp can also use ___ option.
-R
-r
-x
-i
Which editor is used by the UNIX system to edit files?
vi
notepad
word
notepad++
What does the following command do? $ vi file001
open file named file001
edit file named file001
delete a file named file001
open file if it exists else creates a new file
How many types of modes are used by vi editor?
2
4
3
1
What is the default mode of vi editor?
Command mode
Input mode
Ex mode
Insert mode
To insert text into a file, _____ mode is used.
Command mode
Input mode
Ex mode
def mode
ex mode is used for what purpose?
file handling
substitution
file handling and substitution
Inputting text in files
Which one of the following key is used to switch from command mode to input mode?
i
:
esc
;
________ key is used for switching to command mode from input mode.
i
A
:
esc
Which of the following key is used to enter in ex-mode?
ESC
i
:
;
To clear the screen in vi editor, _____ is used.
ctrl-h
ctrl-l
ctrl-p
ctrl-v
To quit vi editor without saving the buffer we can use
:q
:c
:w
:q!
One of the most important features of vi editor is _______
available mostly across all UNIX platforms
easy to learn
latest editor
powerful than other editors
Commands inputted in command mode don’t appear on the terminal.
True
False
While entering text in input mode the data is saved in _____
buffer
disk
RAM
cache
