Unix Self Testing Knowledge

List of unix questions to self test your own knowledge:

The permission bits of a file noname. can be set to _rws_ _x_ _x by the comma nd.

A. chmod 711 noname
B. chmod go -rw noname
C. chmod 2711 noname
D. None of the above

Explanation :

We can use the command chmod 711 noname, followed by chmod u+s noname (use ls -1 noname and check). Else use the single command chmod 4711 noname. What is this "s" anyway? Only the super user has the permission to change /etc/ passwd file.  But any user can update it through the passwd (bin/passwd) command. If you type ls-l /bin/passwd you can see the user execution bit set to s instead of x).
It is because of this "s".  A user can access /etc/passwd through the passwd command, for which he is not otherwise entitled to.
 

/bin/passwd has the user execution permission set to 's' because

A. This facility assigns to the user, permissions of the program owner. temporarily
B. It should allow users who don't have write permission to /etc/passwd to write to it
C. /etc/passwd is write protected
D. All of these
 

If one doesn't want anyone else to read or write to a file named datfile, except through a program in a file filex , then he may use

A. chmod u+s filex ; chmod go_rw datfile
B. chmod 4711 filex ; chmod go_rw datfile
C. chmod 4711 datfile ; chmod go_rw filex

Ans D
 

Shell script is preferable to other forms of programming because it

A. Makes programming task easier
B. Enhances portability
C. Occupies less space
D. All of these
 

Files that store data in the same format as used in program are called

A. binary files
B. Source file
C. Text file
D. Core
 

To allow only one user to work with a particular file at a particular time, one has to use

A. Semaphore
B. Critical region
C. Locking
D. Dedicated mode
 

The differences between malloc( ) and calloc() are:

A. Malloc is used for dynamic allocation of memory, while cal:1?c can't be used for that purpose.
B. Malloc needs only one argument. while cal loc needs two.
C. unlike malloc, calloc allocates memory and initializes it to 0.
D. Both (b) and (c)
 

The main reasons for the success of pipes are

A. The availability of many filter programs
B. UNIX treats devices as files
C. It provides a 2-way communication channel
D. Both (a) and (b)
 

Which of the following are not filter programs?

A. date
B. sort
C. cat
D. grep

Ans A
 

Redirection in pipes can be achieved by using

A. >
B. >>
C. tee
D. lpr

Ans C

Unix Tips

See Also
Short Self-Test Questions on Unix

Have a Unix Problem
Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.