2017年7月19日晚作业

1.在root目录下实现

文件按照时间排序最新的在前面并且把结果输出到名为test.txt的文件中

[root@server ~]# ll -t > /test.txt
[root@server ~]# cat /test.txt
总用量 148
drwxr-xr-x. 2 root root 4096 7月 18 06:09 dir01
-rw-r--r--. 1 root root 191 7月 18 06:07 a
-rw-r--r--. 1 root root 0 7月 18 06:07 aa
-rw-r--r--. 1 root root 0 7月 18 06:07 bb
-rw-r--r--. 1 root root 8 7月 18 03:28 b
-rw-r--r--. 1 root root 33 7月 18 02:33 test.log
-rw-r--r--. 1 root root 0 7月 18 02:28 wc
-rw-r--r--. 1 root root 5 7月 18 02:19 jj.log
-rw-r--r--. 1 root root 22 7月 18 02:03 zxc.log
-rw-r--r--. 1 root root 0 7月 18 01:32 aaa
-rw-r--r--. 1 root root 0 7月 18 01:32 ab
-rw-r--r--. 1 root root 0 7月 18 01:32 abb
-rw-r--r--. 1 root root 0 7月 18 01:32 ba
-rw-r--r--. 1 root root 0 7月 18 01:32 bba
-rw-r--r--. 1 root root 0 7月 18 01:29 aab
-rw-r--r--. 1 root root 0 7月 18 01:29 bbb
-rw-r--r--. 1 root root 17 7月 17 21:57 a.log
-rw-r--r--. 1 root root 191 7月 17 21:50 abc.log
-rw-r--r--. 1 root root 11287 7月 17 21:21
-rw-r--r--. 1 root root 12 7月 17 20:02 tse.log
drwxr-xr-x. 2 root root 4096 7月 17 11:52 公共的
drwxr-xr-x. 2 root root 4096 7月 17 11:52 模板
drwxr-xr-x. 2 root root 4096 7月 17 11:52 视频
drwxr-xr-x. 2 root root 4096 7月 17 11:52 图片
drwxr-xr-x. 2 root root 4096 7月 17 11:52 文档
drwxr-xr-x. 2 root root 4096 7月 17 11:52 下载
drwxr-xr-x. 2 root root 4096 7月 17 11:52 音乐
drwxr-xr-x. 2 root root 4096 7月 17 11:52 桌面
-rw-------. 1 root root 1701 7月 17 11:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 45814 7月 17 11:37 install.log
-rw-r--r--. 1 root root 10033 7月 17 11:34 install.log.syslog

2.在root目录下

创建一个test.txt文件,并创建新用户abc。将test.txt文件的用户改为abc,将权限改为-rwxr--r--

[root@server ~]# touch test.txt
[root@server ~]# useradd abc
[root@server ~]# chown abc test.txt
[root@server ~]# ll test.txt
-rw-r--r--. 1 abc root 0 7月 18 12:06 test.txt
[root@server ~]# chmod 744 test.txt
[root@server ~]# ll test.txt
-rwxr--r--. 1 abc root 0 7月 18 12:06 test.txt

3.在root下写出ls -l并过滤出test.txt这一个文件的命令,并解释列出的每一个属性的意义

[root@server ~]# ls -l | grep test.tst
[root@server ~]# ll test.txt
-rwxr--r--. 1        abc      root          0            7月 18 12:06   test.txt

[权限] [连接数][拥有者][用户组][文件容量]     [修改时间]     [文件名]

posted @ 2017-07-20 08:46  言岚  阅读(164)  评论(3编辑  收藏  举报