[root@localhost tmp]# pwd
/tmp
#文件复制
[root@localhost tmp]# cp /etc/ /tmp/
cp: omitting directory ‘/etc/’
#参数 -r 连续递归复制
[root@localhost tmp]# cp -r /etc/ /tmp/
[root@localhost tmp]# ls ./etc
abrt dhcp hosts man_db.conf popt.d slp.spi
adjtime DIR_COLORS hosts.allow maven portreserve smartmontools
[root@localhost tmp]# ls -d ./etc
./etc
[root@localhost tmp]# ls ./bashrc
./bashrc
#参数 -s 指定复制成为 symbolic link(符号链接文件),“快捷方式”
[root@localhost tmp]# cp -s bashrc bashrc_slink
#参数 -l 指定进行 hard link (硬式链接)的连接档建立,而非复制文件本身
[root@localhost tmp]# cp -l bashrc bashrc_hlink
[root@localhost tmp]# ls -l bashrc*
-rw-r--r--. 2 root root 176 Mar 30 01:17 bashrc
-rw-r--r--. 2 root root 176 Mar 30 01:17 bashrc_hlink
lrwxrwxrwx. 1 root root 6 Mar 30 16:41 bashrc_slink -> bashrc
[root@localhost tmp]# ls -l --full-time bashrc*
-rw-r--r--. 2 root root 176 2020-03-30 01:17:23.255914128 +0800 bashrc
-rw-r--r--. 2 root root 176 2020-03-30 01:17:23.255914128 +0800 bashrc_hlink
lrwxrwxrwx. 1 root root 6 2020-03-30 16:41:04.928965131 +0800 bashrc_slink -> bashrc
#直接检视文件内容
#cat = concatenate 连环、系
[root@localhost ~]# cat /etc/issue
\S
Kernel \r on an \m
#参数 -n 显示出行号
[root@localhost ~]# cat -n /etc/issue
1 \S
2 Kernel \r on an \m
3
#仅非空行做行号显示
[root@localhost ~]# cat -b /etc/issue
1 \S
2 Kernel \r on an \m
#参数 -v 列出特殊字符
#参数 -E 将结尾的断行字符$显示
#参数 -T 将 tab 按键以 ^I 显示出来
#参数 -A 相当于 -vET 列出特殊字符而不是空白
[root@localhost ~]# cat -A /
Linux_centos7_文件与目录管理_文件内容查阅_文件与目录权限(3)_(bird_bro)
最新推荐文章于 2023-06-26 06:54:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)