linux-02day代码

  cal: 

     一月                   二月                   三月       

日 一 二 三 四 五 六   日 一 二 三 四 五 六   日 一 二 三 四 五 六

 1  2  3  4  5  6  7             1  2  3  4             1  2  3  4

 8  9 10 11 12 13 14    5  6  7  8  9 10 11    5  6  7  8  9 10 11

15 16 17 18 19 20 21   12 13 14 15 16 17 18   12 13 14 15 16 17 18

22 23 24 25 26 27 28   19 20 21 22 23 24 25   19 20 21 22 23 24 25

29 30 31               26 27 28               26 27 28 29 30 31

 

        四月                   五月                   六月       

日 一 二 三 四 五 六   日 一 二 三 四 五 六   日 一 二 三 四 五 六

                   1       1  2  3  4  5  6                1  2  3

 2  3  4  5  6  7  8    7  8  9 10 11 12 13    4  5  6  7  8  9 10

 9 10 11 12 13 14 15   14 15 16 17 18 19 20   11 12 13 14 15 16 17

16 17 18 19 20 21 22   21 22 23 24 25 26 27   18 19 20 21 22 23 24

23 24 25 26 27 28 29   28 29 30 31            25 26 27 28 29 30

30

        七月                   八月                   九月       

日 一 二 三 四 五 六   日 一 二 三 四 五 六   日 一 二 三 四 五 六

                   1          1  2  3  4  5                   1  2

 2  3  4  5  6  7  8    6  7  8  9 10 11 12    3  4  5  6  7  8  9

 9 10 11 12 13 14 15   13 14 15 16 17 18 19   10 11 12 13 14 15 16

16 17 18 19 20 21 22   20 21 22 23 24 25 26   17 18 19 20 21 22 23

23 24 25 26 27 28 29   27 28 29 30 31         24 25 26 27 28 29 30

30 31

        十月                  十一月                 十二月      

日 一 二 三 四 五 六   日 一 二 三 四 五 六   日 一 二 三 四 五 六

 1  2  3  4  5  6  7             1  2  3  4                   1  2

 8  9 10 11 12 13 14    5  6  7  8  9 10 11    3  4  5  6  7  8  9

15 16 17 18 19 20 21   12 13 14 15 16 17 18   10 11 12 13 14 15 16

22 23 24 25 26 27 28   19 20 21 22 23 24 25   17 18 19 20 21 22 23

29 30 31               26 27 28 29 30         24 25 26 27 28 29 30

                                              31

 

[root@moxiaoxin ~]# date -s "2019-2-13"

2019年 02月 13日 星期三 00:00:00 CST

[root@moxiaoxin ~]# useradd xiaoxiao

[root@moxiaoxin ~]# ll

总用量 116

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 2 root root  4096 12月 12 2019 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ll /home/

总用量 16

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# useradd haha

[root@moxiaoxin ~]# ll /home

总用量 20

drwx------.  4 haha     haha     4096 2月  13 00:01 haha

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# useradd -g haha heihei

[root@moxiaoxin ~]# ll /home

总用量 24

drwx------.  4 haha     haha     4096 2月  13 00:01 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# passwd haha

更改用户 haha 的密码 。

新的 密码:

无效的密码: 过短

无效的密码: 过于简单

重新输入新的 密码:

抱歉,密码不匹配。

新的 密码:

无效的密码: 过短

无效的密码: 过于简单

重新输入新的 密码:

[root@moxiaoxin ~]# passwd haha

更改用户 haha 的密码 。

新的 密码:

无效的密码: 过于简单化/系统化

重新输入新的 密码:

抱歉,密码不匹配。

新的 密码:

无效的密码: 过于简单化/系统化

无效的密码: 过于简单

重新输入新的 密码:

[root@moxiaoxin ~]# passwd haha

更改用户 haha 的密码 。

新的 密码:

无效的密码: 过短

无效的密码: 过于简单

重新输入新的 密码:

passwd: 所有的身份验证令牌已经成功更新。

[root@moxiaoxin ~]# id haha

uid=502(haha) gid=502(haha) 组=502(haha)

[root@moxiaoxin ~]# cat /etc/pa

pam.d/   pango/   passwd   passwd- 

[root@moxiaoxin ~]# cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

bin:x:1:1:bin:/bin:/sbin/nologin

daemon:x:2:2:daemon:/sbin:/sbin/nologin

adm:x:3:4:adm:/var/adm:/sbin/nologin

lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin

sync:x:5:0:sync:/sbin:/bin/sync

shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

halt:x:7:0:halt:/sbin:/sbin/halt

mail:x:8:12:mail:/var/spool/mail:/sbin/nologin

uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin

operator:x:11:0:operator:/root:/sbin/nologin

games:x:12:100:games:/usr/games:/sbin/nologin

gopher:x:13:30:gopher:/var/gopher:/sbin/nologin

ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

nobody:x:99:99:Nobody:/:/sbin/nologin

dbus:x:81:81:System message bus:/:/sbin/nologin

usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin

rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin

rtkit:x:499:499:RealtimeKit:/proc:/sbin/nologin

avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/sbin/nologin

vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin

abrt:x:173:173::/etc/abrt:/sbin/nologin

rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin

nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

haldaemon:x:68:68:HAL daemon:/:/sbin/nologin

ntp:x:38:38::/etc/ntp:/sbin/nologin

apache:x:48:48:Apache:/var/www:/sbin/nologin

saslauth:x:498:76:Saslauthd user:/var/empty/saslauth:/sbin/nologin

postfix:x:89:89::/var/spool/postfix:/sbin/nologin

gdm:x:42:42::/var/lib/gdm:/sbin/nologin

pulse:x:497:496:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

tcpdump:x:72:72::/:/sbin/nologin

jinghang:x:500:500:jinghang:/home/jinghang:/bin/bash

xiaoxiao:x:501:501::/home/xiaoxiao:/bin/bash

haha:x:502:502::/home/haha:/bin/bash

heihei:x:503:502::/home/heihei:/bin/bash

[root@moxiaoxin ~]# su haha

[haha@moxiaoxin root]$ echo $PATH

/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/jinghang/bin

[haha@moxiaoxin root]$ EXIT

bash: EXIT: command not found

[haha@moxiaoxin root]$ exit

exit

[root@moxiaoxin ~]# su -haha

su:无效选项 -- h

请尝试执行"su --help"来获取更多信息。

[root@moxiaoxin ~]# su - haha

[haha@moxiaoxin ~]$ echo $PATH

/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/haha/bin

[haha@moxiaoxin ~]$ userdel haha

-bash: /usr/sbin/userdel: 权限不够

[haha@moxiaoxin ~]$ su root

密码:

[root@moxiaoxin haha]# userdel

用法:userdel [选项] 登录

 

选项:

  -f, --force                   force some actions that would fail otherwise

                                e.g. removal of user still logged in

                                or files, even if not owned by the user

  -h, --help                    显示此帮助信息并推出

  -r, --remove                  删除主目录和邮件池

  -R, --root CHROOT_DIR         chroot 到的目录

  -Z, --selinux-user            为用户删除所有的 SELinux 用户映射

 

[root@moxiaoxin haha]# ll /home

总用量 24

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin haha]# userdel -r haha

userdel: user haha is currently used by process 5518

[root@moxiaoxin haha]# ll /home

总用量 24

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin haha]# cd

[root@moxiaoxin ~]# cd opt

bash: cd: opt: 没有那个文件或目录

[root@moxiaoxin ~]# whoami

root

[root@moxiaoxin ~]# who am i

jinghang pts/1        2019-12-12 13:32 (:0.0)

[root@moxiaoxin ~]# useradd tianjia

[root@moxiaoxin ~]# passwd tianjia

更改用户 tianjia 的密码 。

新的 密码:

无效的密码: 它基于字典单词

无效的密码: 过于简单

重新输入新的 密码:

passwd: 所有的身份验证令牌已经成功更新。

[root@moxiaoxin ~]# vi /etc/sudoers

[root@moxiaoxin ~]# sudo mkdir module

[root@moxiaoxin ~]# chown haha:haha module/

[root@moxiaoxin ~]# ll

总用量 120

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 2 root root  4096 12月 12 2019 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# usermod -g root heihei

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# usermod -g haha dada

usermod:用户“dada”不存在

[root@moxiaoxin ~]# usermod -g haha test3.txt

usermod:用户“test3.txt”不存在

[root@moxiaoxin ~]# usermod -g haha xiaoxiao

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# groundadd xixi

bash: groundadd: command not found

[root@moxiaoxin ~]# groupadd xixi

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# group haha

bash: group: command not found

[root@moxiaoxin ~]# groupdel haha

groupdel:不能移除用户“xiaoxiao”的主组

[root@moxiaoxin ~]# grouddel heihei

bash: grouddel: command not found

[root@moxiaoxin ~]# groupadd zz

[root@moxiaoxin ~]# groupadd xixi

groupadd:“xixi”组已存在

[root@moxiaoxin ~]# groupdel xixi

[root@moxiaoxin ~]# groupmod zz xx

用法:groupmod [选项] 组

 

选项:

  -g, --gid GID                 将组 ID 改为 GID

  -h, --help                    显示此帮助信息并推出

  -n, --new-name NEW_GROUP      改名为 NEW_GROUP

  -o, --non-unique              允许使用重复的 GID

  -p, --password PASSWORD   将密码更改为(加密过的) PASSWORD

  -R, --root CHROOT_DIR         chroot 到的目录

 

[root@moxiaoxin ~]# grooupmod -n zz xx

bash: grooupmod: command not found

[root@moxiaoxin ~]# groupmod -n zz xx

groupmod:“xx”组不存在

[root@moxiaoxin ~]# groupadd xx

[root@moxiaoxin ~]# groupmod -n zz xx

groupmod:“zz”组已存在

[root@moxiaoxin ~]# groupmod -n yy xx

[root@moxiaoxin ~]# cat /etc/group

root:x:0:

bin:x:1:bin,daemon

daemon:x:2:bin,daemon

sys:x:3:bin,adm

adm:x:4:adm,daemon

tty:x:5:

disk:x:6:

lp:x:7:daemon

mem:x:8:

kmem:x:9:

wheel:x:10:

mail:x:12:mail,postfix

uucp:x:14:

man:x:15:

games:x:20:

gopher:x:30:

video:x:39:

