Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

tar command can use the standard input to obtain its file list.(a) True(b) FalseThis question was posed to me in an online quiz.I need to ask this question from Administrator Specific Commands and Privileges topic in section Essential Shell Programming of Unix

Answer»

Correct CHOICE is (B) False

The explanation is: tar command cannot use the standard input to obtain its FILE list. It accepts only file and directory NAME as arguments.

2.

For restoring files using tar, ____ option is used.(a) -a(b) -c(c) -v(d) -xThe question was asked in an interview for job.My doubt is from Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer»

Right answer is (d) -x

Explanation: FILES can be restored USING -x option with the tar command. When no file or DIRECTORY is specified it restores all the files from the BACKUP device.

3.

For displaying the archive, -t option is used with the tar command.(a) True(b) FalseThis question was posed to me during an interview.Question is from Administrator Specific Commands and Privileges topic in section Essential Shell Programming of Unix

Answer»

Right answer is (a) True

The BEST EXPLANATION: -t option ALIKE cpio is also used with tar command for displaying the archive. For EXAMPLE,

4.

tar command uses ___ option for backing up files.(a) -a(b) -c(c) -d(d) -fThe question was asked during an interview.The question is from Administrator Specific Commands and Privileges in division Essential Shell Programming of Unix

Answer»

Correct CHOICE is (b) -C

Explanation: The tar (tape archive) command is more powerful than cpio command. For creating a backup using tar, we have to use the -c OPTION. For example,

5.

Which of the following options are used with the cpio program?(a) -a(b) -i(c) -o(d) -i and -oI have been asked this question during an interview.The doubt is from Administrator Specific Commands and Privileges in chapter Essential Shell Programming of Unix

Answer»

The correct OPTION is (d) -i and -o

To explain: cpio COMMAND uses two key OPTIONS, -o (output) and -i (input). The -o option is USED for backing up files while the -i option is used for restoring files.

6.

cpio program can be used with redirection and piping.(a) True(b) FalseThe question was asked in an interview for internship.The origin of the question is Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer» RIGHT answer is (a) True

Easy explanation: The cpio COMMAND copies FILES to and from a backup DEVICE. It uses the standard input for taking the list of filenames and then copies them with their content and header to standard output which can also be redirected to a file or a device. HENCE, cpio can be used with redirection and piping.
7.

For formatting diskettes, we can use the _______ command.(a) format(b) fdformat(c) frmt(d) format and fdformatI got this question during an online exam.I'm obligated to ask this question of Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

Correct answer is (d) format and fdformat

For explanation: Before backing up data to a FLOPPY, we may need to format it. For this PURPOSE, either format or fdformat command is USED (whichever is SUPPORTED by your system).

8.

Which of the following is a backup program?(a) bckup(b) trap(c) ciop(d) cpioThe question was posed to me by my college director while I was bunking the class.The doubt is from Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer»

The correct OPTION is (d) cpio

Explanation: As a system administrator, you are RESPONSIBLE for creating a BACKUP of the data which resides on your system. For this PURPOSE, there are mainly two backup PROGRAMS which are extensively used i.e. cpio and tar. The cpio command copies files to and from a backup device.

9.

___ command performs copying of diskettes.(a) pp(b) df(c) du(d) ddThis question was posed to me by my college professor while I was bunking the class.Query is from Administrator Specific Commands and Privileges in chapter Essential Shell Programming of Unix

Answer»

The correct choice is (d) dd

To EXPLAIN I would say: dd (disk jump) COMMAND can be used in copying FILES systems, but is majorly used for copying media (floppies and TAPES).

10.

The set of routines needed to operate a specific device is known as ________(a) device file(b) device program(c) device driver(d) device softwareI have been asked this question in semester exam.My question is based upon Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer»

The CORRECT CHOICE is (c) device driver

The explanation is: The set of routines needed to operate a specific device is known as a device driver. Whenever a PARTICULAR device is accessed, the kernel calls the correct device driver and PASSES some PARAMETERS to it.

11.

All the device files are stored in _____(a) kernel(b) /home/usr(c) /dev(d) /homeThis question was posed to me during an online interview.Question is from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

Right answer is (c) /dev

For explanation: A DEVICE file is a file which is BUILT into the kernel for each and every device of the system. All the device files are stored in /dev or in its SUBDIRECTORIES. To view the LIST of device files on your system, use the following command:

12.

du command can also be used for reporting the disk space consumed by each user.(a) True(b) FalseThis question was posed to me in class test.This question is from Administrator Specific Commands and Privileges in section Essential Shell Programming of Unix

Answer»

Correct choice is (a) True

For explanation: Most of the DYNAMIC space in the system is consumed by users, their DIRECTORIES and files. We can use the following command if we WANT to know the disk space consumed by each USER.

13.

A device file contains no data.(a) True(b) FalseI had been asked this question by my college professor while I was bunking the class.Enquiry is from Administrator Specific Commands and Privileges in portion Essential Shell Programming of Unix

Answer» RIGHT CHOICE is (a) True

To explain: A device file is a file which is built into the kernel for each and every device of the SYSTEM. Whenever we open a device, read or write to it, all these FUNCTIONS are performed using device files.
14.

Which option is used with du command for finding only the summary of disk usage by a specific directory?(a) -e(b) -f(c) -e(d) -sI got this question by my school principal while I was bunking the class.This intriguing question comes from Administrator Specific Commands and Privileges topic in portion Essential Shell Programming of Unix

Answer»

The CORRECT ANSWER is (d) -s

To elaborate: If we use the du command, then by default it displays the usage of each subdirectory of its ARGUMENT along with a summary at the end. If we WANT to display the only summary then we can use -s option with du command. For example,

15.

___ option is used with df command for displaying the total amount of disk space in the file system in terms of Kilobytes.(a) -a(b) -d(c) -t(d) -kI have been asked this question during an interview.I'm obligated to ask this question of Administrator Specific Commands and Privileges in chapter Essential Shell Programming of Unix

Answer»

Correct ANSWER is (d) -k

To explain I would say: The df (DISK free) command reports the amount of space available for each FILE system separately. -k option is used with df command for DISPLAYING the total amount of disk space in the file system in TERMS of Kilobytes.

16.

Which command is used to find out the consumption of a specific directory?(a) du(b) df(c) mem(d) dvI had been asked this question in unit test.My question is from Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer»

Right answer is (a) DU

For explanation: Sometimes, we may need to find out the consumption of a specific directory rather than an ENTIRE FILE system. For this purpose, du command is used. This command REPORTS usage by RECURSIVE examination of the directory structure.

17.

Which command is used for reporting free space on the disk?(a) fd(b) df(c) du(d) sgI have been asked this question during an online exam.This intriguing question comes from Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer» CORRECT answer is (b) df

The best I can explain: As we know that, UNIX OS is supported by various MULTIPLE file systems. The df (disk free) command reports the AMOUNT of space AVAILABLE for each file system SEPARATELY.
18.

___ option is used with df command for displaying the total amount of disk space in the file system.(a) -a(b) -d(c) -t(d) -eThe question was asked in an online quiz.The question is from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

Right option is (C) -t

Best explanation: The -t (total) option when used with df COMMAND DISPLAYS free SPACE on each file system as WELL as the total amount of disk space in the file system.

19.

Which one of the following command will shutdown and reboot the system?(a) shutdown-g2(b) shutdown-g2i6(c) shutdown-g2-g0(d) shutdown -y -g0 -i6The question was asked in an online quiz.My doubt stems from Administrator Specific Commands and Privileges topic in portion Essential Shell Programming of Unix

Answer»

The correct choice is (d) shutdown -y -g0 -i6

To explain I would SAY: -y option is used with shutdown command for shutting the system IMMEDIATELY. Similarly, we can use the shutdown command to TURN the MACHINE off in various ways. To shut down and reboot the system, use the following command:

20.

Which option is used with shutdown command to override the default waiting time?(a) -g(b) -e(c) -s(d) -iI have been asked this question by my college director while I was bunking the class.I want to ask this question from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

Right option is (a) -g

Explanation: -g option is used with SHUTDOWN COMMAND to override the default WAITING time (ONE minute). For EXAMPLE,

21.

shutdown command is used by the administrator for shutting down the system.(a) True(b) FalseThe question was asked in homework.Question is from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

The CORRECT answer is (a) True

Easiest EXPLANATION: The system administrator is also responsible for SHUTTING down the system. For this purpose, shutdown COMMAND is USED. This command performs various activities before shutting the system.

22.

userdel is used for removing users from the system.(a) True(b) FalseThe question was asked in quiz.I want to ask this question from Administrator Specific Commands and Privileges in section Essential Shell Programming of Unix

Answer»

Right answer is (a) True

Easiest EXPLANATION: We can remove users from the system USING the userdel command. To remove a PARTICULAR user from the system, use the FOLLOWING command:

23.

Which command is used by the administrator to modify some parameters of existing users?(a) userdel(b) userchange(c) useradd(d) usermodThe question was posed to me in semester exam.I need to ask this question from Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer»

Right CHOICE is (d) usermod

For EXPLANATION: usermod command is used for modifying some parameters set with useradd. For EXAMPLE, sometimes users need to change their login shell, to do so root user will invoke the FOLLOWING command:

24.

Which of the following is not a field stored in /etc/passwd?(a) username(b) password(c) UID, GID(d) encrypted passwordThis question was posed to me in an online quiz.My question comes from Administrator Specific Commands and Privileges topic in section Essential Shell Programming of Unix

Answer»

Right option is (d) encrypted PASSWORD

Best EXPLANATION: The password encryption itself is stored in /etc/shadow while there are SEVEN FIELDS in /etc/passwd namely:

•Username

•Password

•UID

•GID

•GCOS

•HOME directory

•Login SHELL

25.

All the user information is stored in _____(a) etc/passwd(b) bin/passwd(c) bin/users/passwd(d) etc/shadowI had been asked this question in an internship interview.My doubt stems from Administrator Specific Commands and Privileges in division Essential Shell Programming of Unix

Answer»

Correct option is (a) etc/passwd

Easy explanation: All the USER INFORMATION except the PASSWORD encryption is stored in /etc/passwd. The encryption itself is stored in /etc/shadow. There are seven FIELDS in /etc/passwd.

26.

For adding a new user to the system, we have to use ____ command.(a) grpadd(b) useradd(c) uadd(d) adduserI got this question in an online quiz.This intriguing question originated from Administrator Specific Commands and Privileges in section Essential Shell Programming of Unix

Answer»

The CORRECT option is (b) useradd

Explanation: The useradd COMMAND is used to add new users to the system. Before USING this command the super user should provide all the PARAMETERS related to the user in the command line itself. For example,

27.

Which of the following commands are used for the maintenance of user accounts?(a) useradd(b) usermod(c) userdel(d) useradd, usermod, userdelThe question was posed to me during an interview for a job.This question is from Administrator Specific Commands and Privileges topic in division Essential Shell Programming of Unix

Answer» RIGHT choice is (d) useradd, usermod, USERDEL

Easiest EXPLANATION: For the CREATION and maintenance of user accounts, UNIX provides to the SUPERUSER three commands —useradd, usermod and userdel.
28.

_____ command is used for creating a new group.(a) chgrp(b) chown(c) addgrp(d) groupaddThe question was asked at a job interview.I would like to ask this question from Administrator Specific Commands and Privileges in division Essential Shell Programming of Unix

Answer» CORRECT option is (d) groupadd

The BEST I can explain: groupadd COMMAND allows us to create a NEW group. For example, to create a group named OFFICEMANAG with a GID (group ID) of 398, USE the following command:
29.

The SUID for any file can be set by the administrator using ____(a) chmod(b) chmod u+s filename(c) chmod s filename(d) chmod us filenameI have been asked this question in an interview for job.This intriguing question originated from Administrator Specific Commands and Privileges in section Essential Shell Programming of Unix

Answer» CORRECT option is (b) CHMOD u+s filename

To elaborate: The SUID (SET-user-ID) lets a process have the privileges of the owner of the file during the instance of the program. The SUID for any file can be set by the ADMINISTRATOR using chmod command. For EXAMPLE,
30.

The superuser can set the sticky bit.(a) True(b) FalseI got this question during an interview.My question is taken from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

Right option is (a) True

Explanation: The sticky bit (also called the saved text bit) when applied to a REGULAR file ensures that the text image of the program with the bit set is permanently kept in the swap area. The sticky bit also comes with a security FEATURE when applied to directories. To apply the sticky bit to a DIRECTORY superuser can use 1 as the additional bit with chmod in the following manner:

31.

____ command is used by the superuser for changing root’s password.(a) pd(b) password(c) pswd(d) pwdI have been asked this question in a job interview.This key question is from Administrator Specific Commands and Privileges in chapter Essential Shell Programming of Unix

Answer»

The correct CHOICE is (c) pswd

Explanation: The pswd command prompts for EXISTING PASSWORD when this command is used by a non-privileged USER but when the same command is used by the superuser it behaves much leniently and doesn’t ask for the old password this TIME. For example,

