- 查看根目录下有几个文件 [root@localhost /]# ls |wc -w 20
- 根目录下创建TEMP文件夹和TEMP下创建PHONE文件夹 [root@localhost /]# mkdir -p /temp/phone [root@localhost /]# ls 1 boot etc lib media opt root sbin sys tmp var bin dev home lib64 mnt proc run srv temp usr [root@localhost /]# cd temp/ [root@localhost temp]# ls phone
- 将PHONE复制到根目录下 [root@localhost temp]# cp -r phone/ /
- 在PHONE下创建 password文件并在password文件中写入若干个字母 [root@localhost /]# cd phone/ [root@localhost phone]# vim password
- 删除temp中phone文件夹 [root@localhost phone]# cd /temp/ [root@localhost temp]# rm -rf phone/
- 查找password文件的位置 [root@localhost /]# find -name "password" find: ‘./run/user/1000/gvfs’: 权限不够 ./etc/openldap/certs/password ./usr/share/doc/dialog-1.2/samples/password ./phone/password
- 查找password文件的最后一行内容 [root@localhost /]# tail -1 /phone/password sdsdsdfss
- 统计temp目录的大小 [root@localhost /]# du -h /temp/ 0 /temp/
- 统计temp下建立ts1,ts2,ts3 [root@localhost /]# cd /temp/ [root@localhost temp]# mkdir ts1 ts2 ts3
- 复制password到ts3 [root@localhost temp]# cp -r /phone/password ts3/
- 使用tar命令将temp文件夹进行不归档压缩,压缩文件名字为test.tar [root@localhost /]# tar -cvf test.tar /temp
- 查看teat.tar文件的大小,并记录到size.txt文件中 [root@localhost /]# du -sh test.tar >size.txt
- 使用gzip压缩test.tar [root@localhost /]# gzip test.tar
- 查看test.tar.gz的大小 [root@localhost /]# du -sh test.tar.gz 4.0K test.tar.gz
- 删除test.tar.gz文件 [root@localhost /]# rm test.tar.gz rm:是否删除普通文件 "test.tar.gz"?y
- 使用tar命令归档压缩temp文件夹为test.tar.gz tar -zcvf test.tar.gz /temp
- 解压test.tar.gz到test文件夹 cd test tar -zxvf /test.tar.gz
- 将/etc下的文件详细信息拷贝到/test/etc.txt ls -l >/test/etc.txt
- 使用vim打开etc.txt在末行加入etc三个字然后不保存退出 vim /test/etc.txt
软盘驱动器 /dev/fd(0-1) 当前CD ROM/DVD ROM /dev/cdrom IDE硬盘 /dev/hdXY 第一个磁盘阵列设备 /dev/st0