Linux_centos7_文件与目录管理_文件内容查阅_文件与目录权限(3)_(bird_bro)

本文详细介绍了Linux CentOS7系统中如何进行文件与目录的管理,包括内容查阅和权限设置。针对不同级别的用户,讲解了如何查看、修改和控制文件及目录的访问权限,确保系统的安全性和高效性。
摘要由CSDN通过智能技术生成

在这里插入图片描述

[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 /
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值