32.

The access to the use of at and batch is restricted and controlled by ___ and ____(a) at.allow, batch.allow(b) at.allow, at.deny(c) at.allow , batch.deny(d) batch. deny, batch.allowThis question was addressed to me by my college professor while I was bunking the class.My doubt stems from Administrator Specific Commands and Privileges in division Essential Shell Programming of Unix

Answer» RIGHT choice is (b) at.allow, at.deny

The best explanation: The access to the USE of at and batch is RESTRICTED and controlled by the files at.allow and at.deny. If at.allow is PRESENT, only those users which are listed in this file can use at and batch. If this file is not present then the system checks at.deny for users who are BLOCKED from using these commands.
33.

If both at.allow and at.deny are not present, only the system administrator can access at and batch command.(a) True(b) FalseThis question was addressed to me in unit test.My question comes from Administrator Specific Commands and Privileges topic in portion Essential Shell Programming of Unix

Answer»

Right option is (a) True

Best explanation: The access to the use of at and BATCH is restricted and controlled by the files at.allow and at.deny. If at.allow is present, only those users which are listed in this FILE can use at and batch. If this file is not present then the SYSTEM checks at.deny for users who are blocked from using these commands. If NEITHER file is present, only the administrator can invoke at and batch.

34.

Which command is used by the system administrator to set the date of the system?(a) dt(b) su(c) date(d) chdtThis question was addressed to me by my college director while I was bunking the class.Query is from Administrator Specific Commands and Privileges topic in section Essential Shell Programming of Unix

Answer»

Right option is (C) DATE

For EXPLANATION I would say: date command is USED by users for displaying the system date. Same command is used by the system administrator to change/set the system date. The argument is an eight-character string of the form MMDDhhmm. For example,

35.

____ command is used for setting limits on file size.(a) limit(b) flimit(c) ulimit(d) flimThe question was asked during an interview.My doubt stems from Administrator Specific Commands and Privileges topic in portion Essential Shell Programming of Unix

Answer» CORRECT OPTION is (c) ulimit

The BEST explanation: The ulimit command is used for imposing a restriction on the maximum size of the FILE that a user is permitted to create on the system.For example,
36.

____ command allows superuser to communicate with users.(a) comm(b) cron(c) date(d) wallI got this question in an international level competition.The above asked question is from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

Right answer is (d) WALL

Explanation: The wall COMMAND can be used by the administrator to address all users SIMULTANEOUSLY. For EXAMPLE,

37.

User’s environment mode created using su – is terminated using ____(a) ctrl-v(b) ctrl-q(c) ctrl-d(d) ctrl-fI had been asked this question during a job interview.I want to ask this question from Administrator Specific Commands and Privileges in division Essential Shell Programming of Unix

Answer»

Right CHOICE is (c) ctrl-d

To EXPLAIN I would SAY: The administrator can CREATE a simulated environment USING su – for any user. This mode runs a separate sub-shell and is terminated using ctrl-d or exit.

38.

Which of the following is used for creating user’s environment?(a) su(b) su –(c) -su(d) su – –I have been asked this question in examination.My query is from Administrator Specific Commands and Privileges topic in section Essential Shell Programming of Unix

Answer»

The correct CHOICE is (b) su –

The best explanation: The administrator can create a simulated environment using su – for any USER. This COMMAND CREATES the user’s environment without taking the login-password route. For example,

39.

Which command is used for acquiring superuser status?(a) pu(b) su(c) admn(d) superI have been asked this question in a job interview.This intriguing question originated from Administrator Specific Commands and Privileges in portion Essential Shell Programming of Unix

Answer»

The correct option is (b) su

For explanation: Any user can acquire the STATUS of superuser by using the su COMMAND. The only condition that needs to be FULFILLED here is, he/she must be aware of the ROOT password. For EXAMPLE,

40.

The PATH for superuser doesn’t include current directory.(a) True(b) FalseThis question was addressed to me in semester exam.The query is from Administrator Specific Commands and Privileges topic in section Essential Shell Programming of Unix

Answer»

The correct option is (a) True

Explanation: Since we know that the SUPERUSER has to CONSTANTLY navigate through the file system, it MAY happen that he/she unintentionally EXECUTE the SCRIPTS or programs written by other users. That’s why the PATH for a superuser doesn’t include the current directory.

41.

When we log in as root user we are placed in ____(a) /bin(b) /root(c) /system(d) /adminI got this question in a national level competition.The doubt is from Administrator Specific Commands and Privileges in chapter Essential Shell Programming of Unix

Answer» CORRECT option is (b) /ROOT

Explanation: When we log in to the SYSTEM as root USER we are normally placed in the root’s HOME directory. Depending on the system we are using this directory can be / or /root.
42.

What is the prompt for system administrator?(a) $(b) %(c) #(d) &The question was posed to me in an interview for internship.Enquiry is from Administrator Specific Commands and Privileges in division Essential Shell Programming of Unix

Answer»

Correct option is (C) #

The best I can explain: The PROMPT of the root user is # whereas the prompt for NORMAL USERS or non-privileged users is % or $.

43.

The system administrator is also known as _____(a) master user(b) superuser(c) root user(d) master and super userI have been asked this question during an internship interview.My doubt is from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer»

The correct option is (d) MASTER and super user

Explanation: The system administrator has ACCESS to huge powers. This entrusted PERSON is ALSO known as the root user or superuser.

44.

What is the login name of system administrator?(a) root(b) su(c) master(d) adminThis question was posed to me during an internship interview.This is a very interesting question from Administrator Specific Commands and Privileges in chapter Essential Shell Programming of Unix

Answer»

Right choice is (a) root

Best EXPLANATION: UNIX provides a special login NAME for system administrator i.e. root. This account doesn’t need to be created SEPARATELY but comes with EVERY system. The password for the root user is set at the time of installation.

45.

____ option is used with a test for checking if the file exists and has the size greater than zero.(a) -f(b) -r(c) -e(d) -sThe question was asked during an interview.I'd like to ask this question from Shell Programming using Various Commands topic in division Essential Shell Programming of Unix

Answer»

Right answer is (d) -s

Explanation: test can ALSO be used for performing VARIOUS file tests like checking whether the file is a regular file, or is it readable, WRITABLE or executable. To CHECK whether the file exists and has the size greater than zero, we have to use -s option with test. For EXAMPLE,

46.

Which of the following functionalities is carried by the root user?(a) managing disk space(b) performing backup(c) changing attributes of a file(d) managing disk space, performing backup, changing attributes of a fileI have been asked this question in an interview for job.This question is from Administrator Specific Commands and Privileges topic in chapter Essential Shell Programming of Unix

Answer» CORRECT choice is (d) managing disk SPACE, performing backup, changing attributes of a file

The best I can explain: superuser or the root USER has access to vast powers LIKE he/she is responsible for managing the disk space, performing backups, changing attributes of files, maintaining user accounts ETC.
47.

Every time shift command is used, the leftmost variable is lost.(a) True(b) FalseI got this question in an interview for job.I need to ask this question from Shell Programming using Various Commands topic in chapter Essential Shell Programming of Unix

Answer»

Correct answer is (a) True

For explanation: shift statement is USED for shifting the positional parameters to its IMMEDIATE lower ones. Every time we use shift, the LEFTMOST variable GETS lost; s it should be saved in a variable before using shift.

48.

test statement cannot ______(a) compare two numbers(b) compare two strings(c) compare two files(d) check a file’s attributesThe question was asked in an interview for internship.I need to ask this question from Shell Programming using Various Commands in portion Essential Shell Programming of Unix

Answer»

Correct option is (c) COMPARE two files

The explanation: TEST works in THREE ways:

•compare two numbers

•compare two strings

•check a FILE’s attributes

49.

A shell script stopped running when we change its name. Why?(a) location of the file changed(b) we can’t change the name of the script(c) $0 was used in the script(d) many possible reasonsI have been asked this question in an internship interview.Query is from Shell Programming using Various Commands in division Essential Shell Programming of Unix

Answer»

The correct answer is (c) $0 was USED in the script

For EXPLANATION I WOULD say: A shell script will stop running when we change its name if we’d used the POSITIONAL PARAMETER $0 in it as $0 contains the name of the script file.

50.

Suppose x =10, then what will be the value of x$x$?(a) undefined(b) erroneous(c) 100(d) x10$I had been asked this question by my school principal while I was bunking the class.The query is from Shell Programming using Various Commands topic in portion Essential Shell Programming of Unix

Answer»

Right choice is (d) x10$

Easiest explanation: Since x CONTAINS the value 10, and $ symbol is USED with any variable for DISPLAYING its value. So $x will display 10. Hence the OUTPUT will be x10$.