日期:2014-05-16  浏览次数:20872 次

linux英文笔试题
[color=olive]1. Q. How do you list files in a directory?
A: ls
ls
语法:ls   [选项] 路径名称
    -a 显示所有档案及目录 (ls内定将档案名或目录名称开头为"."的视为隐藏档,不会列出)
  -l 除档案名称外,亦将档案型态,权限,拥有者,档案大小等资讯详细列出
  -r 将档案以相反次序显示(原定依英文字母次序)
  -t 将档案依建立时间之先后次序列出
  -A 同 -a ,但不列出 "." (目前目录) 及 ".." (父目录)
  -F 在列出的档案名称后加一符号;例如可执行档则加 "*", 目录则加 "/"

  -R 若目录下有档案,则以下之档案亦皆依序列出

2. Q. How do you list all files in a directory, including the hidden files?

A: ls-a

3. Q. How do you find out all processes that are currently running?

A: ps -f


4. Q. How do you find out the processes that are currently running or a particular user?

A: ps -au username

-A 列出所有的行程
-w 显示加宽可以显示较多的资讯
-au 显示较详细的资讯
-aux 显示所有包含其他使用者的行程
-U<用户识别码>  列出属于该用户的进程的状况,也可使用用户名称来指定。
U<用户名称>  列出属于该用户的进程的状况。


5. Q. How do you kill a process?

A: kill pid


6. Q. What would you use to view contents of the file?

A: 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. Q. What would you use to edit contents of the file?

A: vi file

8. Q. What would you use to view contents of a large error log file?

A: tail  -10 file_name   ( last 10 rows)

9. Q. How do you log in to a remote Unix box?

A: Using telnet server_name or ssh -l ( ssh - OpenSSH SSH client (remote login program))

10.Q. How do you get help on a UNIX terminal?

A: man command_name
info command_name (more information)


11.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


12.Q. How do you create a symbolic link to a file (give some reasons of doing so)?

A:  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.Q. What is a filesystem?

A: 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.Q. How do you get its usage (a filesystem)?

A:By storing and manipulate files.

15.Q. How do you check the sizes of all users? home directories (one command)?

A: du -s


df

16.Q. How do you check for processes started by user 'pat'?
A: ps -fu pat   (-f -full_format u -user_name )

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

A: bg %4


18 Q. What utility would you use to replace a string '2001' for '2002' in a text file?

A: grep kde


19. Q. What utility would you use to cut off the first column in a text file?

A: awk kde


20. Q. How to copy file into directory?

A: cp dir

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


22. Q. What is the difference between internal and external commands?
A: Internal commands are stored in the same level as the operating system while external commands are stored on the hard disk among the other utility programs.

23. Q. List the three main parts of an operating system command:

A: The three main parts are the command, options and arguments.

24  Q. What is the difference between an argument and an