1.文件详细信息
当我们用ll命令或则ls -l以长命令的方式显示文件信息的时候。我们会发现文件名字前面有很多东西,那它都代表着什么呢,我们下边来举例。
[root@root ~]# ls -l
总用量 64
-rw-------. 1 root root 1483 12月 28 00:40 anaconda-ks.cfg
第一段: 文件类型 #-
第二段: 基本权限 #rw-------
第三段: 表示是否在开启selinux的状态下创建 #.
第四段: 硬连接数 #1
第五段: 拥有者 #root
第六段: 所属组 #root
第七段: 文件size #1483
第八段: 文件最后一次修改时间 #2月 28 00:40
第九段: 文件名 #anaconda-ks.cfg
2.文件类型
以上就是文件具体每一段的含义,而在Linux中,又分为7中文件类型,我们上面举例的文件就是一个普通文件
- 普通文件
d 目录文件 directory
c 字符设备文件 character
b 块设备文件 block
l 符号连接(软连接)文件 symlink
s 套接字文件 socket
p 管道文件 pipe
3.ls常用参数
既然我们说到了文件详细信息,那么ls后面可以跟什么参数呢?
-l 长格式
-h 按最大单位显示
-t 按修改时间排序
-r 逆序
-S 按size排序
-a 显示隐藏文件
- A 显示除了. 和.. 以外的所有文件
- d 查看目录属性
-R 递归显示目录下所有的文件名
4.获取帮助
1.--help
2.type 看命令类型
3.info
4.man手册 manual
man 1 用户指令
man 2 系统调用
man 3 库调用
man 4 特殊文件
man 5 配置文件
man 6 游戏
man 7 杂项
man 8 系统指令
[root@root ~]# man -f passwd 查看所有章节
[root@root ~]# man -k passwd 模糊查询
5.AI
借助ai等工具进行帮助5.
5.同步时间
1.ntpdate
需要安装,最小化安装是没有的
[root@root ~]# ntpdate ntp.aliyun.com #同步阿里云的时间服务器
2.systemd
CentOS 7 及以上版本默认使用 systemd 管理服务,通过 systemd-timesyncd 同步时间
[root@root ~]# systemctl enable --now systemd-timesyncd #启用并启动同步时间服务
[root@root ~]# vi /etc/systemd/timesyncd.conf #编辑配置文件
NTP=ntp.aliyun.com #找到ntp这一行写入时间服务器
[root@root ~]# systemctl restart systemd-timesyncd #重启服务
3.chrony
需要安装
4.date
使用date手动进行同步时间
6.切换语言
[root@root ~]# LANG=c
[root@root ~]# LANG=zh_CN.utf-8
[root@root ~]# LANG=en_US.utf-8
2226

被折叠的 条评论
为什么被折叠?