dip:x:40:

ftp:x:50:

lock:x:54:

audio:x:63:

nobody:x:99:

users:x:100:

dbus:x:81:

usbmuxd:x:113:

rpc:x:32:

utmp:x:22:

utempter:x:35:

rtkit:x:499:

avahi-autoipd:x:170:

desktop_admin_r:x:498:

desktop_user_r:x:497:

floppy:x:19:

vcsa:x:69:

abrt:x:173:

cdrom:x:11:

tape:x:33:

dialout:x:18:

wbpriv:x:88:

rpcuser:x:29:

nfsnobody:x:65534:

haldaemon:x:68:haldaemon

ntp:x:38:

apache:x:48:

saslauth:x:76:

postdrop:x:90:

postfix:x:89:

gdm:x:42:

pulse:x:496:

pulse-access:x:495:

fuse:x:494:

sshd:x:74:

slocate:x:21:

stapusr:x:156:

stapsys:x:157:

stapdev:x:158:

tcpdump:x:72:

jinghang:x:500:

xiaoxiao:x:501:

haha:x:502:

tianjia:x:504:

zz:x:506:

yy:x:507:

[root@moxiaoxin ~]# 11

bash: 11: command not found

[root@moxiaoxin ~]# cd

[root@moxiaoxin ~]# cd

[root@moxiaoxin ~]# 11

bash: 11: command not found

[root@moxiaoxin ~]# su jinghang

[jinghang@moxiaoxin root]$ 11

bash: 11: command not found

[jinghang@moxiaoxin root]$ ll

ls: 无法打开目录.: 权限不够

[jinghang@moxiaoxin root]$ su root

密码:

[root@moxiaoxin ~]# ll

总用量 120

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 2 root root  4096 12月 12 2019 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# ll

总用量 0

[root@moxiaoxin cc]# mkdir c.txt

[root@moxiaoxin cc]# cd c.txt

[root@moxiaoxin c.txt]# vim c.txt

[root@moxiaoxin c.txt]# cat c.txt

bbvghhb

fghjj

ggmj

ghjk

[root@moxiaoxin c.txt]# pwd

/root/cc/c.txt

[root@moxiaoxin c.txt]# ln /root/cc/c.txt ./ff

ln: "/root/cc/c.txt": 不允许将硬链接指向目录

[root@moxiaoxin c.txt]# cd

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# pwd

/root/cc

[root@moxiaoxin cc]# ln /root/cc ./ff

ln: "/root/cc": 不允许将硬链接指向目录

[root@moxiaoxin cc]# cd

[root@moxiaoxin ~]# ll

总用量 120

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 3 root root  4096 2月  13 01:32 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# mkdir f.txt

[root@moxiaoxin ~]# mkdir g.txt

[root@moxiaoxin ~]# ll

总用量 128

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 3 root root  4096 2月  13 01:32 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

drwxr-xr-x. 2 root root  4096 2月  13 01:36 f.txt

drwxr-xr-x. 2 root root  4096 2月  13 01:36 g.txt

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ln f.txt ./g.txt

ln: "f.txt": 不允许将硬链接指向目录

[root@moxiaoxin ~]# ls

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# usermod -g root heihei

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# usermod -g haha dada

usermod:用户“dada”不存在

[root@moxiaoxin ~]# usermod -g haha test3.txt

usermod:用户“test3.txt”不存在

[root@moxiaoxin ~]# usermod -g haha xiaoxiao

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# groundadd xixi

bash: groundadd: command not found

[root@moxiaoxin ~]# groupadd xixi

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 12月 12 2019 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# group haha

bash: group: command not found

[root@moxiaoxin ~]# groupdel haha

groupdel:不能移除用户“xiaoxiao”的主组

[root@moxiaoxin ~]# grouddel heihei

bash: grouddel: command not found

[root@moxiaoxin ~]# groupadd zz

[root@moxiaoxin ~]# groupadd xixi

groupadd:“xixi”组已存在

[root@moxiaoxin ~]# groupdel xixi

[root@moxiaoxin ~]# groupmod zz xx

用法:groupmod [选项] 组

 

选项:

  -g, --gid GID                 将组 ID 改为 GID

  -h, --help                    显示此帮助信息并推出

  -n, --new-name NEW_GROUP      改名为 NEW_GROUP

  -o, --non-unique              允许使用重复的 GID

  -p, --password PASSWORD   将密码更改为(加密过的) PASSWORD

  -R, --root CHROOT_DIR         chroot 到的目录

 

[root@moxiaoxin ~]# grooupmod -n zz xx

bash: grooupmod: command not found

[root@moxiaoxin ~]# groupmod -n zz xx

groupmod:“xx”组不存在

[root@moxiaoxin ~]# groupadd xx

[root@moxiaoxin ~]# groupmod -n zz xx

groupmod:“zz”组已存在

[root@moxiaoxin ~]# groupmod -n yy xx

[root@moxiaoxin ~]# cat /etc/group

root:x:0:

bin:x:1:bin,daemon

daemon:x:2:bin,daemon

sys:x:3:bin,adm

adm:x:4:adm,daemon

tty:x:5:

disk:x:6:

lp:x:7:daemon

mem:x:8:

kmem:x:9:

wheel:x:10:

