没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
linux 文件系统类型
符号链接 ln -s 源 新
ls 列出当前目录文件的短格式
`[root@192 ~]# ls /
afs bin boot dev etc home lib lib64 media mnt opt proc root run
sbin srv sys tmp usr var`
ls -l 以长格式的形式列出文件名称
`[root@192 ~]# ls -l
total 4
-rw-------. 1 root root 1204 Feb 7 10:50 anaconda-ks.cfg` 文件显示的时间为创建时
间,修改以后为修改时间
ll -h 显示文件大小为k,m单位
`[root@192 ~]# ll -h
total 4.0K
-rw-------. 1 root root 1.2K Feb 7 10:50 anaconda-ks.cfg`
ll -a 显示以.开头的隐藏目录的文件
`[root@192 ~]# ll -a /
total 30
dr-xr-xr-x. 18 root root 235 Feb 7 10:35 .
dr-xr-xr-x. 18 root root 235 Feb 7 10:35 ..`
ll -i 显示目录文件下的索引节点
c 字符文件
b 块文件
l 链接文件
- 普通文件
d 目录文件
p 管道文件
s 套接字文件
符号链接-软连接 与原文件不是一个文件,相当于一个快捷模式
创建对象:文本目录,可跨文件系统
软连接和源文件的索引号不一样
[root@192 lianxi]# ln -s 1 1.link [root@192 lianxi]# ll total 0 -rw-r--r--. 1 root
root 0 Mar 2 19:36 1 lrwxrwxrwx. 1 root root 1 Mar 2 19:36 1.link -> 1
[root@192 lianxi]# ll -i total 0 35105545 -rw-r--r--. 1 root root 0 Mar 2 19:36 1
35105551 lrwxrwxrwx. 1 root root 1 Mar 2 19:36 1.link -> 1
硬链接 ln 源 新 (备份)
[root@192 lianxi]# ln 2 2.bak
`[root@192 lianxi]# ll -i 35105547 -rw-r--r--. 2 root root 0 Mar 2 19:36 2 35105547 -
rw-r--r--. 2 root root 0 Mar 2 19:36 2.bak
杂命令
hostnamectl status
[root@192 lianxi]# hostnamectl status Static hostname: n/a Transient hostname:
192.168.27.128 Icon name: computer-vm Chassis: vm 🖴 Machine ID:
811c796afcf34528bef573fc841ea6dd Boot ID: fb805b1b5a0d47219a3f2c26758c4857
Virtualization: vmware Operating System: Red Hat Enterprise Linux 9.1 (Plow) CPE OS
Name: cpe:/o:redhat:enterprise_linux:9::baseos Kernel: Linux 5.14.0-
162.6.1.el9_1.x86_64 Architecture: x86-64 Hardware Vendor: VMware, Inc. Hardware
Model: VMware Virtual Platform
cat /etc/reahat-release 查看当前版本
[root@192 lianxi]# cat /etc/redhat-release Red Hat Enterprise Linux release 9.1
(Plow)
uname 查看系统信息
[root@192 lianxi]# uname Linux [root@192 lianxi]# uname -r 5.14.0-
162.6.1.el9_1.x86_64
pstree 以树状查看当前运行的所有进程
[root@192 lianxi]# pstree systemd─┬─ModemManager───3*[{ModemManager}]
├─NetworkManager───2*[{NetworkManager}] ├─SetroubleshootP───2*[{SetroubleshootP}]
├─VGAuthService ├─accounts-daemon───3*[{accounts-daemon}] ├─alsactl ├─atd
├─auditd─┬─sedispatch
type (命令) 列出当前命令类型
[root@192 lianxi]# type cat cat is hashed (/usr/bin/cat)
date 显示或设置时间命令
date --help
硬链接文件与源文件的索引号是一样的
创建对象:不能对目录文件创建,不可跨文件系统
注意:索引号没有变
查看当前系统时间
[root@192 lianxi]# date Thu Mar 2 07:52:24 PM CST 2023
date 设置时间年月日时分秒 设置格式可以通过date --help查看
[root@192 lianxi]# date "+%Y-%m-%d %H:%M:%S" 2023-03-02 19:54:21
按照字符串形式设置时间
date -s "年-月-日 时:分:秒"
查看硬件时间
[root@192 lianxi]# clock 2023-03-02 19:59:02.931287+08:00
系统时间向硬件时间同步
hwclock -w
timedatectl 修改设置时区
查看系统时间与时区
[root@192 lianxi]# timedatectl status Local time: Thu 2023-03-02 20:01:30 CST
Universal time: Thu 2023-03-02 12:01:30 UTC RTC time: Thu 2023-03-02 12:01:29 Time
zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes NTP service: active
RTC in local TZ: no
列出当前已知的所有时区
timedatectl list-timezones
设置时区
timedatectl set-timezone Asia/shanghai
获取当前时区
timedatectl get-timezone
设置系统时间
timedatectl set-time 时间
创建删除普通文件
查看指定文件的详细信息
`stat 文件名
创建多个普通的文件
touch {a..b} 创建a-b个文件
删除普通文件
rm -f 文件名 -f强制删除
touch 选项 文件名 创建普通文件 (文件不存在,创建文件,文件存在,触摸文件,触摸文件后时
间戳会更改)
rm -f 文件名* 代表删除以文件名开头所有文件
目录操作命令
[root@192 lianxi]# mkdir -pv {a..b} mkdir: created directory 'a' mkdir: created
directory 'b'
`[root@192 lianxi]# du -h a 4.0K a
删除目录文件
rm -r -f 目录名
复制,移动文件
cp -a 原文件 目标文件
下载命令 wget
-r 递归下载 -p下载网址中所有信息
wget -rp 网址
通配符
mkdir -p 路径文件名 -p 可快速创建出目录中指定每个目录
du 选项 目录名 KB
cp 选项 原文件 目标文件 复制文件或目录 cp -a 原文件 目标文件 -a:复制时保留原属性
mv 选项 原文件 目标文件 剪切或者重命名文件或目录
wget 用于终端命令中下载网络文件 wget 选项 网址
man 7 glob 查看通配符的帮助
剩余38页未读,继续阅读
资源评论
z..l..
- 粉丝: 19
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功