三.面试题(III Interview questions)

1.id 命令:

查看当前用户的UID,GID等

2.建立软链接(快捷方式),以及硬链接的命令。

软链接:ln -s slink source硬链接:ln link source

3.目录创建用什么命令?创建文件用什么命令?复制文件用什么命令?答案:创建目录:mkdir创建文件:典型的如 touch,vi 也可以创建文件。其实只要向一个不存在的文件输出,都会创建文件复制文件:cp 

4.文件权限修改用什么命令?格式是怎么样的?

$ chmod u+x file     给 file 的属主增加执行权限$ chmod 751 file     给 file 的属主分配读、写、执行(7)的权限,给 file 的所在组分配读、执行(5)的权限,给其他用户分配执行(1)的权限$ chmod u=rwx,g=rx,o=x file   上例的另一种形式$ chmod =r file       为所有用户分配读权限$ chmod 444 file     同上例$ chmod a-wx,a+r file  同上例$ chmod -R u+r directory   递归地给 directory 目录下所有文件和子目录的属主分配读的权限

5.查看文件内容有哪些命令可以使用?

vi 文件名    #编辑方式查看,可修改cat 文件名   #显示全部文件内容more 文件名   #分页显示文件内容less 文件名   #与 more 相似,更好的是可以往前翻页tail 文件名   #仅查看尾部,还可以指定行数head 文件名     #仅查看头部,还可以指定行数

6.终端是哪个文件夹下的哪个文件?

终端: /dev/tty

7.mv命令作用:移动文件,改名

8.删除文件用哪个命令?如果需要连目录及目录下文件一块删除呢?删除空文件夹用什么命令?答案:rm   rm -r   rmdir

9.grep 命令有什么用?如何忽略大小写?如何查找不含该串的行?答案:是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来。(查找显示行)grep [stringSTRING] filename   grep [^string] filename

10.

使用什么命令查看磁盘使用空间?空闲空间呢?

答案:

df -hl

————————

1. ID command:

View the uid, GID, etc. of the current user

2. Create < strong > soft link < / strong > (shortcut) and < strong > hard link < / strong >.

软链接:ln -s slink source硬链接:ln link source

3. What commands are used for directory creation? What commands are used to create files? What command is used to copy files? Answer: create directory: MKDIR create file: typically, you can also create files, such as < strong > touch, VI < / strong >. In fact, as long as you output to a nonexistent file, you will create a file and copy the file: CP

4. < strong > what commands are used to modify file permissions? What is the format

$CHMOD U + X file adds execution permission to the owner of file $Chmod 751 file assigns read, write and execute (7) permissions to the owner of file, assigns read and execute (5) permissions to the group of file, and assigns execute (1) permissions to other users $Chmod u = RWX, G = Rx, O = x file another form of the above example $Chmod = R file , assign read permissions to all users $Chmod 444 file is the same as the above example $Chmod a-wx, a + R file is the same as the above example $Chmod – r u + R directory, recursively assign read permissions to the owners of all files and subdirectories under the directory directory

5. What commands can be used to view file contents?

VI file name # edit view, can modify cat file name # display all file contents more file name # paginate display file contents less file name # is similar to more, the better thing is that you can turn the page forward, tail file name # only view the tail, and you can also specify the number of lines head file name # only view the header, and you can also specify the number of lines

6. Which file is in which folder of the terminal?

Terminal: / dev / TTY

7. The MV command is used to move files and rename them

8. Which command is used to delete files? What if you need to delete the directory and the files under it? What command is used to delete an empty folder? Answer: RM – R rmdir

9. What is the use of the grep command? How to ignore case? How do I find a row without this string? Answer: it is a powerful text search tool. It can use regular expressions to search text and print matching lines. (find display line) grep [stringstring] filename grep [^ string] filename

ten

What commands are used to view disk space? What about free space?

answer:

df -hl