mail:x:12:mail,postfix

uucp:x:14:

man:x:15:

games:x:20:

gopher:x:30:

video:x:39:

dip:x:40:

ftp:x:50:

lock:x:54:

audio:x:63:

nobody:x:99:

users:x:100:

dbus:x:81:

usbmuxd:x:113:

rpc:x:32:

utmp:x:22:

utempter:x:35:

rtkit:x:499:

avahi-autoipd:x:170:

desktop_admin_r:x:498:

desktop_user_r:x:497:

floppy:x:19:

vcsa:x:69:

abrt:x:173:

cdrom:x:11:

tape:x:33:

dialout:x:18:

wbpriv:x:88:

rpcuser:x:29:

nfsnobody:x:65534:

haldaemon:x:68:haldaemon

ntp:x:38:

apache:x:48:

saslauth:x:76:

postdrop:x:90:

postfix:x:89:

gdm:x:42:

pulse:x:496:

pulse-access:x:495:

fuse:x:494:

sshd:x:74:

slocate:x:21:

stapusr:x:156:

stapsys:x:157:

stapdev:x:158:

tcpdump:x:72:

jinghang:x:500:

xiaoxiao:x:501:

haha:x:502:

tianjia:x:504:

zz:x:506:

yy:x:507:

[root@moxiaoxin ~]# 11

bash: 11: command not found

[root@moxiaoxin ~]# cd

[root@moxiaoxin ~]# cd

[root@moxiaoxin ~]# 11

bash: 11: command not found

[root@moxiaoxin ~]# su jinghang

[jinghang@moxiaoxin root]$ 11

bash: 11: command not found

[jinghang@moxiaoxin root]$ ll

ls: 无法打开目录.: 权限不够

[jinghang@moxiaoxin root]$ su root

密码:

[root@moxiaoxin ~]# ll

总用量 120

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 2 root root  4096 12月 12 2019 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# ll

总用量 0

[root@moxiaoxin cc]# mkdir c.txt

[root@moxiaoxin cc]# cd c.txt

[root@moxiaoxin c.txt]# vim c.txt

[root@moxiaoxin c.txt]# cat c.txt

bbvghhb

fghjj

ggmj

ghjk

[root@moxiaoxin c.txt]# pwd

/root/cc/c.txt

[root@moxiaoxin c.txt]# ln /root/cc/c.txt ./ff

ln: "/root/cc/c.txt": 不允许将硬链接指向目录

[root@moxiaoxin c.txt]# cd

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# pwd

/root/cc

[root@moxiaoxin cc]# ln /root/cc ./ff

ln: "/root/cc": 不允许将硬链接指向目录

[root@moxiaoxin cc]# cd

[root@moxiaoxin ~]# ll

总用量 120

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 3 root root  4096 2月  13 01:32 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# mkdir f.txt

[root@moxiaoxin ~]# mkdir g.txt

[root@moxiaoxin ~]# ll

总用量 128

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxr-xr-x. 3 root root  4096 2月  13 01:32 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

drwxr-xr-x. 2 root root  4096 2月  13 01:36 f.txt

drwxr-xr-x. 2 root root  4096 2月  13 01:36 g.txt

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ln f.txt ./g.txt

ln: "f.txt": 不允许将硬链接指向目录

[root@moxiaoxin ~]# ls -al cc

总用量 12

drwxr-xr-x.  3 root root 4096 2月  13 01:32 .

dr-xr-x---. 33 root root 4096 2月  13 01:36 ..

drwxr-xr-x.  2 root root 4096 2月  13 01:32 c.txt

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# ll

总用量 4

drwxr-xr-x. 2 root root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# cd c.txt

[root@moxiaoxin c.txt]# pwd

/root/cc/c.txt

[root@moxiaoxin c.txt]# ln /root/cc/c.txt ./g.txt

ln: "/root/cc/c.txt": 不允许将硬链接指向目录

[root@moxiaoxin c.txt]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 2月  13 01:28 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin c.txt]# cd cc

bash: cd: cc: 没有那个文件或目录

[root@moxiaoxin c.txt]# cd

[root@moxiaoxin ~]# cc

bash: cc: command not found

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# cd c.txt

[root@moxiaoxin c.txt]# pwd

/root/cc/c.txt

[root@moxiaoxin c.txt]# cp /root/cc/c.txt ./

cp: 略过目录"/root/cc/c.txt"

[root@moxiaoxin c.txt]# chmod g+x c.txt

[root@moxiaoxin c.txt]# chmod u+x c.txt

[root@moxiaoxin c.txt]# chmod u-x,o+x c.txt

[root@moxiaoxin c.txt]# chmod 777 c.txt

[root@moxiaoxin c.txt]# chmod -R 777 cc/

chmod: 无法访问"cc/": 没有那个文件或目录

[root@moxiaoxin c.txt]# cd

[root@moxiaoxin ~]# cd

[root@moxiaoxin ~]# chmod -R 777 cc/

[root@moxiaoxin ~]# chmod 777 c.txt

chmod: 无法访问"c.txt": 没有那个文件或目录

[root@moxiaoxin ~]# ll /home

总用量 28

drwx------.  4 haha     haha     4096 2月  13 00:42 haha

drwx------.  4 heihei   haha     4096 2月  13 00:02 heihei

drwx------. 27 jinghang jinghang 4096 2月  13 01:28 jinghang

drwxr-xr-x.  3 root     root     4096 12月 12 2019 test3.txt

drwxr-xr-x.  2 root     root     4096 12月 12 2019 test4.txt

drwx------.  4 tianjia  tianjia  4096 2月  13 00:47 tianjia

drwx------.  4 xiaoxiao xiaoxiao 4096 2月  13 00:00 xiaoxiao

[root@moxiaoxin ~]# cd jinghang

bash: cd: jinghang: 没有那个文件或目录

[root@moxiaoxin ~]# su jinghang

[jinghang@moxiaoxin root]$ ll

ls: 无法打开目录.: 权限不够

[jinghang@moxiaoxin root]$ su root

密码:

[root@moxiaoxin ~]# chown jinghang test3.txt

chown: 无法访问"test3.txt": 没有那个文件或目录

[root@moxiaoxin ~]# chown jinghang tianjia

chown: 无法访问"tianjia": 没有那个文件或目录

[root@moxiaoxin ~]# chown jinghang c.txt

chown: 无法访问"c.txt": 没有那个文件或目录

[root@moxiaoxin ~]# ls -al

总用量 268

dr-xr-x---. 33 root root  4096 2月  13 01:36 .

dr-xr-xr-x. 25 root root  4096 12月 12 2019 ..

drwxr-xr-x.  2 root root  4096 12月 11 2019 .abrt

-rw-------.  1 root root  1392 12月 11 2019 anaconda-ks.cfg

-rw-------.  1 root root   415 12月 11 2019 .bash_history

-rw-r--r--.  1 root root    18 5月  20 2009 .bash_logout

-rw-r--r--.  1 root root   176 5月  20 2009 .bash_profile

-rw-r--r--.  1 root root   176 9月  23 2004 .bashrc

drwxr-xr-x.  3 root root  4096 12月 12 2019 bb

drwxr-xr-x.  3 root root  4096 12月 11 2019 .cache

drwxrwxrwx.  3 root root  4096 2月  13 01:32 cc

drwxr-xr-x.  6 root root  4096 12月 12 2019 .config

-rw-r--r--.  1 root root   100 9月  23 2004 .cshrc

drwx------.  3 root root  4096 12月 11 2019 .dbus

drwxr-xr-x.  3 root root  4096 12月 12 2019 dd

lrwxrwxrwx.  1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-------.  1 root root    16 12月 11 2019 .esd_auth

drwxr-xr-x.  2 root root  4096 2月  13 01:36 f.txt

drwx------.  4 root root  4096 12月 12 2019 .gconf

drwx------.  5 root root  4096 12月 11 2019 .gnome2

drwxr-xr-x.  3 root root  4096 12月 11 2019 .gnote

drwx------.  2 root root  4096 12月 12 2019 .gnupg

-rw-r--r--.  1 root root   160 12月 12 2019 .gtk-bookmarks

drwxr-xr-x.  2 root root  4096 2月  13 01:36 g.txt

drwx------.  2 root root  4096 12月 11 2019 .gvfs

-rw-------.  1 root root   620 12月 12 2019 .ICEauthority

drwxr-xr-x.  2 root root  4096 12月 12 2019 .icons

-rw-r--r--.  1 root root   781 12月 12 2019 .imsettings.log

-rw-r--r--.  1 root root 45986 12月 11 2019 install.log

-rw-r--r--.  1 root root 11504 12月 11 2019 install.log.syslog

-rw-------.  1 root root    63 12月 12 2019 .lesshst

drwxr-xr-x.  3 root root  4096 12月 11 2019 .local

drwxr-xr-x.  2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x.  2 root root  4096 12月 11 2019 .nautilus

drwx------.  2 root root  4096 12月 11 2019 .pulse

-rw-------.  1 root root   256 12月 11 2019 .pulse-cookie

drwx------.  2 root root  4096 12月 11 2019 .ssh

-rw-r--r--.  1 root root   129 12月  4 2004 .tcshrc

drwxr-xr-x.  3 root root  4096 12月 12 2019 test

drwxr-xr-x.  2 root root  4096 12月 12 2019 .themes

drwx------.  4 root root  4096 12月 12 2019 .thumbnails

-rw-------.  1 root root  1377 2月  13 01:32 .viminfo

-rw-------.  1 root root    54 12月 12 2019 .xauthcUtK3N

-rw-------.  1 root root    54 12月 11 2019 .xauthHVixbP

-rw-------.  1 root root    54 12月 12 2019 .xauthkWeYZa

-rw-------.  1 root root    54 12月 12 2019 .xauthxRGoOC

drwxr-xr-x.  2 root root  4096 12月 11 2019 公共的

drwxr-xr-x.  2 root root  4096 12月 11 2019 模板

drwxr-xr-x.  2 root root  4096 12月 11 2019 视频

drwxr-xr-x.  2 root root  4096 12月 11 2019 图片

drwxr-xr-x.  2 root root  4096 12月 11 2019 文档

drwxr-xr-x.  2 root root  4096 12月 11 2019 下载

drwxr-xr-x.  2 root root  4096 12月 11 2019 音乐

drwxr-xr-x.  2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ll

总用量 128

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxrwxrwx. 3 root root  4096 2月  13 01:32 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

drwxr-xr-x. 2 root root  4096 2月  13 01:36 f.txt

drwxr-xr-x. 2 root root  4096 2月  13 01:36 g.txt

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# pwd

/root/cc

[root@moxiaoxin cc]# cp /root/cc ./

cp: 略过目录"/root/cc"

[root@moxiaoxin cc]# cp /root/cc/c.txt ./

cp: 略过目录"/root/cc/c.txt"

[root@moxiaoxin cc]# chmod u+x c.txt

[root@moxiaoxin cc]# ll

总用量 4

drwxrwxrwx. 2 root root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chown jinghang c.txt

[root@moxiaoxin cc]# ls -al

总用量 12

drwxrwxrwx.  3 root     root 4096 2月  13 01:32 .

dr-xr-x---. 33 root     root 4096 2月  13 01:36 ..

drwxrwxrwx.  2 jinghang root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# ll

总用量 4

drwxrwxrwx. 2 jinghang root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chown -R jinghang:jinghang cc/

chown: 无法访问"cc/": 没有那个文件或目录

[root@moxiaoxin cc]# chowwn -R jinghang:jinghang c.txt

bash: chowwn: command not found

[root@moxiaoxin cc]# chown -R jinghang:jinghang c.txt/

[root@moxiaoxin cc]# ll

总用量 4

drwxrwxrwx. 2 jinghang jinghang 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chqrp root c.txt

bash: chqrp: command not found

[root@moxiaoxin cc]# chqrp root c.txt

bash: chqrp: command not found

[root@moxiaoxin cc]# ls -al

总用量 12

drwxrwxrwx.  3 root     root     4096 2月  13 01:32 .

dr-xr-x---. 33 root     root     4096 2月  13 01:36 ..

drwxrwxrwx.  2 jinghang jinghang 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chqrp root test6.txt

bash: chqrp: command not found

[root@moxiaoxin cc]# find cc/ -name "*.txt"

find: “cc/”: 没有那个文件或目录

[root@moxiaoxin cc]# mkdir d.txt

[root@moxiaoxin cc]# ll

总用量 8

drwxrwxrwx. 2 jinghang jinghang 4096 2月  13 01:32 c.txt

drwxr-xr-x. 2 root     root     4096 2月  13 02:27 d.txt

[root@moxiaoxin cc]# mkdir e.txt

[root@moxiaoxin cc]# ll

总用量 12

drwxrwxrwx. 2 jinghang jinghang 4096 2月  13 01:32 c.txt

drwxr-xr-x. 2 root     root     4096 2月  13 02:27 d.txt

drwxr-xr-x. 2 root     root     4096 2月  13 02:27 e.txt

[root@moxiaoxin cc]# cd

[root@moxiaoxin ~]# find cc/ -name "*.txt"

cc/e.txt

cc/d.txt

cc/c.txt

cc/c.txt/c.txt

[root@moxiaoxin ~]# find cc/ -user jinghang

cc/c.txt

cc/c.txt/c.txt

[root@moxiaoxin ~]# find /home -size +20480

/home/jinghang/桌面/VMwareTools-10.0.5-3228253.tar.gz

[root@moxiaoxin ~]# ls | grep -n c.txt

ot@moxiaoxin ~]# su jinghang

[jinghang@moxiaoxin root]$ ll

ls: 无法打开目录.: 权限不够

[jinghang@moxiaoxin root]$ su root

密码:

[root@moxiaoxin ~]# chown jinghang test3.txt

chown: 无法访问"test3.txt": 没有那个文件或目录

[root@moxiaoxin ~]# chown jinghang tianjia

chown: 无法访问"tianjia": 没有那个文件或目录

[root@moxiaoxin ~]# chown jinghang c.txt

chown: 无法访问"c.txt": 没有那个文件或目录

[root@moxiaoxin ~]# ls -al

总用量 268

dr-xr-x---. 33 root root  4096 2月  13 01:36 .

dr-xr-xr-x. 25 root root  4096 12月 12 2019 ..

drwxr-xr-x.  2 root root  4096 12月 11 2019 .abrt

-rw-------.  1 root root  1392 12月 11 2019 anaconda-ks.cfg

-rw-------.  1 root root   415 12月 11 2019 .bash_history

-rw-r--r--.  1 root root    18 5月  20 2009 .bash_logout

-rw-r--r--.  1 root root   176 5月  20 2009 .bash_profile

-rw-r--r--.  1 root root   176 9月  23 2004 .bashrc

drwxr-xr-x.  3 root root  4096 12月 12 2019 bb

drwxr-xr-x.  3 root root  4096 12月 11 2019 .cache

drwxrwxrwx.  3 root root  4096 2月  13 01:32 cc

drwxr-xr-x.  6 root root  4096 12月 12 2019 .config

-rw-r--r--.  1 root root   100 9月  23 2004 .cshrc

drwx------.  3 root root  4096 12月 11 2019 .dbus

drwxr-xr-x.  3 root root  4096 12月 12 2019 dd

lrwxrwxrwx.  1 root root    16 12月 12 2019 ee -> /root/test/test1

-rw-------.  1 root root    16 12月 11 2019 .esd_auth

drwxr-xr-x.  2 root root  4096 2月  13 01:36 f.txt

drwx------.  4 root root  4096 12月 12 2019 .gconf

drwx------.  5 root root  4096 12月 11 2019 .gnome2

drwxr-xr-x.  3 root root  4096 12月 11 2019 .gnote

drwx------.  2 root root  4096 12月 12 2019 .gnupg

-rw-r--r--.  1 root root   160 12月 12 2019 .gtk-bookmarks

drwxr-xr-x.  2 root root  4096 2月  13 01:36 g.txt

drwx------.  2 root root  4096 12月 11 2019 .gvfs

-rw-------.  1 root root   620 12月 12 2019 .ICEauthority

drwxr-xr-x.  2 root root  4096 12月 12 2019 .icons

-rw-r--r--.  1 root root   781 12月 12 2019 .imsettings.log

-rw-r--r--.  1 root root 45986 12月 11 2019 install.log

-rw-r--r--.  1 root root 11504 12月 11 2019 install.log.syslog

-rw-------.  1 root root    63 12月 12 2019 .lesshst

drwxr-xr-x.  3 root root  4096 12月 11 2019 .local

drwxr-xr-x.  2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x.  2 root root  4096 12月 11 2019 .nautilus

drwx------.  2 root root  4096 12月 11 2019 .pulse

-rw-------.  1 root root   256 12月 11 2019 .pulse-cookie

drwx------.  2 root root  4096 12月 11 2019 .ssh

-rw-r--r--.  1 root root   129 12月  4 2004 .tcshrc

drwxr-xr-x.  3 root root  4096 12月 12 2019 test

drwxr-xr-x.  2 root root  4096 12月 12 2019 .themes

drwx------.  4 root root  4096 12月 12 2019 .thumbnails

-rw-------.  1 root root  1377 2月  13 01:32 .viminfo

-rw-------.  1 root root    54 12月 12 2019 .xauthcUtK3N

-rw-------.  1 root root    54 12月 11 2019 .xauthHVixbP

-rw-------.  1 root root    54 12月 12 2019 .xauthkWeYZa

-rw-------.  1 root root    54 12月 12 2019 .xauthxRGoOC

drwxr-xr-x.  2 root root  4096 12月 11 2019 公共的

drwxr-xr-x.  2 root root  4096 12月 11 2019 模板

drwxr-xr-x.  2 root root  4096 12月 11 2019 视频

drwxr-xr-x.  2 root root  4096 12月 11 2019 图片

drwxr-xr-x.  2 root root  4096 12月 11 2019 文档

drwxr-xr-x.  2 root root  4096 12月 11 2019 下载

drwxr-xr-x.  2 root root  4096 12月 11 2019 音乐

drwxr-xr-x.  2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# ll

总用量 128

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxrwxrwx. 3 root root  4096 2月  13 01:32 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

drwxr-xr-x. 2 root root  4096 2月  13 01:36 f.txt

drwxr-xr-x. 2 root root  4096 2月  13 01:36 g.txt

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# cd cc

[root@moxiaoxin cc]# pwd

/root/cc

[root@moxiaoxin cc]# cp /root/cc ./

cp: 略过目录"/root/cc"

[root@moxiaoxin cc]# cp /root/cc/c.txt ./

cp: 略过目录"/root/cc/c.txt"

[root@moxiaoxin cc]# chmod u+x c.txt

[root@moxiaoxin cc]# ll

总用量 4

drwxrwxrwx. 2 root root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chown jinghang c.txt

[root@moxiaoxin cc]# ls -al

总用量 12

drwxrwxrwx.  3 root     root 4096 2月  13 01:32 .

dr-xr-x---. 33 root     root 4096 2月  13 01:36 ..

drwxrwxrwx.  2 jinghang root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# ll

总用量 4

drwxrwxrwx. 2 jinghang root 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chown -R jinghang:jinghang cc/

chown: 无法访问"cc/": 没有那个文件或目录

[root@moxiaoxin cc]# chowwn -R jinghang:jinghang c.txt

bash: chowwn: command not found

[root@moxiaoxin cc]# chown -R jinghang:jinghang c.txt/

[root@moxiaoxin cc]# ll

总用量 4

drwxrwxrwx. 2 jinghang jinghang 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chqrp root c.txt

bash: chqrp: command not found

[root@moxiaoxin cc]# chqrp root c.txt

bash: chqrp: command not found

[root@moxiaoxin cc]# ls -al

总用量 12

drwxrwxrwx.  3 root     root     4096 2月  13 01:32 .

dr-xr-x---. 33 root     root     4096 2月  13 01:36 ..

drwxrwxrwx.  2 jinghang jinghang 4096 2月  13 01:32 c.txt

[root@moxiaoxin cc]# chqrp root test6.txt

bash: chqrp: command not found

[root@moxiaoxin cc]# find cc/ -name "*.txt"

find: “cc/”: 没有那个文件或目录

[root@moxiaoxin cc]# mkdir d.txt

[root@moxiaoxin cc]# ll

总用量 8

drwxrwxrwx. 2 jinghang jinghang 4096 2月  13 01:32 c.txt

drwxr-xr-x. 2 root     root     4096 2月  13 02:27 d.txt

