2013-01-06练习题

回复 收藏
完成如下操作:1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;
2. 统计1.txt的行数;
3. 查看1.txt文件的大小;
4. 给1.txt分别做一个硬链接以及软链接;
5. 查看1.txt的atime, ctime, mtime分别是什么?
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
2014-01-06 10:02 举报
已邀请:
0

chekir

赞同来自:

完成如下操作:1. 新建一个文本文档1.txt, 随便写入一些内容(尽量多一些),保存退出;

vim 1.txt
  1. fffffffffffffffffffffffffffffffffffff
  2. afwwtgwer
  3. wr
  4. w
  5. r
  6. wrwerwetgewragf


  7. faf

  8. wefrweeeeeeeeeeeeeeeeeeeeeee
  9. #lllllllllllllllll
  10. t12234567890-1234567890-
  11. v
  12. u
  13. t
  14. u
  15. t
  16. u
  17. t
  18. u
  19. v
  20. t
  21. v
  22. u
  23. t
  24. t
  25. u
  26. t
  27. u
  28. u
  29. t
  30. x
  31. x
  32. w
  33. t
  34. x
  35. t
  36. v
  37. t
  38. v
  39. u
  40. t
  41. v
  42. u
  43. t
  44. v
  45. u
  46. t
  47. u
  48. t
  49. u
  50. q
  51. r
  52. s
  53. s
  54. r
  55. r
  56. q
  57. @e
2. 统计1.txt的行数;
  1. wc -l 1.txt
3. 查看1.txt文件的大小;
  1. du -sh 1.txt    #占用的块
  2. ls -lh 1.txt  #实际大小
4. 给1.txt分别做一个硬链接以及软链接;
  1. [root@Discuz ~]# ln 1.txt 2.txt
  2. [root@Discuz ~]# ln -s 1.txt 3.txt
  3. [root@Discuz ~]# ls -l
  4. 总用量 32
  5. -rw-r--r--  2 root root   246 1月   6 10:03 1.txt
  6. -rw-r--r--  2 root root   246 1月   6 10:03 2.txt                  #硬链接
  7. lrwxrwxrwx  1 root root     5 1月   6 10:06 3.txt -> 1.txt      #软连接
5. 查看1.txt的atime, ctime, mtime分别是什么?
  1. [root@Discuz ~]# stat 1.txt
  2.   File: "1.txt"
  3.   Size: 246               Blocks: 8          IO Block: 4096   普通文件
  4. Device: 807h/2055d        Inode: 135457      Links: 2
  5. Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
  6. Access: 2014-01-06 10:04:11.323630823 +0800         #atime
  7. Modify: 2014-01-06 10:03:56.635630933 +0800         #mtime
  8. Change: 2014-01-06 10:06:41.633630692 +0800        #ctime
6. 修改1.txt的权限,属主可读可写,其他用户不可读,不可写,不可执行。
  1. [root@Discuz ~]# chmod 700 1.txt
  2. [root@Discuz ~]# ls -l
  3. 总用量 32
  4. -rwx------  2 root root   246 1月   6 10:03 1.txt
0

SHMILY

赞同来自:

完成如下操作: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
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
0

larson

赞同来自:

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
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
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
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
0

good

赞同来自:

cat 1.txt |wc -l
du -sh 1.txt
ln 1.txt xxx
ln -s 1.txt yyy
stat 1.txt
chmod 600 1.txt
0

good

赞同来自:

cat 1.txt |wc -l
du -sh 1.txt
ln 1.txt xxx
ln -s 1.txt yyy
stat 1.txt
chmod 600 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

0

shitukeji

赞同来自:

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
0

nihao426181

赞同来自:

学习下
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

李超
0

nihao426181

赞同来自:

^^^^^^^^^^^^^^^^^^
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
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
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
0

黄佳栋

赞同来自:

2.wc -l 1.txt   3. ls -h 1.txt  4. ln 1.txt  1.txt_h    ln -s 1.txt 1.txt_s   5.chmod 600 1.txt
0

wangdi244

赞同来自:

1.touch 1.txt;echo""
2.wc -l 1.txt
3.du -h 1.txt
4.ln 1.txt 1;ln -s 1.txt 1.ln
5.stat 1.txt
6.chmod 600 1.txt
0

苏苏苏苏

赞同来自:

cat -n 1.txt     ls -lh 1.txt  ln -s 1.txt 1.txt  ln 1.txt 1.txt  stat 1.txt chmod 600 1.txt

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: