第三天作业
1、
[root@redhat ~]# mkdir test
[root@redhat ~]# cd test
[root@redhat test]# touch text1.txt
[root@redhat ~]# touch test/text2.txt
[root@redhat ~]# cd test
[root@redhat test]# ls
text1.txt text2.txt
[root@redhat test]# vim text1.txt
[root@redhat ~]# mkdir test2
[root@redhat test]# cp text1.txt text2.txt /root/test2
[root@redhat test2]# cp text1.txt /root/test2/text111.txt
[root@redhat test2]# ls
text111.txt text1.txt text2.txt
[root@redhat test]# rm -rf text1.txt
[root@redhat ~]# rm -rf test
2、
[root@redhat ~]# echo "This is my first time to use pipe" | tee pipe_data.txt
This is my first time to use pipe
[root@redhat ~]# more pipe_data.txt
This is my first time to use pipe
3、
[root@redhat ~]# cat -n /etc/passwd
1 root:x:0:0:root:/root:/bin/bash
2 bin:x:1:1:bin:/bin:/sbin/nologin
3 daemon:x:2:2:daemon:/sbin:/sbin/nologin
4 adm:x:3:4:adm:/var/adm:/sbin/nologin
5 lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
6 sync:x:5:0:sync:/sbin:/bin/sync
7 shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
8 halt:x:7:0:halt:/sbin:/sbin/halt
9 mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
10 operator:x:11:0:operator:/root:/sbin/nologin
11 games:x:12:100:games:/usr/games:/sbin/nologin
12 ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
13 nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
14 dbus:x:81:81:System message bus:/:/sbin/nologin
15 systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
16 systemd-resolve:x:193:193:systemd Resolver:/:/sbin/nologin
17 tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
18 polkitd:x:998:996:User for polkitd:/:/sbin/nologin
19 geoclue:x:997:995:User for geoclue:/var/lib/geoclue:/sbin/nologin
20 rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin
21 pulse:x:171:171:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin
22 libstoragemgmt:x:996:992:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
23 qemu:x:107:107:qemu user:/:/sbin/nologin
24 usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin
25 unbound:x:995:990:Unbound DNS resolver:/etc/unbound:/sbin/nologin
26 rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
27 gluster:x:994:989:GlusterFS daemons:/run/gluster:/sbin/nologin
28 chrony:x:993:988::/var/lib/chrony:/sbin/nologin
29 setroubleshoot:x:992:986::/var/lib/setroubleshoot:/sbin/nologin
30 pipewire:x:991:985:PipeWire System Daemon:/var/run/pipewire:/sbin/nologin
31 saslauth:x:990:76:Saslauthd user:/run/saslauthd:/sbin/nologin
32 dnsmasq:x:984:984:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/sbin/nologin
33 radvd:x:75:75:radvd user:/:/sbin/nologin
34 clevis:x:983:982:Clevis Decryption Framework unprivileged user:/var/cache/clevis:/sbin/nologin
35 cockpit-ws:x:982:980:User for cockpit web service:/nonexisting:/sbin/nologin
36 cockpit-wsinstance:x:981:979:User for cockpit-ws instances:/nonexisting:/sbin/nologin
37 sssd:x:980:978:User for sssd:/:/sbin/nologin
38 flatpak:x:979:977:User for flatpak system helper:/:/sbin/nologin
39 colord:x:978:976:User for colord:/var/lib/colord:/sbin/nologin
40 gdm:x:42:42::/var/lib/gdm:/sbin/nologin
41 rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
42 gnome-initial-setup:x:977:975::/run/gnome-initial-setup/:/sbin/nologin
43 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
44 avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
45 rngd:x:976:974:Random Number Generator Daemon:/var/lib/rngd:/sbin/nologin
46 tcpdump:x:72:72::/:/sbin/nologin
47 redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
[root@redhat ~]# [root@redhat ~]# cat /etc/passwd | more -10
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
operator:x:11:0:operator:/root:/sbin/nologin
[root@redhat ~]# head -5 /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
[root@redhat ~]#
[root@redhat ~]# tail -5 /etc/passwd
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
rngd:x:976:974:Random Number Generator Daemon:/var/lib/rngd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash