2、复制/etc目录下所有以p开头,以非数字结尾的文件或目录到/tmp/mytest1目录中。
2、复制/etc目录下所有以p开头,以非数字结尾的文件或目录到/tmp/mytest1目录中。
[root@CentOS8 /bin]#ls /etc/p*[^[:digit:]] -ld
drwxr-xr-x. 2 root root 4096 Apr 6 19:13 /etc/pam.d
-rw-r--r--. 1 root root 68 May 14 2019 /etc/papersize
-rw-r--r--. 1 root root 2560 Apr 3 15:09 /etc/passwd
-rw-r--r--. 1 root root 2505 Apr 3 15:04 /etc/passwd-
-rw-r--r--. 1 root root 1362 May 14 2019 /etc/pbm2ppa.conf
-rw-r--r--. 1 root root 2872 May 14 2019 /etc/pinforc
drwxr-xr-x. 2 root root 27 Apr 3 15:00 /etc/pipewire
drwxr-xr-x. 10 root root 123 Apr 3 15:03 /etc/pki
drwxr-xr-x. 2 root root 28 Apr 3 15:00 /etc/plymouth
drwxr-xr-x. 5 root root 52 Apr 3 14:59 /etc/pm
-rw-r--r--. 1 root root 6300 May 14 2019 /etc/pnm2ppa.conf
drwxr-xr-x. 2 root root 6 Jan 19 2021 /etc/popt.d
drwxr-xr-x. 2 root root 24 Apr 3 15:00 /etc/prelink.conf.d
-rw-r--r--. 1 root root 233 Sep 10 2018 /etc/printcap
-rw-r--r--. 1 root root 2123 May 15 2020 /etc/profile
drwxr-xr-x. 2 root root 4096 Apr 4 23:05 /etc/profile.d
-rw-r--r--. 1 root root 6568 Sep 10 2018 /etc/protocols
drwxr-xr-x. 2 root root 79 Apr 3 15:00 /etc/pulse
[root@CentOS8 /bin]#mkdir /tmp/mytest1
[root@CentOS8 /bin]#cp -r /etc/p*[^[:digit:]] -ld /tmp/mytest1/
[root@CentOS8 /bin]#ll /tmp/mytest1/
total 52
drwxr-xr-x. 2 root root 4096 Apr 8 00:05 pam.d
-rw-r--r--. 2 root root 68 May 14 2019 papersize
-rw-r--r--. 2 root root 2560 Apr 3 15:09 passwd
-rw-r--r--. 2 root root 2505 Apr 3 15:04 passwd-
-rw-r--r--. 2 root root 1362 May 14 2019 pbm2ppa.conf
-rw-r--r--. 2 root root 2872 May 14 2019 pinforc
drwxr-xr-x. 2 root root 27 Apr 8 00:05 pipewire
drwxr-xr-x. 10 root root 123 Apr 8 00:05 pki
drwxr-xr-x. 2 root root 28 Apr 8 00:05 plymouth
drwxr-xr-x. 5 root root 52 Apr 8 00:05 pm
-rw-r--r--. 2 root root 6300 May 14 2019 pnm2ppa.conf
drwxr-xr-x. 2 root root 6 Apr 8 00:05 popt.d
drwxr-xr-x. 2 root root 24 Apr 8 00:05 prelink.conf.d
-rw-r--r--. 2 root root 233 Sep 10 2018 printcap
-rw-r--r--. 2 root root 2123 May 15 2020 profile
drwxr-xr-x. 2 root root 4096 Apr 8 00:05 profile.d
-rw-r--r--. 2 root root 6568 Sep 10 2018 protocols
drwxr-xr-x. 2 root root 79 Apr 8 00:05 pulse

浙公网安备 33010602011771号