The below List of top 20 linux system administrator Interview Questions and Answers for freshers and experienced pdf free download
1 . How do you list files in a directory?
ls - list directory contents
ls -l (-l use a long listing format)
2 . How do you list all files in a directory, including the hidden files?
ls -a (-a, do not hide entries starting with .)
3 . How do you find out all processes that are currently running?
ps -f (-f does full-format listing.)
4 . How do you find out the processes that are currently running or a particular user?
ps -au Myname (-u by effective user ID (supports names)) (a - all users)
5 . How do you kill a process?
kill -9 8 (process_id 8) or kill -9 %7 (job number 7)
kill -9 -1 (Kill all processes you can kill.)
killall - kill processes by name most (useful - killall java)
6 . What would you use to view contents of the file?
less filename
cat filename
pg filename
pr filename
more filename
most useful is command: tail file_name - you can see the end of the log file.
7 . What would you use to edit contents of the file?
vi screen editor or jedit, nedit or ex line editor
8 . What would you use to view contents of a large error log file?
tail -10 file_name ( last 10 rows)
9 . How do you log in to a remote Unix box?
Using telnet server_name or ssh -l ( ssh - OpenSSH SSH client (remote login program))
10 . How do you get help on a UNIX terminal?
man command_name
info command_name (more information)
11 . How do you list contents of a directory including all of its subdirectories, providing full details and sorted by modification time?
ls -lac
-a all entries
-c by time
12 . How do you create a symbolic link to a file (give some reasons of doing so)?
ln /../file1 Link_name
Links create pointers to the actual files, without duplicating the contents of
the files. That is, a link is a way of providing another name to the same file.
There are two types of links to a file:Hard link, Symbolic (or soft) link;
13 . What is a filesystem?
Sum of all directories called file system.
A file system is the primary means of file storage in UNIX.
File systems are made of inodes and superblocks.
14 . How do you get its usage (a filesystem)?
By storing and manipulate files.
15 . How do you check the sizes of all users� home directories (one command)?
du -s df
The du command summarizes disk usage by directory. It recurses through all subdirectories and shows disk usage by each subdirectory with a final total at the end.
Q. in current directory
A. ls -ps (p- directory; s - size)
16 . How do you check for processes started by user 'pat'?
ps -fu pat (-f -full_format u -user_name )
17 . How do you start a job on background?
bg %4 (job 4)
18 . What utility would you use to replace a string '2001' for '2002' in a text file?
Grep, Kde( works on Linux and Unix)
19 . What utility would you use to cut off the first column in a text file?
awk, kde
20 . How to copy file into directory?
cp /tmp/file_name . (dot mean in the current directory)
More Linux Interview Questions and Answers: Click Here
1 . How do you list files in a directory?
ls - list directory contents
ls -l (-l use a long listing format)
2 . How do you list all files in a directory, including the hidden files?
ls -a (-a, do not hide entries starting with .)
3 . How do you find out all processes that are currently running?
ps -f (-f does full-format listing.)
4 . How do you find out the processes that are currently running or a particular user?
ps -au Myname (-u by effective user ID (supports names)) (a - all users)
5 . How do you kill a process?
kill -9 8 (process_id 8) or kill -9 %7 (job number 7)
kill -9 -1 (Kill all processes you can kill.)
killall - kill processes by name most (useful - killall java)
6 . What would you use to view contents of the file?
less filename
cat filename
pg filename
pr filename
more filename
most useful is command: tail file_name - you can see the end of the log file.
7 . What would you use to edit contents of the file?
vi screen editor or jedit, nedit or ex line editor
8 . What would you use to view contents of a large error log file?
tail -10 file_name ( last 10 rows)
9 . How do you log in to a remote Unix box?
Using telnet server_name or ssh -l ( ssh - OpenSSH SSH client (remote login program))
10 . How do you get help on a UNIX terminal?
man command_name
info command_name (more information)
11 . How do you list contents of a directory including all of its subdirectories, providing full details and sorted by modification time?
ls -lac
-a all entries
-c by time
12 . How do you create a symbolic link to a file (give some reasons of doing so)?
ln /../file1 Link_name
Links create pointers to the actual files, without duplicating the contents of
the files. That is, a link is a way of providing another name to the same file.
There are two types of links to a file:Hard link, Symbolic (or soft) link;
13 . What is a filesystem?
Sum of all directories called file system.
A file system is the primary means of file storage in UNIX.
File systems are made of inodes and superblocks.
14 . How do you get its usage (a filesystem)?
By storing and manipulate files.
15 . How do you check the sizes of all users� home directories (one command)?
du -s df
The du command summarizes disk usage by directory. It recurses through all subdirectories and shows disk usage by each subdirectory with a final total at the end.
Q. in current directory
A. ls -ps (p- directory; s - size)
16 . How do you check for processes started by user 'pat'?
ps -fu pat (-f -full_format u -user_name )
17 . How do you start a job on background?
bg %4 (job 4)
18 . What utility would you use to replace a string '2001' for '2002' in a text file?
Grep, Kde( works on Linux and Unix)
19 . What utility would you use to cut off the first column in a text file?
awk, kde
20 . How to copy file into directory?
cp /tmp/file_name . (dot mean in the current directory)
More Linux Interview Questions and Answers: Click Here
No comments:
Post a Comment