[root@moxiaoxin cc]# mkdir e.txt

[root@moxiaoxin cc]# ll

总用量 12

drwxrwxrwx. 2 jinghang jinghang 4096 2月  13 01:32 c.txt

drwxr-xr-x. 2 root     root     4096 2月  13 02:27 d.txt

drwxr-xr-x. 2 root     root     4096 2月  13 02:27 e.txt

[root@moxiaoxin cc]# cd

[root@moxiaoxin ~]# find cc/ -name "*.txt"

cc/e.txt

cc/d.txt

cc/c.txt

cc/c.txt/c.txt

[root@moxiaoxin ~]# find cc/ -user jinghang

cc/c.txt

cc/c.txt/c.txt

[root@moxiaoxin ~]# find /home -size +20480

/home/jinghang/桌面/VMwareTools-10.0.5-3228253.tar.gz

[root@moxiaoxin ~]# ls | grep -n c.txt

[root@moxiaoxin ~]# ls test.java

ls: 无法访问test.java: 没有那个文件或目录

[root@moxiaoxin ~]# ll

总用量 128

-rw-------. 1 root root  1392 12月 11 2019 anaconda-ks.cfg

drwxr-xr-x. 3 root root  4096 12月 12 2019 bb

drwxrwxrwx. 5 root root  4096 2月  13 02:27 cc

drwxr-xr-x. 3 root root  4096 12月 12 2019 dd

lrwxrwxrwx. 1 root root    16 12月 12 2019 ee -> /root/test/test1

drwxr-xr-x. 2 root root  4096 2月  13 01:36 f.txt

drwxr-xr-x. 2 root root  4096 2月  13 01:36 g.txt

-rw-r--r--. 1 root root 45986 12月 11 2019 install.log

-rw-r--r--. 1 root root 11504 12月 11 2019 install.log.syslog

drwxr-xr-x. 2 haha haha  4096 2月  13 01:06 module

drwxr-xr-x. 3 root root  4096 12月 12 2019 test

drwxr-xr-x. 2 root root  4096 12月 11 2019 公共的

drwxr-xr-x. 2 root root  4096 12月 11 2019 模板

drwxr-xr-x. 2 root root  4096 12月 11 2019 视频

drwxr-xr-x. 2 root root  4096 12月 11 2019 图片

drwxr-xr-x. 2 root root  4096 12月 11 2019 文档

drwxr-xr-x. 2 root root  4096 12月 11 2019 下载

drwxr-xr-x. 2 root root  4096 12月 11 2019 音乐

drwxr-xr-x. 2 root root  4096 12月 11 2019 桌面

[root@moxiaoxin ~]# cd bb

[root@moxiaoxin bb]# ll

总用量 4

-rw-r--r--. 1 root root    0 12月 12 2019 cc.txt

drwxr-xr-x. 4 root root 4096 12月 12 2019 test6.txt

[root@moxiaoxin bb]# gzip cc.txt

[root@moxiaoxin bb]# ll

总用量 8

-rw-r--r--. 1 root root   27 12月 12 2019 cc.txt.gz

drwxr-xr-x. 4 root root 4096 12月 12 2019 test6.txt

[root@moxiaoxin bb]# gunzip cc.txt.gz

[root@moxiaoxin bb]# ll

总用量 4

-rw-r--r--. 1 root root    0 12月 12 2019 cc.txt

drwxr-xr-x. 4 root root 4096 12月 12 2019 test6.txt

[root@moxiaoxin bb]# zip test.zip cc.txt test6.txt

  adding: cc.txt (stored 0%)

  adding: test6.txt/ (stored 0%)

[root@moxiaoxin bb]# ll

总用量 8

-rw-r--r--. 1 root root    0 12月 12 2019 cc.txt

drwxr-xr-x. 4 root root 4096 12月 12 2019 test6.txt

-rw-r--r--. 1 root root  310 2月  13 02:43 test.zip

[root@moxiaoxin bb]# unzip test.zip -d test1/

Archive:  test.zip

 extracting: test1/cc.txt           

   creating: test1/test6.txt/

[root@moxiaoxin bb]# cd test1

[root@moxiaoxin test1]# ll

总用量 4

-rw-r--r--. 1 root root    0 12月 12 2019 cc.txt

drwxr-xr-x. 2 root root 4096 12月 12 2019 test6.txt

[root@moxiaoxin test1]# zip test1.zip -r test1

       zip warning: name not matched: test1

 

zip error: Nothing to do! (try: zip -r test1.zip . -i test1)

[root@moxiaoxin test1]# ll

总用量 4

-rw-r--r--. 1 root root    0 12月 12 2019 cc.txt

drwxr-xr-x. 2 root root 4096 12月 12 2019 test6.txt

[root@moxiaoxin test1]# tar -zcvf test.tar.gz cc.txt test6.txt

cc.txt

test6.txt/

[root@moxiaoxin test1]# cd

[root@moxiaoxin ~]# cd test1

bash: cd: test1: 没有那个文件或目录

[root@moxiaoxin ~]#

[root@moxiaoxin ~]#

 

 

发布了16 篇原创文章 · 获赞 10 · 访问量 302

猜你喜欢

转载自blog.csdn.net/XIAOMO__/article/details/103517019