收集的一些简单的UNIX/Linux面试题

1. Q. How do you find out the processes that are currently running or a particular user?
   A. ps -au Myname   (-u by effective user ID (supports names)) (a - all users)

2. Q. How do you kill a process?
   A. 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)


3. Q. What would you use to view contents of a large error log file?
   A. tail  -10 file_name   ( last 10 rows)


4.Q. How do you list contents of a directory including all of its
  subdirectories, providing full details and sorted by modification time?
   A. ls -lac
      -a all entries
      -c by time


5.Q. How do you create a symbolic link to a file (give some reasons of doing so)?
   A. ln /../file1 Link_name
Hard Link, soft Link?

6.Q. How do you check the sizes of all users锟?home directories (one command)?
   A. du -s
      df

7.Q. How do you check for processes started by user 'pat'?

   A. ps -fu pat   (-f -full_format u -user_name )

8.Q. How do you start a job on background?

   A. bg  %4  (job 4)

9. Q. How to remove directory with files?
    A. rm -rf directory_name

10. Q. How can you see all mounted drives?
    A. mount -l

11. Q. How can you find a path to the file in the system?
    A. locate file_name (locate - list files in databases that match a pattern)

12. Q. What Linux  HotKeys do you know?
    A. Ctrl-Alt-F1 Exit to command prompt
       Ctrl-Alt-F7 or F8    Takes you back to KDE desktop from command prompt
       Crtl-Alt-Backspace Restart XWindows
       Ctrl-Alt-D Show desktop

13. Q. If you would like to run two commands in sequence what operators you can use?

     A. ; or && the difference is:
if you separate commands with ; second command will be run automatically.
if you separate commands with && second command will be run only in the case
 the first was run successfully.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值