完成如下操作:1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;
2. 统计1.txt的行数;
3. 查看1.txt文件的大小;
4. 给1.txt分别做一个硬链接以及软链接;
5. 查看1.txt的atime, ctime, mtime分别是什么?
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
2. 统计1.txt的行数;
3. 查看1.txt文件的大小;
4. 给1.txt分别做一个硬链接以及软链接;
5. 查看1.txt的atime, ctime, mtime分别是什么?
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
0
完成如下操作:1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;
vim 1.txt2. 统计1.txt的行数;3. 查看1.txt文件的大小;4. 给1.txt分别做一个硬链接以及软链接;5. 查看1.txt的atime, ctime, mtime分别是什么?6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
vim 1.txt
- fffffffffffffffffffffffffffffffffffff
- afwwtgwer
- wr
- w
- r
- wrwerwetgewragf
- faf
- wefrweeeeeeeeeeeeeeeeeeeeeee
- #lllllllllllllllll
- t12234567890-1234567890-
- v
- u
- t
- u
- t
- u
- t
- u
- v
- t
- v
- u
- t
- t
- u
- t
- u
- u
- t
- x
- x
- w
- t
- x
- t
- v
- t
- v
- u
- t
- v
- u
- t
- v
- u
- t
- u
- t
- u
- q
- r
- s
- s
- r
- r
- q
- @e
- wc -l 1.txt
- du -sh 1.txt #占用的块
- ls -lh 1.txt #实际大小
- [root@Discuz ~]# ln 1.txt 2.txt
- [root@Discuz ~]# ln -s 1.txt 3.txt
- [root@Discuz ~]# ls -l
- 总用量 32
- -rw-r--r-- 2 root root 246 1月 6 10:03 1.txt
- -rw-r--r-- 2 root root 246 1月 6 10:03 2.txt #硬链接
- lrwxrwxrwx 1 root root 5 1月 6 10:06 3.txt -> 1.txt #软连接
- [root@Discuz ~]# stat 1.txt
- File: "1.txt"
- Size: 246 Blocks: 8 IO Block: 4096 普通文件
- Device: 807h/2055d Inode: 135457 Links: 2
- Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
- Access: 2014-01-06 10:04:11.323630823 +0800 #atime
- Modify: 2014-01-06 10:03:56.635630933 +0800 #mtime
- Change: 2014-01-06 10:06:41.633630692 +0800 #ctime
- [root@Discuz ~]# chmod 700 1.txt
- [root@Discuz ~]# ls -l
- 总用量 32
- -rwx------ 2 root root 246 1月 6 10:03 1.txt
0
完成如下操作:1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;
2. 统计1.txt的行数;
3. 查看1.txt文件的大小;
4. 给1.txt分别做一个硬链接以及软链接;
5. 查看1.txt的atime, ctime, mtime分别是什么?
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
答:1)、vim 1.txt
2)、wc -l 1.txt
3)、du -sh 1.txt
l4)、n 1.txt 目标文件;ln -s 1.txt 目标文件
5)、stat 1.txt 或者ls -lc filename 列出文件的 ctime (最后更改时间)
ls -lu filename 列出文件的 atime(最后存取时间)
ls -l filename 列出文件的 mtime (最后修改时间)
6)、chmod 700 1.txt
2. 统计1.txt的行数;
3. 查看1.txt文件的大小;
4. 给1.txt分别做一个硬链接以及软链接;
5. 查看1.txt的atime, ctime, mtime分别是什么?
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
答:1)、vim 1.txt
2)、wc -l 1.txt
3)、du -sh 1.txt
l4)、n 1.txt 目标文件;ln -s 1.txt 目标文件
5)、stat 1.txt 或者ls -lc filename 列出文件的 ctime (最后更改时间)
ls -lu filename 列出文件的 atime(最后存取时间)
ls -l filename 列出文件的 mtime (最后修改时间)
6)、chmod 700 1.txt
0
1.vim 1.txt
2.wc -l 1.txt
3.du -h 1.txt
4.ln 1.txt 2.txt; ln -s 1.txt 3.txt
5.stat 1.txt
6.chmod 640 1.txt
2.wc -l 1.txt
3.du -h 1.txt
4.ln 1.txt 2.txt; ln -s 1.txt 3.txt
5.stat 1.txt
6.chmod 640 1.txt
0
1、vim 1.txt
2、wc -l 1.txt
3、du -sh 1.txt
4、软连接: ln -s 1.txt 1-sock.txt
硬链接: ln 1.txt 1_ln.txt
5、stat 1.txt
6、chmod 600 1.txt
2、wc -l 1.txt
3、du -sh 1.txt
4、软连接: ln -s 1.txt 1-sock.txt
硬链接: ln 1.txt 1_ln.txt
5、stat 1.txt
6、chmod 600 1.txt
0
1.touch 1.txt
2.wc -l 1.txt
3.du -h 1.txt
4.ln 1.txt /home/chenchu/1.txt, ln -s 1.txt /home/chenchu/1s.txt
5.stat 1.txt
6.dhmod 600 1.txt
2.wc -l 1.txt
3.du -h 1.txt
4.ln 1.txt /home/chenchu/1.txt, ln -s 1.txt /home/chenchu/1s.txt
5.stat 1.txt
6.dhmod 600 1.txt
0
1.touch 1.txt,vim 1.txt,编辑完成 wq 退出
2.wc -l
3.ls -lh 1.txt
4.软连接:ln -s 1.txt softlink,硬链接:ln 1.txt hardlink
5.stat 1.txt
6.chmod 600 1.txt
2.wc -l
3.ls -lh 1.txt
4.软连接:ln -s 1.txt softlink,硬链接:ln 1.txt hardlink
5.stat 1.txt
6.chmod 600 1.txt
0
1、touch 1.txt
2、wc -l 1.txt
3、ll -h 1.txt
4、ln 1.txt hard.log ln -s 1.txt soft.log
5、stat 1.txt
6、chmod u+rw,o-rwx 1.txt
2、wc -l 1.txt
3、ll -h 1.txt
4、ln 1.txt hard.log ln -s 1.txt soft.log
5、stat 1.txt
6、chmod u+rw,o-rwx 1.txt
0
cat 1.txt | wc -l
ls -l 1.txt ;du -h 1.txt
ln 1.txt 1.txt.hard
ln -s 1.txt 1.txt.soft
stat 1.txt
chmod 600 1.txt
ls -l 1.txt ;du -h 1.txt
ln 1.txt 1.txt.hard
ln -s 1.txt 1.txt.soft
stat 1.txt
chmod 600 1.txt
0
1 touch 1.txt vim 1.txt :wql
2 wc -l 1.txt
3 ln 1.txt aaa_hard ln -s 1.txt bbb_soft
4 stat 1.txt
5 chmod u+rw chmod o-rwr
2 wc -l 1.txt
3 ln 1.txt aaa_hard ln -s 1.txt bbb_soft
4 stat 1.txt
5 chmod u+rw chmod o-rwr
0
1.vim 1.txt
2.wc -l 1.txt
3.du -sh 1.txt
4.ln 1.txt 1_hard.txt
ln -s 1.txt 1_soft.txt
5.stat 1.txt
access
modify
change
6.chmod 600 1.txt
李超
2.wc -l 1.txt
3.du -sh 1.txt
4.ln 1.txt 1_hard.txt
ln -s 1.txt 1_soft.txt
5.stat 1.txt
access
modify
change
6.chmod 600 1.txt
李超
0
1 touch 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# cat 1.txt
Hello ! aaaaaaaabbbbbbbcccccqwe
2222222
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 423112313 >> 1.txt
[root@localhost ~]# cat -n 1.txt
1 Hello ! aaaaaaaabbbbbbbcccccqwe
2 2222222
3 2222222
4 2222222
5 2222222
6 2222222
7 2222222
8 2222222
9 423112313
2 cat -n 1.txt wc -l
3 wc -c 1.txt ls -l 1.txt
4 硬链接 ln 1.txt 2.txt
软连接 ln -s 1.txt 2.txt
5 atime acess time 访问时间
ctime change time 修改inode时间
mtime modified time 修改内容时间
6 chmod 600 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# cat 1.txt
Hello ! aaaaaaaabbbbbbbcccccqwe
2222222
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 2222222 >> 1.txt
[root@localhost ~]# echo 423112313 >> 1.txt
[root@localhost ~]# cat -n 1.txt
1 Hello ! aaaaaaaabbbbbbbcccccqwe
2 2222222
3 2222222
4 2222222
5 2222222
6 2222222
7 2222222
8 2222222
9 423112313
2 cat -n 1.txt wc -l
3 wc -c 1.txt ls -l 1.txt
4 硬链接 ln 1.txt 2.txt
软连接 ln -s 1.txt 2.txt
5 atime acess time 访问时间
ctime change time 修改inode时间
mtime modified time 修改内容时间
6 chmod 600 1.txt
0
完成如下操作:
1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;
vim 1.txt
按i插入信息
按esc退出编辑模式,按shift+: 输入wq 保存退出。
2. 统计1.txt的行数;
wc -l 1.txt
3. 查看1.txt文件的大小;
du -sh 1.txt
4. 给1.txt分别做一个硬链接以及软链接;
ln 1.txt /home/
ln -s 1.txt /home/11.txt
5. 查看1.txt的atime, ctime, mtime分别是什么?
stat 1.txt
atime: 访问时间
ctime:文件内容修改时间
mtime:权限属性修改时间
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
[root@test01 ~]# chmod 640 1.txt
完成如下操作:
1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;
vim 1.txt
按i插入信息
按esc退出编辑模式,按shift+: 输入wq 保存退出。
2. 统计1.txt的行数;
wc -l 1.txt
3. 查看1.txt文件的大小;
du -sh 1.txt
4. 给1.txt分别做一个硬链接以及软链接;
ln 1.txt /home/
ln -s 1.txt /home/11.txt
5. 查看1.txt的atime, ctime, mtime分别是什么?
stat 1.txt
atime: 访问时间
ctime:文件内容修改时间
mtime:权限属性修改时间
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
[root@test01 ~]# chmod 640 1.txt
0
touch 1.txt 创建vim i>dusahdbcsuabuasbckjdnckalsnckd :wq保存 vim 1.txt set nu 查看行数 df -h查看大小 ln 1.txt 2.txt 硬链接 ln -s 1.txt 2.txt 软连接 data 1.txt查看时间 chmod 6001.txt
编辑回复