01,分屏显示计算机中所有进程。(显示所有进程命令ps -aux,分屏显示命令more)
# ps -aux | more
02,新建目录/newdir。复制/etc/passwd文件为/newdir/pass1,复制/etc/group 文件为/newdir/group。
# mkdir /newdir
# cp /etc/passwd /newdir/pass1
# cp /etc/group /newdir/group
03,使用通配符删除/new下的所有文件。
# rm -f /new/*
04,将/etc目录中所有以“pa”开头的文件输出到文件/newdir/etcpa中。
# cat /etc/pa* >> /newdir/etcpa
05,将现在计算机中的所有进程的信息输出到文件/newdir/etcpa末尾。
# ps -aux >> /newdir/etcpa
06,切换到用户root的主目录中。
# cd /root
07,切换到根目录。
# cd /
08,切换到home目录。
# cd /home
09,切换到上一级目录。
# cd ..
10,查看现在的工作目录。
# pwd
11,查看当前工作目录中有哪些文件。
# ls
12,查看/root目录中有哪些文件。
# ls /root
13,以长列表的方式列出/root目录中的所有文件。
# ls -l /root
14,复制/home目录到/newdir中。
# cp /home /newdir/
15,新建/newdir/other目录。移动/newdir/所有文件到该目录中。移动/newdir/home目录到该目录中。
# mkdir -p /newdir/other
16,将/newdir/other/pass1重命名为passwd。
# mv /newdir/other/pass1 /newdir/other/passwd
linux退出文件命令17,新建目录/q/w/e/r/t。
# mkdir -p /q/w/e/r/t
18,新建目录/a/s/d/f/g,使其权限为:root用户可以读写执行,root组其他用户可以读写,其他多有用户只可以读。
# mkdir -m 764 -p /a/s/d/f/g
19,使用不超过两条命令删除目录/q/w/e/r/t中的下三级目录。
# rm -rf /q/w/e
20,删除目录/q中的w目录。
# rm -rf /q/w
21,删除目录/newdir。
# rm -rf /newdir
22,在/etc/目录中查文件passwd。
# find /etc -name passwd
23,查看/etc/passwd文件的内容。
# cat /etc/passwd
24,分屏查看/etc/passwd文件的内容。
# more /etc/passwd
# less /etc/passwd
25,以长格式使用三种排序方式显示目录/bin的内容:
(1)以文件大小由大到小的次序排序;
# ls -Sl /bin
(2)以文件大小由小到大的次序排序;
# ls -Srl /bin
(3)以文件的最后修改时间的先后次序排序
# ls -tl /bin
26,vi练习:
1)、使用vi打开一个新文档,并输入以下两行内容:
Linux is an operating system that was initially created as a hobby by a young student, Linus Torvalds, at the University of Helsinki in Finland. Linus had an interest in Minix, a small UNIX system, and decided to develop a system that exceeded the Minix standards.
The kernel, at the heart of all Linux systems, is developed and released under the GNU General Public License and its source code is freely available to everyone. It is this kernel that forms the base around which a Linux operating system is developed.
# vi new
....
2)、发出命令显示行号。
# :set nu
3)、保存到文件AboutLinux,不退出。
# :w Aboutlinux
4)、删除一句“It is this kernel that forms the base around which a Linux operating system is developed.”。
5)、查单词“Finland”。
/Finland
6)、把第一行的“Finland”后的内容变成独立的一行。现在共有三行内容。
7)、复制第二行的内容到文档的最后。
# y p
8)、删除第三行的内容。
# dd
9)、恢复被删除的一行内容。
# u
10)、查所有的“Minix”并全部改为“MINIX”。
11)、不保存并退出vi。
# :q
12)、使用vi再次打开文件AboutLinux。应该显示原来的两行内容。
# vi AboutLinux
13)、在第二行后插入一行“He began his work in 1991 when he released version 0.02 and worked steadily until 1994 when version 1.0 of the Linux Kernel was released.”。
14)、在文档的最后增加一行“There are now literally hundreds of companies and organizations and an equal number of individuals that have released their own versions of operating systems based on
the Linux kernel.”。#
15)、保存并退出vi。
# :wq
16)、设置文件AboutLinux的权限为400(“r--------”)。
# chmod 400 AboutLinux
17)、使用vi再次打开文件AboutLinux,并在文档最后增加一行“More information on the kernel can be found at our sister site, LinuxHQ and at the official Linux Kernel Archives.”。并保存文档后退出。
# :wq

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。