Professional Documents
Culture Documents
UNIX Admin L1
UNIX Admin L1
1. How would you replace string .abc with xyz in a file?
Sed abc, xyz. File Sed /s/abc/xyz/g.file
Sed /r/abc/xyz.file Sed /s/abc/xyz
2. What will be the default permission of new directory if umask is 022?
drwxr-xr-x (755)
3. outcome of command :test ‘wc -l file’ –ge 100
True if filename has 100 and more words True if filename has 100 and more lines
True if filename has 100 lines Size of file is greater than
4. delete directory that contain files and subdirectory
rm –r directory
5. change group owner of a file to dba
Chown dba: user filename Chgrp dba filename
Grmod dba filename Chown dba filename
6. check total disk usage by current directory
df –h
7. what describe value I in STAT field indicate in ps command
Running stopped
sleeping for 20 seconds or less sleeping more than 20 seconds
8. Command to print file by prefixing each line by no of occurrence
Uniq –c file Uniq –u file
Cut file| wc Cut file| uniq -0
9. In vi:command mode I what happens if you key in character “k”
H(left) j(down)
k(up) l(right)
10. How to list hidden files
Ls –a
11. Where temp files stored
/tmp
12. Command to display current working directory
pwd
13. Print last 5 lines of file
Tail -5 file less 5filename
More files| tail -5 Cat files | print 5
14. How to set ftp to transfer a text file
Set text
bin ascii
15. How to bring background process to foreground
Fg
16. Command to find users currently logged in and what they are doing
W who
task top
17. Which is not unix shell
Brone korn
c u
18. Command line user interface in Unix
bash shell
19. In vi:command mode I what happens if you key in character “j”
H(left) j(down)
k(up) l(right)
20.Not possible output of LS command
links/FS
UNIX admin L1-set 2
17. filename starts with (/)
Absolute path
18. when files are recoverd afetr failure or problem.They are placed under
bakup lost+found
tmp swap
19. What is '$colour' echo output
colour
20.Command to print a file by prefix exact line by number of occurrence
cat file|wc cat file|uniq -0
uniq -c file uniq -u file
UNIX admin L1-set 3
20.T in STAT command in PS command
Stop
21. Copy a file from current directory to new directory and delete file from current directory
mv file ./new dir
22. Minimum permission require to execute shell/script
Read
23. Shell script execute permission denied
Chmod……………..filename
24.I want to list files under /var that contains string XYZ
I want to list files f-xarg grep –l XYZ{} Cd /var; egrep –RXYZ;
Find /var –type f –xarg grep –l XYZ Find /var –type f –exec grep –l XYZ{}
25. How will you replace abc with xyz in file
Sed s/abc/xyz/g filename Sed r/abc/xyz filename
Sed abc, xyz file name Sed s/abc/xyz
26. Delete 1 to 10 lines using sed
sed '1, 10d' filename
27. list directory recursively
ls -R ls -t
ls -r ls -D
28.total disk usage
du -s du -r
du -t df –k
29.No of lines in a file
Wc –l
30.Admistrative, config file stored
/etc /conf
/config /adm
31. how to check your current shell you logged onto
env |egrep $SHELL echo $SHELL
A or B /etc/staus/
32. how to list the files with sizes you logged onto
ls -s ls -a
ls -b ls -F
33. What will be default permission of newly created directory if the umask value is 022
drwxr-xr-x -rwxr-xr-x
----w---w- drwxr--r—
34.Which are the hidden files
. ..
Profile a and b
35. which is not a valid shell
Ksh csh
Tcsh chsh
36 which is not Unix shell
bourne korn
cshell ushell
37. What does value S in stat field indicate in PS command?
Running stopped
Sleeping for 20 seconds or less Sleeping more than 20 seconds
38.What does value T in stat field indicate in PS command?
Running stopped
Sleeping for 20 seconds or less Sleeping more than 20 seconds