linux基本操作命令
文章目录
2 shell命令基础
Linux操作系统的Shell作为操作系统的外壳,为用户提供使用操作系统的接口。它是命令语言命令解释程序及程序设计语言的统称。
Shell是用户和Linux内核之间的接口程序,如果把Linux内核想象成一个球体的中心, Shel家是球体的外层。当从Shell或其他程序向Linux传递命令时,内核会做出相应的反应。
2.1 shell 命令格式
command [选项] [参数]
[root@localhost ~]# ls
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg
[root@localhost ~]#
一般规律
(1)命令 文件名 参数 等要区分大小写
(2) 命令 文件名 参数 之间要有一个或者多个空格
(3) 命令太长,要使用“\”来转义enter,实现一条命令跨多行.
[root@localhost ~]# hostnamectl set-hostname \
> text1
[root@localhost ~]# bash
[root@text1 ~]#
显示系统信息命令
(1)who 查看用户登录信息
[root@text1 ~]# who -a
系统引导 2024-03-18 10:45
运行级别 5 2024-03-18 10:46
root ?seat0 2024-03-18 10:46 ? 2070 (login screen)
root + tty2 2024-03-18 10:46 00:49 2070 (tty2)
root + pts/1 2024-03-18 10:48 . 2776 (192.168.248.1)
[root@text1 ~]#
(2) whoami 显示当前操作用户
[root@text1 ~]# whoami
root
[root@text1 ~]#
(3)hostname/hostnamectl—显示或设置当前系统主机名
[root@text1 ~]# hostname
text1
[root@text1 ~]#
[root@localhost ~]# hostnamectl set-hostname \
> text1
[root@localhost ~]# bash
[root@text1 ~]#
(4)date 显示时间日期
[root@text1 ~]# date
2024年 03月 18日 星期一 11:45:17 CST
[root@text1 ~]#
(5)cal 显示日历
root@text1 ~]# cal
三月 2024
一 二 三 四 五 六 日
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
[root@text1 ~]#
(6)clear 清屏
[root@text1 ~]# clear
[root@text1 ~]#
shell使用技巧
1.命令和文件的自动补全功能
[root@text1 ~]# mkd
mkdict mkdir mkdosfs mkdumprd
[root@text1 ~]# mkd
2.历史命令
[root@text1 ~]# cat /root/.bash_history
ip a
vim /etc/ssh/ssh
[root@text1 ~]#
语法一:history 参数
如果history没有接参数,将会显示整个历史内容。接了参数n,就会显示最近n个命令
[root@text1 ~]# history 5
17 hostnametcl set-hostname text1
18 hostnamectl set-hostname text1
19 bash
20 ip address
21 history 5
[root@text1 ~]#
自定义历史命令列表
(1)新建一个文件,用来储存自己的常用命令,每个命令占一行。
[root@text1 ~]# pwd
/root
[root@text1 ~]# touch history.txt
[root@text1 ~]# cat history.txt
[root@text1 ~]#
(2)清空历史命令
[root@text1 ~]# history -c
[root@text1 ~]#
(3)将历史命令列表中的内容写入历史命令文件中,并覆盖历史命令文件的原有内容
[root@text1 ~]# dir
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg history.txt
[root@text1 ~]# ||
-bash: 未预期的符号“||”附近有语法错误
[root@text1 ~]# ||
-bash: 未预期的符号“||”附近有语法错误
[root@text1 ~]# ll
总用量 4
drwxr-xr-x. 2 root root 6 3月 18 10:15 公共
drwxr-xr-x. 2 root root 6 3月 18 10:15 模板
drwxr-xr-x. 2 root root 6 3月 18 10:15 视频
drwxr-xr-x. 2 root root 6 3月 18 10:15 图片
drwxr-xr-x. 2 root root 6 3月 18 10:15 文档
drwxr-xr-x. 2 root root 6 3月 18 10:15 下载
drwxr-xr-x. 2 root root 6 3月 18 10:15 音乐
drwxr-xr-x. 2 root root 6 3月 18 10:15 桌面
-rw-------. 1 root root 1010 3月 18 10:07 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 3月 18 19:06 history.txt
[root@text1 ~]# history -w /root/history.txt
[root@text1 ~]# cat /root/history.txt
dir
||
ll
history -w /root/history.txt
[root@text1 ~]#
命令别名
用户可以为复杂的命令创建一个简单的别名
alias [别名]=[命令名称]
alias 别名=‘需要替换的命令名称’
root@text1 ~]# cat /root/.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
查询命令别名
[root@text1 ~]# alias
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'
[root@text1 ~]#
设置ls -l /jhome命令别名为displayhome
[root@text1 ~]# alias displayhome='ls -l /home'
[root@text1 ~]# displayhome
总用量 4
drwx------. 14 w w 4096 3月 18 10:09 w
[root@text1 ~]#
查看别名信息
[root@text1 ~]# alias
alias cp='cp -i'
alias displayhome='ls -l /home'
alias displyhome='ls -l /home'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'
[root@text1 ~]#
取消别名设置命令
[root@text1 ~]# unalias displayhome
[root@text1 ~]# displayhme
bash: displayhme: command not found...
[root@text1 ~]# displayhome
bash: displayhome: command not found...
[root@text1 ~]#
命令帮助
(1)利用whatis查询命令
[root@text1 ~]# whatis ls
ls:没有合适结果。
[root@text1 ~]#
(2)–help 查询命令
[root@text1 ~]# ls --help
用法:ls [选项]... [文件]...
列出给定文件(默认为当前目录)的信息。
如果不指定 -cftuvSUX 中任意一个或--sort 选项,则根据字母大小排序。
必选参数对长短选项同时适用。
-a, --all 不隐藏任何以 . 开始的项目
-A, --almost-all 列出除 . 及 .. 以外的任何项目
--author 与 -l 同时使用时,列出每个文件的作者
-b, --escape 以 C 风格的转义序列表示不可打印的字符
--block-size=大小 与 -l 同时使用时,将文件大小以此处给定的大小为
单位进行缩放;例如:“--block-size=M”;
请参考下文的大小格式说明
-B, --ignore-backups 不列出任何以 ~ 字符结束的项目
-c 与 -lt 共同使用时:根据 ctime 排序并显示
ctime(文件状态最后更改的时间);
与 -l 共同使用时:显示 ctime 并按照名称排序;
其它情况:按照 ctime 排序,最新的最前
-C 每栏由上至下列出项目
--color[=WHEN] 控制是否使用带颜色的输出;WHEN 可以是
“always”(默认缺省值)、“auto”或
“never”;更多信息请见下文
-d, --directory 当遇到目录时列出目录本身而非目录内的文件
-D, --dired 产生适合 Emacs 的 dired 模式使用的结果
-f 不进行排序,-aU 选项生效,禁用 -ls --color
-F, --classify 加上文件类型的指示符号(*/=@| 其中一个)
--file-type 类似,但不后缀‘*’字符
--format=关键字 交错 -x,逗号分隔 -m,水平 -x,长 -l,
单栏 -1,详细 -l,垂直 -C
--full-time 类似 -l --time-style=full-iso
-g 类似 -l,但不列出所有者
--group-directories-first
在文件前分组目录;
此选项可与--sort 一起使用,但是一旦使用
--sort=none (-U) 将禁用分组
-G, --no-group 以一个长列表的形式,不输出组名
-h, --human-readable 与 -l 和 -s 一起,以易于阅读的格式输出文件
大小(例如 1K 234M 2G等)
--si 同上面类似,但是使用 1000 为基底而非 1024
-H, --dereference-command-line
跟随命令行列出的符号链接
--dereference-command-line-symlink-to-dir
跟随命令行列出的指向目录的符号链接
--hide=PATTERN 隐藏符合 shell PATTERN 模式的项目
(-a 或 -A 将覆盖此选项)
--hyperlink[=WHEN] 文件名使用超链接;WHEN 可以是“always”
(缺省时的默认选项)、“auto”或
“never”
--indicator-style=方式 指定在每个项目名称后加上指示符号方式:
none(默认)、slash(-p)、
file-type(--file-type)以及 classify(-F)
-i, --inode 显示每个文件的索引编号(inode 号)
-I, --ignore=模式 不显示任何匹配指定 shell <模式>的项目
-k, --kibibytes 默认使用 1024 字节的块显示磁盘使用量;
只用于 -s 和每个目录的总计
-l 使用较长格式列出信息
-L, --dereference 当显示符号链接的文件信息时,显示符号链接所指示
的对象而并非符号链接本身的信息
-m 所有项目以逗号分隔,并填满整行行宽
-n, --numeric-uid-gid 类似 -l,但列出用户和组的 ID 号
-N, --literal 输出未经引号括起的项目名称
-o 类似 -l,但不列出有关组的信息
-p, --indicator-style=slash
对目录附加“/”作为指示符号
-q, --hide-control-chars 以“?”字符代替无法打印的字符
--show-control-chars 原样显示无法打印的字符(这是默认行为,除非被调用
本程序的名称是“ls”而且是在终端中进行输出)
-Q, --quote-name 将条目名称括上双引号
--quoting-style=方式 使用指定引用的方式显示条目的名称:
literal, locale, shell, shell-always,
shell-escape, shell-escape-always, c, escape
(该选项优先于 QUOTING_STYLE 环境变量的配置)
-r, --reverse 逆序排列
-R, --recursive 递归显示子目录
-s, --size 以块数形式显示每个文件分配的尺寸
-S sort by file size, largest first
--sort=WORD sort by WORD instead of name: none (-U), size (-S),
time (-t), version (-v), extension (-X)
--time=WORD change the default of using modification times;
access time (-u): atime, access, use;
change time (-c): ctime, status;
birth time: birth, creation;
with -l, WORD determines which time to show;
with --sort=time, sort by WORD (newest first)
--time-style=TIME_STYLE 使用 -l 时显示的时间/日期格式;请见下面
TIME_STYLE 的相关内容
-t 按时间排序,最新的最前;参见 --time
-T, --tabsize=COLS 指定制表符(Tab)的宽度,而非默认8字符
-u 同 -lt 一起使用:按照访问时间排序并显示;
同 -l 一起使用:显示访问时间并按文件名排序
其它:按照访问时间排序,最新的最靠前
-U 不进行排序;按照目录顺序列出项目
-v 在文本中进行数字(版本)的自然排序
-w, --width=COLS 设置输出宽度为 COLS 对应的值。0 代表无限制
-x 逐行列出项目而不是逐栏列出
-X 根据扩展名按字母顺序排序
-Z, --context 输出每个文件的所有安全上下文信息
-1 每行只列出一个文件。与 -q 或 -b 共用时避免 '\n'
--help 显示此帮助信息并退出
--version 显示版本信息并退出
The SIZE argument is an integer and optional unit (example: 10K is 10*1024).
Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).
Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
TIME_STYLE 参数可以是 full-iso、long-iso、iso、locale 或 +格式。
这里的格式字符串按照类似 date(1) 的方式进行解读。如果格式字符串是
格式1<换行符>格式2 的形式的话,格式1对应的字符串将应用于不是最近使用的文件
而格式2对应的字符串将应用于最近使用的文件。TIME_STYLE 如果带有“posix-”
前缀,它只会在 POSIX locale 之外发挥作用。另外,TIME_STYLE 环境变量如果存在
则会作为默认使用的格式。
使用色彩来区分文件类型的功能已被禁用,默认设置和 --color=never 同时禁用了它。
使用 --color=auto 选项,ls 只在标准输出被连至终端时才生成颜色代码。
LS_COLORS 环境变量可改变此设置,可使用 dircolors 命令来设置。
退出状态:
0 正常
1 一般问题 (例如:无法访问子文件夹)
2 严重问题 (例如:无法使用命令行参数)
GNU coreutils 在线帮助:<https://www.gnu.org/software/coreutils/>
请向 <http://translationproject.org/team/zh_CN.html> 报告任何翻译错误
完整文档 <https://www.gnu.org/software/coreutils/ls>
或者在本地使用:info '(coreutils) ls invocation'
[root@text1 ~]#
(3)利用man命令,查询
colorize the output; WHEN can be 'always' (default if omitted), 'auto', or 'never'; more
info below
-d, --directory
list directories themselves, not their contents
-D, --dired
generate output designed for Emacs' dired mode
Manual page ls(1) line 33 (press h for help or q to quit)
-f do not sort, enable -aU, disable -ls --color
-F, --classify
append indicator (one of */=>@|) to entries
--file-type
likewise, except do not append '*'
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabeti‐
cally if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all
do not ignore entries starting with .
Manual page ls(1) line 1 (press h for help or q to quit)
(4)利用info命令查询
gzip -d < /usr/share/info/coreutils.info.gz...
Next: dir invocation, Up: Directory listing
10.1 ‘ls’: List directory contents
==================================
The ‘ls’ program lists information about files (of any type, including
directories). Options and file arguments can be intermixed arbitrarily,
as usual.
For non-option command-line arguments that are directories, by
default ‘ls’ lists the contents of directories, not recursively, and
omitting files with names beginning with ‘.’. For other non-option
arguments, by default ‘ls’ lists just the file name. If no non-option
argument is specified, ‘ls’ operates on the current directory, acting as
if it had been invoked with a single argument of ‘.’.
-----Info: (coreutils)ls invocation, 56 lines --Top------------------------------------------------------Welcome to Info version 6.7. Type H for help, h for tutorial.
(5)其他方法
查询系统中的帮助文档
查询官网获取linux的操作文档
2.2 linux的文件及目录管理
linux的目录结构
/boot:/ 系统启动目录,存放的是启动Linux时的一一些核心文件(包括一些链接文件及映像文件 ),还可以保存与系统启动相关的文件,如内核文件和启动引导程序(grub )文件等。
/dev; Linux设备文件的保存位置, 该目录下存放的是Linux
的外部设备,Linux 中的设备都是以文件的形式存在的。
/etc:该目录用来存放系统管理员所需要的配置文件和子目录
的文件保存位置,该目录的内容一般只能由管理员进行修改,密码
文件、网络配置信息、系统内所有采用默认安装方式(RPM安装)图2.2 Linux操作系统的的服务配置文件全部保存在该目录下,如用户信息、服务的启动脚
本、常用服务的配置文件等。
/home:普通用户的主目录(也称为家目录)。在创建用户时,每个用户都要有一个默认登录和保存自己数据的位置,即用户的主目录,所有普通用户的主目录都是在home下建立一个和用户名相同的目录,为该用户分配一个空间, 例如,用户user01的主目录就是home/user01.这个目录主要用于存放与个,人用户有关的私人文件。
/media:挂载目录,建议用来挂载媒体设备,如软盘和光盘。/mnt:挂载目录,该目录是空的,建议用来挂载额外的设备,如U盘、移动硬盘和其他操作系统的分区。
lopt:第三方安装的软件的保存位置,该目录用于放置和安装其他软件,手工安装的源码包软件都可以安装到该目录下。但建议将软件放到/usrlocal目录下,也就是说,/usrlocal 目录也可以用来安装软件。
/proc:虚拟目录,是系统内存的映射,可直接访问该目录来获取系统信息。该目录中的数据并不保存在硬盘中,而是保存到内存中。该目录主要用于保存系统的内核、进程、外部设备状态和网络状态等。例如,/proclcpuinfo是用于保存CPU信息的,/procldevices 是用于保存设备驱动的列表的,/roclesystems是用于保存文件系统列表的,/proc/net 是用于保存网络协议信息的。
/lroot:系统管理员的主目录,普通用户的主目录在/home目录下,root用户的主目录在/目录下。/run:用于存放自系统启动以来描述系统信息的文件。
/snv:服务数据目录。-些系统服务启动之后,可以在该目录下保存所需要的数据。
/tmp:临时目录。系统存放临时文件的目录,在该目录下,所有用户都可以访问和写入。建议该目录下不要保存重要数据,最好每次开机时都把该目录清空。你自五讯
/usr:该目录用于存储系统软件资源,即应用程序和文件。用户要用到的程序和文件几乎都存放在该目录下,如命令、帮助文件等。当安装个Linux发行版官方提供的软件包时,大多安装在该目录下
Nvar:用于存放运行时需要改变数据的文件。该目录也是某些大文件的溢出区,如各种服务的日志文件(系统启动日志等)。
/bin: 存放系统基本的用户命令。基础系统(也是最小系统)所需要的命令位于该目录下,如Is、m、中等,普通用户和rot用户都可以执行该目录下的文件,位于/bin下的命令在单用户模式下也执行。
/lib 与/ib64:用于保存系统调用的函数库(包含最基本的共享库和内核模块),或者存放用于启动系统和执行root文件系统的命令(如/bin/sbin的二进制文件的共享库),或者存放32位64位(可使用file命令查看)文件。
/sbin:用于保存系统管理员命令,具有管理员权限的用户可以执行该目录下的命令。
文件目录显示类命令
(1)pwd 显示当前工作目录
[root@text1 ~]# pwd
/root
[root@text1 ~]#
(2)cd 改变当前工作目录
cd [相对路径或者绝对路径]
绝对路径:从根目录开始(/)的路径
相对路径:起点为当前目录。
root@text1 ~]# pwd
/root
[root@text1 ~]# cd /etc
[root@text1 etc]# cd yum.repos.d
[root@text1 yum.repos.d]# pwd
/etc/yum.repos.d
[root@text1 yum.repos.d]# cd.
bash: cd.: command not found...
[root@text1 yum.repos.d]# cd .
[root@text1 yum.repos.d]# cd ..
[root@text1 etc]# pwd
/etc
[root@text1 etc]# pwd
/etc
[root@text1 etc]# cd ~
[root@text1 ~]# pwd
/root
[root@text1 ~]# cd -
/etc
[root@text1 etc]#
(3)ls 显示目录文件
ls [选项] 目录或者文件名
root@text1 etc]# ls -a
. dnf kdump.conf PackageKit sos
.. dnsmasq.conf kernel pam.d speech-dispatcher
accountsservice dnsmasq.d krb5.conf papersize ssh
adjtime dracut.conf krb5.conf.d passwd ssl
aliases dracut.conf.d ld.so.cache passwd- sssd
alsa egl ld.so.conf pbm2ppa.conf statetab.d
alternatives enscript.cfg ld.so.conf.d pinforc subgid
anacrontab environment libaudit.conf pkcs11 subgid-
appstream.conf ethertypes libblockdev pkgconfig subuid
asound.conf exports libibverbs.d pki subuid-
at.deny favicon.png libnl plymouth sudo.conf
audit filesystems libpaper.d pm sudoers
authselect firefox libreport pnm2ppa.conf sudoers.d
avahi firewalld libssh polkit-1 sudo-ldap.conf
bash_completion.d flatpak libuser.conf popt.d swid
bashrc fonts locale.conf printcap sysconfig
bindresvport.blacklist foomatic localtime profile sysctl.conf
binfmt.d fprintd.conf login.defs profile.d sysctl.d
bluetooth fstab logrotate.conf protocols systemd
brlapi.key fuse.conf logrotate.d pulse system-release
brltty fwupd lsm .pwd.lock system-release-cpe
brltty.conf gcrypt lvm qemu-ga terminfo
chromium gdm machine-id ras tmpfiles.d
chrony.conf geoclue magic rc.d tpm2-tss
chrony.keys glvnd mailcap rc.local trusted-key.key
cifs-utils gnupg makedumpfile.conf.sample redhat-release tuned
cni GREP_COLORS man_db.conf resolv.conf udev
cockpit groff mcelog rhc udisks2
containers group microcode_ctl rhsm .updated
cron.d group- mime.types rpc updatedb.conf
cron.daily grub2.cfg mke2fs.conf rpm UPower
cron.deny grub2-efi.cfg modprobe.d rsyncd.conf usb_modeswitch.conf
cron.hourly grub.d modules-load.d rsyslog.conf vconsole.conf
cron.monthly gshadow motd rsyslog.d vimrc
crontab gshadow- motd.d rwtab.d virc
cron.weekly gss mtab samba vmware-tools
crypto-policies host.conf multipath sane.d vulkan
crypttab hostname nanorc sasl2 wgetrc
csh.cshrc hosts netconfig security wireplumber
csh.login hp NetworkManager selinux wpa_supplicant
cups inittab networks services X11
cupshelpers inputrc nftables sestatus.conf xattr.conf
dbus-1 insights-client nsswitch.conf setroubleshoot xdg
dconf iproute2 nsswitch.conf.bak sgml xml
default iscsi nvme shadow yum
depmod.d issue openldap shadow- yum.conf
dhcp issue.d opt shells yum.repos.d
DIR_COLORS issue.net os-release skel
DIR_COLORS.lightbgcolor kdump ostree smartmontools
[root@text1 etc]# ls -l
总用量 1312
drwxr-xr-x. 3 root root 28 3月 18 09:51 accountsservice
-rw-r--r--. 1 root root 16 3月 18 10:06 adjtime
-rw-r--r--. 1 root root 1529 6月 23 2020 aliases
drwxr-xr-x. 3 root root 65 3月 18 09:56 alsa
drwxr-xr-x. 2 root root 4096 3月 18 09:56 alternatives
-rw-r--r--. 1 root root 541 7月 11 2022 anacrontab
-rw-r--r--. 1 root root 833 2月 11 2023 appstream.conf
-rw-r--r--. 1 root root 55 5月 15 2023 asound.conf
-rw-r--r--. 1 root root 1 4月 4 2022 at.deny
drwxr-x---. 4 root root 100 3月 18 09:53 audit
drwxr-xr-x. 3 root root 4096 3月 18 10:06 authselect
drwxr-xr-x. 4 root root 71 3月 18 09:51 avahi
drwxr-xr-x. 2 root root 124 3月 18 09:56 bash_completion.d
-rw-r--r--. 1 root root 2658 12月 21 2022 bashrc
-rw-r--r--. 1 root root 535 6月 6 2023 bindresvport.blacklist
drwxr-xr-x. 2 root root 6 8月 22 2023 binfmt.d
drwxr-xr-x. 2 root root 23 3月 18 09:51 bluetooth
-rw-r-----. 1 root brlapi 33 3月 18 09:54 brlapi.key
drwxr-xr-x. 7 root root 84 3月 18 09:54 brltty
-rw-r--r--. 1 root root 28974 8月 10 2021 brltty.conf
drwxr-xr-x. 3 root root 36 3月 18 09:55 chromium
-rw-r--r--. 1 root root 1369 8月 29 2022 chrony.conf
-rw-r-----. 1 root chrony 540 8月 29 2022 chrony.keys
drwxr-xr-x. 2 root root 26 3月 18 09:52 cifs-utils
drwxr-xr-x. 2 root root 6 3月 18 09:54 cni
drwxr-xr-x. 4 root root 66 3月 18 09:55 cockpit
drwxr-xr-x. 7 root root 154 3月 18 09:54 containers
drwxr-xr-x. 2 root root 21 3月 18 09:51 cron.d
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.daily
-rw-r--r--. 1 root root 0 7月 11 2022 cron.deny
drwxr-xr-x. 2 root root 22 3月 23 2022 cron.hourly
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.monthly
-rw-r--r--. 1 root root 451 3月 23 2022 crontab
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.weekly
drwxr-xr-x. 6 root root 81 3月 18 09:49 crypto-policies
-rw-------. 1 root root 0 3月 18 09:48 crypttab
-rw-r--r--. 1 root root 1401 12月 21 2022 csh.cshrc
-rw-r--r--. 1 root root 1087 12月 21 2022 csh.login
drwxr-xr-x. 4 root lp 4096 3月 19 19:06 cups
drwxr-xr-x. 2 root root 34 3月 18 09:54 cupshelpers
drwxr-xr-x. 4 root root 78 3月 18 09:51 dbus-1
drwxr-xr-x. 4 root root 31 3月 18 09:51 dconf
drwxr-xr-x. 2 root root 33 3月 18 10:05 default
drwxr-xr-x. 2 root root 40 3月 18 09:52 depmod.d
drwxr-xr-x. 3 root root 24 3月 18 09:56 dhcp
-rw-r--r--. 1 root root 4673 1月 6 2023 DIR_COLORS
-rw-r--r--. 1 root root 4755 1月 6 2023 DIR_COLORS.lightbgcolor
drwxr-xr-x. 8 root root 128 3月 18 09:49 dnf
-rw-r--r--. 1 root dnsmasq 27839 7月 28 2023 dnsmasq.conf
drwxr-xr-x. 2 root dnsmasq 6 7月 28 2023 dnsmasq.d
-rw-r--r--. 1 root root 117 8月 23 2023 dracut.conf
drwxr-xr-x. 2 root root 6 8月 23 2023 dracut.conf.d
drwxr-xr-x. 3 root root 37 3月 18 09:50 egl
-rw-r--r--. 1 root root 4760 8月 10 2021 enscript.cfg
-rw-r--r--. 1 root root 0 12月 21 2022 environment
-rw-r--r--. 1 root root 1362 6月 23 2020 ethertypes
-rw-r--r--. 1 root root 0 6月 23 2020 exports
lrwxrwxrwx. 1 root root 56 5月 16 2023 favicon.png -> /usr/share/icons/hicolor/16x16/apps/fedora-logo-icon.png
-rw-r--r--. 1 root root 66 6月 23 2020 filesystems
drwxr-xr-x. 3 root root 18 3月 18 09:56 firefox
drwxr-x---. 8 root root 149 3月 18 09:56 firewalld
drwxr-xr-x. 3 root root 23 3月 18 09:53 flatpak
drwxr-xr-x. 3 root root 38 3月 18 09:51 fonts
drwxr-xr-x. 2 root root 28 3月 18 09:54 foomatic
-rw-r--r--. 1 root root 20 8月 20 2021 fprintd.conf
-rw-r--r--. 1 root root 666 3月 18 09:48 fstab
-rw-r--r--. 1 root root 38 8月 10 2023 fuse.conf
drwxr-xr-x. 4 root root 150 3月 18 09:54 fwupd
drwxr-xr-x. 2 root root 6 3月 24 2023 gcrypt
drwxr-xr-x. 6 root root 107 3月 18 09:54 gdm
drwxr-xr-x. 2 root root 26 3月 18 09:52 geoclue
drwxr-xr-x. 3 root root 26 3月 18 09:50 glvnd
drwxr-xr-x. 2 root root 6 4月 26 2023 gnupg
-rw-r--r--. 1 root root 94 8月 10 2021 GREP_COLORS
drwxr-xr-x. 4 root root 40 3月 18 09:50 groff
-rw-r--r--. 1 root root 809 3月 18 10:06 group
-rw-r--r--. 1 root root 798 3月 18 09:56 group-
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2-efi.cfg -> ../boot/grub2/grub.cfg
drwx------. 2 root root 4096 3月 18 10:04 grub.d
----------. 1 root root 650 3月 18 10:06 gshadow
----------. 1 root root 643 3月 18 09:56 gshadow-
drwxr-xr-x. 3 root root 20 3月 18 09:51 gss
-rw-r--r--. 1 root root 9 6月 23 2020 host.conf
-rw-r--r--. 1 root root 6 3月 18 11:31 hostname
-rw-r--r--. 1 root root 158 6月 23 2020 hosts
drwxr-xr-x. 2 root root 24 3月 18 09:50 hp
-rw-r--r--. 1 root root 490 8月 22 2023 inittab
-rw-r--r--. 1 root root 943 6月 23 2020 inputrc
drwxr-xr-x. 2 root root 4096 3月 18 09:54 insights-client
drwxr-xr-x. 2 root root 159 3月 18 09:51 iproute2
drwxr-xr-x. 2 root root 25 3月 18 09:51 iscsi
-rw-r--r--. 1 root root 23 9月 27 15:56 issue
drwxr-xr-x. 2 root root 27 3月 18 09:55 issue.d
-rw-r--r--. 1 root root 22 9月 27 15:56 issue.net
drwxr-xr-x. 4 root root 33 3月 18 09:52 kdump
-rw-r--r--. 1 root root 8979 3月 18 09:52 kdump.conf
drwxr-xr-x. 3 root root 38 3月 18 09:57 kernel
-rw-r--r--. 1 root root 880 8月 9 2023 krb5.conf
drwxr-xr-x. 2 root root 83 3月 18 09:56 krb5.conf.d
-rw-r--r--. 1 root root 39307 3月 18 10:08 ld.so.cache
-rw-r--r--. 1 root root 28 8月 2 2021 ld.so.conf
drwxr-xr-x. 2 root root 39 3月 18 09:56 ld.so.conf.d
-rw-r-----. 1 root root 191 1月 24 2022 libaudit.conf
drwxr-xr-x. 3 root root 20 3月 18 09:52 libblockdev
drwxr-xr-x. 2 root root 4096 3月 18 09:50 libibverbs.d
drwxr-xr-x. 2 root root 35 3月 18 09:50 libnl
drwxr-xr-x. 2 root root 6 8月 10 2021 libpaper.d
drwxr-xr-x. 6 root root 70 3月 18 09:49 libreport
drwxr-xr-x. 2 root root 62 3月 18 09:51 libssh
-rw-r--r--. 1 root root 2391 3月 1 2021 libuser.conf
-rw-r--r--. 1 root root 19 3月 18 10:06 locale.conf
lrwxrwxrwx. 1 root root 35 3月 18 10:06 localtime -> ../usr/share/zoneinfo/Asia/Shanghai
-rw-r--r--. 1 root root 7778 7月 12 2023 login.defs
-rw-r--r--. 1 root root 496 6月 7 2020 logrotate.conf
drwxr-xr-x. 2 root root 4096 3月 18 09:56 logrotate.d
drwxr-xr-x. 3 root root 43 3月 18 09:53 lsm
drwxr-xr-x. 7 root root 115 3月 18 09:52 lvm
-r--r--r--. 1 root root 33 3月 18 09:51 machine-id
-rw-r--r--. 1 root root 111 7月 18 2023 magic
-rw-r--r--. 1 root root 272 4月 22 2020 mailcap
-rw-r--r--. 1 root root 5122 7月 4 2023 makedumpfile.conf.sample
-rw-r--r--. 1 root root 5235 9月 21 2022 man_db.conf
drwxr-xr-x. 3 root root 41 3月 18 09:56 mcelog
drwxr-xr-x. 3 root root 32 3月 18 09:56 microcode_ctl
-rw-r--r--. 1 root root 67454 4月 22 2020 mime.types
-rw-r--r--. 1 root root 1208 6月 8 2022 mke2fs.conf
drwxr-xr-x. 2 root root 54 3月 18 09:56 modprobe.d
drwxr-xr-x. 2 root root 6 8月 22 2023 modules-load.d
-rw-r--r--. 1 root root 0 6月 23 2020 motd
drwxr-xr-x. 2 root root 44 3月 18 09:55 motd.d
lrwxrwxrwx. 1 root root 19 3月 18 09:51 mtab -> ../proc/self/mounts
drwxr-xr-x. 2 root root 6 8月 2 2023 multipath
-rw-r--r--. 1 root root 10373 8月 10 2021 nanorc
-rw-r--r--. 1 root root 767 6月 6 2023 netconfig
drwxr-xr-x. 7 root root 134 3月 18 09:52 NetworkManager
-rw-r--r--. 1 root root 58 6月 23 2020 networks
drwx------. 3 root root 66 3月 18 09:51 nftables
lrwxrwxrwx. 1 root root 29 3月 18 10:06 nsswitch.conf -> /etc/authselect/nsswitch.conf
-rw-r--r--. 1 root root 2108 9月 25 15:47 nsswitch.conf.bak
drwxr-xr-x. 2 root root 57 3月 18 09:55 nvme
drwxr-xr-x. 3 root root 36 3月 18 09:51 openldap
drwxr-xr-x. 3 root root 20 3月 18 09:55 opt
lrwxrwxrwx. 1 root root 21 9月 27 15:56 os-release -> ../usr/lib/os-release
drwxr-xr-x. 3 root root 23 3月 18 09:51 ostree
drwxr-xr-x. 2 root root 76 3月 18 09:56 PackageKit
drwxr-xr-x. 2 root root 4096 3月 18 10:06 pam.d
-rw-r--r--. 1 root root 68 8月 10 2021 papersize
-rw-r--r--. 1 root root 2091 3月 18 10:06 passwd
-rw-r--r--. 1 root root 2057 3月 18 09:56 passwd-
-rw-r--r--. 1 root root 1362 8月 11 2021 pbm2ppa.conf
-rw-r--r--. 1 root root 2872 8月 11 2021 pinforc
drwxr-xr-x. 3 root root 21 3月 18 09:50 pkcs11
drwxr-xr-x. 3 root root 27 3月 18 09:51 pkgconfig
drwxr-xr-x. 15 root root 4096 3月 18 10:09 pki
drwxr-xr-x. 2 root root 28 3月 18 09:52 plymouth
drwxr-xr-x. 5 root root 52 3月 18 09:50 pm
-rw-r--r--. 1 root root 6300 8月 11 2021 pnm2ppa.conf
drwxr-xr-x. 5 root root 72 3月 18 09:51 polkit-1
drwxr-xr-x. 2 root root 6 8月 11 2021 popt.d
-rw-r--r--. 1 root root 233 6月 23 2020 printcap
-rw-r--r--. 1 root root 1899 12月 21 2022 profile
drwxr-xr-x. 2 root root 4096 3月 18 09:56 profile.d
-rw-r--r--. 1 root root 6568 6月 23 2020 protocols
drwxr-xr-x. 2 root root 25 3月 18 09:51 pulse
drwxr-xr-x. 3 root root 50 3月 18 09:56 qemu-ga
drwxr-xr-x. 3 root root 27 3月 18 09:56 ras
drwxr-xr-x. 3 root root 36 3月 18 09:51 rc.d
lrwxrwxrwx. 1 root root 13 8月 22 2023 rc.local -> rc.d/rc.local
-rw-r--r--. 1 root root 44 9月 27 15:56 redhat-release
-rw-r--r--. 1 root root 74 3月 19 19:05 resolv.conf
drwxr-xr-x. 3 root root 40 3月 18 09:56 rhc
drwxr-xr-x. 6 root root 84 3月 18 09:54 rhsm
-rw-r--r--. 1 root root 1634 8月 2 2021 rpc
drwxr-xr-x. 2 root root 6 6月 30 2023 rpm
-rw-r--r--. 1 root root 458 11月 2 2022 rsyncd.conf
-rw-r--r--. 1 root root 3303 7月 31 2023 rsyslog.conf
drwxr-xr-x. 2 root root 6 7月 31 2023 rsyslog.d
drwxr-xr-x. 2 root root 35 3月 18 09:52 rwtab.d
drwxr-xr-x. 2 root root 61 3月 18 09:51 samba
drwxr-xr-x. 3 root root 4096 3月 18 09:52 sane.d
drwxr-xr-x. 2 root root 6 9月 13 2022 sasl2
drwxr-xr-x. 7 root root 4096 3月 18 09:51 security
drwxr-xr-x. 3 root root 57 3月 18 09:51 selinux
-rw-r--r--. 1 root root 692252 6月 23 2020 services
-rw-r--r--. 1 root root 216 6月 27 2023 sestatus.conf
drwxr-xr-x. 2 root root 33 3月 18 09:53 setroubleshoot
drwxr-xr-x. 3 root root 21 3月 18 09:50 sgml
----------. 1 root root 1133 3月 18 10:12 shadow
----------. 1 root root 1134 3月 18 10:06 shadow-
-rw-r--r--. 1 root root 44 6月 23 2020 shells
drwxr-xr-x. 3 root root 78 3月 18 09:50 skel
drwxr-xr-x. 3 root root 74 3月 18 09:56 smartmontools
drwxr-xr-x. 6 root root 86 3月 18 09:54 sos
drwxr-xr-x. 4 root root 56 3月 18 09:52 speech-dispatcher
drwxr-xr-x. 4 root root 4096 3月 18 10:16 ssh
drwxr-xr-x. 2 root root 77 3月 18 09:51 ssl
drwx------. 4 sssd sssd 31 3月 18 09:52 sssd
drwxr-xr-x. 2 root root 6 8月 10 2021 statetab.d
-rw-r--r--. 1 root root 15 3月 18 10:06 subgid
-rw-r--r--. 1 root root 0 6月 23 2020 subgid-
-rw-r--r--. 1 root root 15 3月 18 10:06 subuid
-rw-r--r--. 1 root root 0 6月 23 2020 subuid-
-rw-r-----. 1 root root 3983 1月 19 2023 sudo.conf
-r--r-----. 1 root root 4328 1月 19 2023 sudoers
drwxr-x---. 2 root root 6 1月 19 2023 sudoers.d
-rw-r-----. 1 root root 3181 1月 19 2023 sudo-ldap.conf
drwxr-xr-x. 3 root root 24 3月 18 09:50 swid
drwxr-xr-x. 3 root root 4096 3月 18 10:06 sysconfig
-rw-r--r--. 1 root root 449 8月 22 2023 sysctl.conf
drwxr-xr-x. 2 root root 28 3月 18 09:52 sysctl.d
drwxr-xr-x. 4 root root 166 3月 18 09:52 systemd
lrwxrwxrwx. 1 root root 14 9月 27 15:56 system-release -> redhat-release
-rw-r--r--. 1 root root 41 9月 27 15:56 system-release-cpe
drwxr-xr-x. 2 root root 6 8月 21 2023 terminfo
drwxr-xr-x. 2 root root 22 3月 18 09:54 tmpfiles.d
drwxr-xr-x. 3 root root 51 3月 18 09:51 tpm2-tss
-rw-r--r--. 1 root root 375 9月 20 19:35 trusted-key.key
drwxr-xr-x. 3 root root 136 3月 18 09:56 tuned
drwxr-xr-x. 4 root root 68 3月 18 10:08 udev
drwxr-xr-x. 2 root root 60 3月 18 09:54 udisks2
-rw-r--r--. 1 root root 624 8月 10 2021 updatedb.conf
drwxr-xr-x. 2 root root 25 3月 18 09:52 UPower
-rw-r--r--. 1 root root 1523 8月 11 2021 usb_modeswitch.conf
-rw-r--r--. 1 root root 28 3月 18 10:06 vconsole.conf
-rw-r--r--. 1 root root 4017 2月 10 2023 vimrc
-rw-r--r--. 1 root root 1184 2月 10 2023 virc
drwxr-xr-x. 4 root root 4096 3月 18 09:55 vmware-tools
drwxr-xr-x. 5 root root 67 3月 18 09:50 vulkan
-rw-r--r--. 1 root root 4925 11月 3 2021 wgetrc
drwxr-xr-x. 6 root root 81 3月 18 09:52 wireplumber
drwxr-xr-x. 2 root root 33 3月 18 09:52 wpa_supplicant
drwxr-xr-x. 7 root root 121 3月 18 09:54 X11
-rw-r--r--. 1 root root 817 8月 10 2021 xattr.conf
drwxr-xr-x. 6 root root 125 3月 18 09:51 xdg
drwxr-xr-x. 3 root root 36 3月 18 09:51 xml
drwxr-xr-x. 2 root root 57 3月 18 09:56 yum
lrwxrwxrwx. 1 root root 12 6月 29 2023 yum.conf -> dnf/dnf.conf
drwxr-xr-x. 2 root root 25 3月 18 11:33 yum.repos.d
[root@text1 etc]#
(4)stat 显示文件或者文件系统状态信息
root@text1 etc]# stat /etc/passwd
文件:/etc/passwd
大小:2091 块:8 IO 块:4096 普通文件
设备:fd00h/64768d Inode:34704798 硬链接:1
权限:(0644/-rw-r--r--) Uid:( 0/ root) Gid:( 0/ root)
环境:system_u:object_r:passwd_file_t:s0
最近访问:2024-03-19 19:05:40.421000084 +0800
最近更改:2024-03-18 10:06:12.175067937 +0800
最近改动:2024-03-18 10:06:12.175067937 +0800
创建时间:2024-03-18 10:06:12.174067927 +0800
[root@text1 etc]#
文件目录操作类命令
(1)touch 创建文件或者修改文件存储时间
touch [选项] 目录或者文件名
[root@text1 etc]# touch -d 20200626 /mnt/*
[root@text1 etc]# ls -l
总用量 1312
drwxr-xr-x. 3 root root 28 3月 18 09:51 accountsservice
-rw-r--r--. 1 root root 16 3月 18 10:06 adjtime
-rw-r--r--. 1 root root 1529 6月 23 2020 aliases
drwxr-xr-x. 3 root root 65 3月 18 09:56 alsa
drwxr-xr-x. 2 root root 4096 3月 18 09:56 alternatives
-rw-r--r--. 1 root root 541 7月 11 2022 anacrontab
-rw-r--r--. 1 root root 833 2月 11 2023 appstream.conf
-rw-r--r--. 1 root root 55 5月 15 2023 asound.conf
-rw-r--r--. 1 root root 1 4月 4 2022 at.deny
drwxr-x---. 4 root root 100 3月 18 09:53 audit
drwxr-xr-x. 3 root root 4096 3月 18 10:06 authselect
drwxr-xr-x. 4 root root 71 3月 18 09:51 avahi
drwxr-xr-x. 2 root root 124 3月 18 09:56 bash_completion.d
-rw-r--r--. 1 root root 2658 12月 21 2022 bashrc
-rw-r--r--. 1 root root 535 6月 6 2023 bindresvport.blacklist
drwxr-xr-x. 2 root root 6 8月 22 2023 binfmt.d
drwxr-xr-x. 2 root root 23 3月 18 09:51 bluetooth
-rw-r-----. 1 root brlapi 33 3月 18 09:54 brlapi.key
drwxr-xr-x. 7 root root 84 3月 18 09:54 brltty
-rw-r--r--. 1 root root 28974 8月 10 2021 brltty.conf
drwxr-xr-x. 3 root root 36 3月 18 09:55 chromium
-rw-r--r--. 1 root root 1369 8月 29 2022 chrony.conf
-rw-r-----. 1 root chrony 540 8月 29 2022 chrony.keys
drwxr-xr-x. 2 root root 26 3月 18 09:52 cifs-utils
drwxr-xr-x. 2 root root 6 3月 18 09:54 cni
drwxr-xr-x. 4 root root 66 3月 18 09:55 cockpit
drwxr-xr-x. 7 root root 154 3月 18 09:54 containers
drwxr-xr-x. 2 root root 21 3月 18 09:51 cron.d
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.daily
-rw-r--r--. 1 root root 0 7月 11 2022 cron.deny
drwxr-xr-x. 2 root root 22 3月 23 2022 cron.hourly
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.monthly
-rw-r--r--. 1 root root 451 3月 23 2022 crontab
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.weekly
drwxr-xr-x. 6 root root 81 3月 18 09:49 crypto-policies
-rw-------. 1 root root 0 3月 18 09:48 crypttab
-rw-r--r--. 1 root root 1401 12月 21 2022 csh.cshrc
-rw-r--r--. 1 root root 1087 12月 21 2022 csh.login
drwxr-xr-x. 4 root lp 4096 3月 19 19:06 cups
drwxr-xr-x. 2 root root 34 3月 18 09:54 cupshelpers
drwxr-xr-x. 4 root root 78 3月 18 09:51 dbus-1
drwxr-xr-x. 4 root root 31 3月 18 09:51 dconf
drwxr-xr-x. 2 root root 33 3月 18 10:05 default
drwxr-xr-x. 2 root root 40 3月 18 09:52 depmod.d
drwxr-xr-x. 3 root root 24 3月 18 09:56 dhcp
-rw-r--r--. 1 root root 4673 1月 6 2023 DIR_COLORS
-rw-r--r--. 1 root root 4755 1月 6 2023 DIR_COLORS.lightbgcolor
drwxr-xr-x. 8 root root 128 3月 18 09:49 dnf
-rw-r--r--. 1 root dnsmasq 27839 7月 28 2023 dnsmasq.conf
drwxr-xr-x. 2 root dnsmasq 6 7月 28 2023 dnsmasq.d
-rw-r--r--. 1 root root 117 8月 23 2023 dracut.conf
drwxr-xr-x. 2 root root 6 8月 23 2023 dracut.conf.d
drwxr-xr-x. 3 root root 37 3月 18 09:50 egl
-rw-r--r--. 1 root root 4760 8月 10 2021 enscript.cfg
-rw-r--r--. 1 root root 0 12月 21 2022 environment
-rw-r--r--. 1 root root 1362 6月 23 2020 ethertypes
-rw-r--r--. 1 root root 0 6月 23 2020 exports
lrwxrwxrwx. 1 root root 56 5月 16 2023 favicon.png -> /usr/share/icons/hicolor/16x16/apps/fedora-logo-icon.png
-rw-r--r--. 1 root root 66 6月 23 2020 filesystems
drwxr-xr-x. 3 root root 18 3月 18 09:56 firefox
drwxr-x---. 8 root root 149 3月 18 09:56 firewalld
drwxr-xr-x. 3 root root 23 3月 18 09:53 flatpak
drwxr-xr-x. 3 root root 38 3月 18 09:51 fonts
drwxr-xr-x. 2 root root 28 3月 18 09:54 foomatic
-rw-r--r--. 1 root root 20 8月 20 2021 fprintd.conf
-rw-r--r--. 1 root root 666 3月 18 09:48 fstab
-rw-r--r--. 1 root root 38 8月 10 2023 fuse.conf
drwxr-xr-x. 4 root root 150 3月 18 09:54 fwupd
drwxr-xr-x. 2 root root 6 3月 24 2023 gcrypt
drwxr-xr-x. 6 root root 107 3月 18 09:54 gdm
drwxr-xr-x. 2 root root 26 3月 18 09:52 geoclue
drwxr-xr-x. 3 root root 26 3月 18 09:50 glvnd
drwxr-xr-x. 2 root root 6 4月 26 2023 gnupg
-rw-r--r--. 1 root root 94 8月 10 2021 GREP_COLORS
drwxr-xr-x. 4 root root 40 3月 18 09:50 groff
-rw-r--r--. 1 root root 809 3月 18 10:06 group
-rw-r--r--. 1 root root 798 3月 18 09:56 group-
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2-efi.cfg -> ../boot/grub2/grub.cfg
drwx------. 2 root root 4096 3月 18 10:04 grub.d
----------. 1 root root 650 3月 18 10:06 gshadow
----------. 1 root root 643 3月 18 09:56 gshadow-
drwxr-xr-x. 3 root root 20 3月 18 09:51 gss
-rw-r--r--. 1 root root 9 6月 23 2020 host.conf
-rw-r--r--. 1 root root 6 3月 18 11:31 hostname
-rw-r--r--. 1 root root 158 6月 23 2020 hosts
drwxr-xr-x. 2 root root 24 3月 18 09:50 hp
-rw-r--r--. 1 root root 490 8月 22 2023 inittab
-rw-r--r--. 1 root root 943 6月 23 2020 inputrc
drwxr-xr-x. 2 root root 4096 3月 18 09:54 insights-client
drwxr-xr-x. 2 root root 159 3月 18 09:51 iproute2
drwxr-xr-x. 2 root root 25 3月 18 09:51 iscsi
-rw-r--r--. 1 root root 23 9月 27 15:56 issue
drwxr-xr-x. 2 root root 27 3月 18 09:55 issue.d
-rw-r--r--. 1 root root 22 9月 27 15:56 issue.net
drwxr-xr-x. 4 root root 33 3月 18 09:52 kdump
-rw-r--r--. 1 root root 8979 3月 18 09:52 kdump.conf
drwxr-xr-x. 3 root root 38 3月 18 09:57 kernel
-rw-r--r--. 1 root root 880 8月 9 2023 krb5.conf
drwxr-xr-x. 2 root root 83 3月 18 09:56 krb5.conf.d
-rw-r--r--. 1 root root 39307 3月 18 10:08 ld.so.cache
-rw-r--r--. 1 root root 28 8月 2 2021 ld.so.conf
drwxr-xr-x. 2 root root 39 3月 18 09:56 ld.so.conf.d
-rw-r-----. 1 root root 191 1月 24 2022 libaudit.conf
drwxr-xr-x. 3 root root 20 3月 18 09:52 libblockdev
drwxr-xr-x. 2 root root 4096 3月 18 09:50 libibverbs.d
drwxr-xr-x. 2 root root 35 3月 18 09:50 libnl
drwxr-xr-x. 2 root root 6 8月 10 2021 libpaper.d
drwxr-xr-x. 6 root root 70 3月 18 09:49 libreport
drwxr-xr-x. 2 root root 62 3月 18 09:51 libssh
-rw-r--r--. 1 root root 2391 3月 1 2021 libuser.conf
-rw-r--r--. 1 root root 19 3月 18 10:06 locale.conf
lrwxrwxrwx. 1 root root 35 3月 18 10:06 localtime -> ../usr/share/zoneinfo/Asia/Shanghai
-rw-r--r--. 1 root root 7778 7月 12 2023 login.defs
-rw-r--r--. 1 root root 496 6月 7 2020 logrotate.conf
drwxr-xr-x. 2 root root 4096 3月 18 09:56 logrotate.d
drwxr-xr-x. 3 root root 43 3月 18 09:53 lsm
drwxr-xr-x. 7 root root 115 3月 18 09:52 lvm
-r--r--r--. 1 root root 33 3月 18 09:51 machine-id
-rw-r--r--. 1 root root 111 7月 18 2023 magic
-rw-r--r--. 1 root root 272 4月 22 2020 mailcap
-rw-r--r--. 1 root root 5122 7月 4 2023 makedumpfile.conf.sample
-rw-r--r--. 1 root root 5235 9月 21 2022 man_db.conf
drwxr-xr-x. 3 root root 41 3月 18 09:56 mcelog
drwxr-xr-x. 3 root root 32 3月 18 09:56 microcode_ctl
-rw-r--r--. 1 root root 67454 4月 22 2020 mime.types
-rw-r--r--. 1 root root 1208 6月 8 2022 mke2fs.conf
drwxr-xr-x. 2 root root 54 3月 18 09:56 modprobe.d
drwxr-xr-x. 2 root root 6 8月 22 2023 modules-load.d
-rw-r--r--. 1 root root 0 6月 23 2020 motd
drwxr-xr-x. 2 root root 44 3月 18 09:55 motd.d
lrwxrwxrwx. 1 root root 19 3月 18 09:51 mtab -> ../proc/self/mounts
drwxr-xr-x. 2 root root 6 8月 2 2023 multipath
-rw-r--r--. 1 root root 10373 8月 10 2021 nanorc
-rw-r--r--. 1 root root 767 6月 6 2023 netconfig
drwxr-xr-x. 7 root root 134 3月 18 09:52 NetworkManager
-rw-r--r--. 1 root root 58 6月 23 2020 networks
drwx------. 3 root root 66 3月 18 09:51 nftables
lrwxrwxrwx. 1 root root 29 3月 18 10:06 nsswitch.conf -> /etc/authselect/nsswitch.conf
-rw-r--r--. 1 root root 2108 9月 25 15:47 nsswitch.conf.bak
drwxr-xr-x. 2 root root 57 3月 18 09:55 nvme
drwxr-xr-x. 3 root root 36 3月 18 09:51 openldap
drwxr-xr-x. 3 root root 20 3月 18 09:55 opt
lrwxrwxrwx. 1 root root 21 9月 27 15:56 os-release -> ../usr/lib/os-release
drwxr-xr-x. 3 root root 23 3月 18 09:51 ostree
drwxr-xr-x. 2 root root 76 3月 18 09:56 PackageKit
drwxr-xr-x. 2 root root 4096 3月 18 10:06 pam.d
-rw-r--r--. 1 root root 68 8月 10 2021 papersize
-rw-r--r--. 1 root root 2091 3月 18 10:06 passwd
-rw-r--r--. 1 root root 2057 3月 18 09:56 passwd-
-rw-r--r--. 1 root root 1362 8月 11 2021 pbm2ppa.conf
-rw-r--r--. 1 root root 2872 8月 11 2021 pinforc
drwxr-xr-x. 3 root root 21 3月 18 09:50 pkcs11
drwxr-xr-x. 3 root root 27 3月 18 09:51 pkgconfig
drwxr-xr-x. 15 root root 4096 3月 18 10:09 pki
drwxr-xr-x. 2 root root 28 3月 18 09:52 plymouth
drwxr-xr-x. 5 root root 52 3月 18 09:50 pm
-rw-r--r--. 1 root root 6300 8月 11 2021 pnm2ppa.conf
drwxr-xr-x. 5 root root 72 3月 18 09:51 polkit-1
drwxr-xr-x. 2 root root 6 8月 11 2021 popt.d
-rw-r--r--. 1 root root 233 6月 23 2020 printcap
-rw-r--r--. 1 root root 1899 12月 21 2022 profile
drwxr-xr-x. 2 root root 4096 3月 18 09:56 profile.d
-rw-r--r--. 1 root root 6568 6月 23 2020 protocols
drwxr-xr-x. 2 root root 25 3月 18 09:51 pulse
drwxr-xr-x. 3 root root 50 3月 18 09:56 qemu-ga
drwxr-xr-x. 3 root root 27 3月 18 09:56 ras
drwxr-xr-x. 3 root root 36 3月 18 09:51 rc.d
lrwxrwxrwx. 1 root root 13 8月 22 2023 rc.local -> rc.d/rc.local
-rw-r--r--. 1 root root 44 9月 27 15:56 redhat-release
-rw-r--r--. 1 root root 74 3月 19 19:05 resolv.conf
drwxr-xr-x. 3 root root 40 3月 18 09:56 rhc
drwxr-xr-x. 6 root root 84 3月 18 09:54 rhsm
-rw-r--r--. 1 root root 1634 8月 2 2021 rpc
drwxr-xr-x. 2 root root 6 6月 30 2023 rpm
-rw-r--r--. 1 root root 458 11月 2 2022 rsyncd.conf
-rw-r--r--. 1 root root 3303 7月 31 2023 rsyslog.conf
drwxr-xr-x. 2 root root 6 7月 31 2023 rsyslog.d
drwxr-xr-x. 2 root root 35 3月 18 09:52 rwtab.d
drwxr-xr-x. 2 root root 61 3月 18 09:51 samba
drwxr-xr-x. 3 root root 4096 3月 18 09:52 sane.d
drwxr-xr-x. 2 root root 6 9月 13 2022 sasl2
drwxr-xr-x. 7 root root 4096 3月 18 09:51 security
drwxr-xr-x. 3 root root 57 3月 18 09:51 selinux
-rw-r--r--. 1 root root 692252 6月 23 2020 services
-rw-r--r--. 1 root root 216 6月 27 2023 sestatus.conf
drwxr-xr-x. 2 root root 33 3月 18 09:53 setroubleshoot
drwxr-xr-x. 3 root root 21 3月 18 09:50 sgml
----------. 1 root root 1133 3月 18 10:12 shadow
----------. 1 root root 1134 3月 18 10:06 shadow-
-rw-r--r--. 1 root root 44 6月 23 2020 shells
drwxr-xr-x. 3 root root 78 3月 18 09:50 skel
drwxr-xr-x. 3 root root 74 3月 18 09:56 smartmontools
drwxr-xr-x. 6 root root 86 3月 18 09:54 sos
drwxr-xr-x. 4 root root 56 3月 18 09:52 speech-dispatcher
drwxr-xr-x. 4 root root 4096 3月 18 10:16 ssh
drwxr-xr-x. 2 root root 77 3月 18 09:51 ssl
drwx------. 4 sssd sssd 31 3月 18 09:52 sssd
drwxr-xr-x. 2 root root 6 8月 10 2021 statetab.d
-rw-r--r--. 1 root root 15 3月 18 10:06 subgid
-rw-r--r--. 1 root root 0 6月 23 2020 subgid-
-rw-r--r--. 1 root root 15 3月 18 10:06 subuid
-rw-r--r--. 1 root root 0 6月 23 2020 subuid-
-rw-r-----. 1 root root 3983 1月 19 2023 sudo.conf
-r--r-----. 1 root root 4328 1月 19 2023 sudoers
drwxr-x---. 2 root root 6 1月 19 2023 sudoers.d
-rw-r-----. 1 root root 3181 1月 19 2023 sudo-ldap.conf
drwxr-xr-x. 3 root root 24 3月 18 09:50 swid
drwxr-xr-x. 3 root root 4096 3月 18 10:06 sysconfig
-rw-r--r--. 1 root root 449 8月 22 2023 sysctl.conf
drwxr-xr-x. 2 root root 28 3月 18 09:52 sysctl.d
drwxr-xr-x. 4 root root 166 3月 18 09:52 systemd
lrwxrwxrwx. 1 root root 14 9月 27 15:56 system-release -> redhat-release
-rw-r--r--. 1 root root 41 9月 27 15:56 system-release-cpe
drwxr-xr-x. 2 root root 6 8月 21 2023 terminfo
drwxr-xr-x. 2 root root 22 3月 18 09:54 tmpfiles.d
drwxr-xr-x. 3 root root 51 3月 18 09:51 tpm2-tss
-rw-r--r--. 1 root root 375 9月 20 19:35 trusted-key.key
drwxr-xr-x. 3 root root 136 3月 18 09:56 tuned
drwxr-xr-x. 4 root root 68 3月 18 10:08 udev
drwxr-xr-x. 2 root root 60 3月 18 09:54 udisks2
-rw-r--r--. 1 root root 624 8月 10 2021 updatedb.conf
drwxr-xr-x. 2 root root 25 3月 18 09:52 UPower
-rw-r--r--. 1 root root 1523 8月 11 2021 usb_modeswitch.conf
-rw-r--r--. 1 root root 28 3月 18 10:06 vconsole.conf
-rw-r--r--. 1 root root 4017 2月 10 2023 vimrc
-rw-r--r--. 1 root root 1184 2月 10 2023 virc
drwxr-xr-x. 4 root root 4096 3月 18 09:55 vmware-tools
drwxr-xr-x. 5 root root 67 3月 18 09:50 vulkan
-rw-r--r--. 1 root root 4925 11月 3 2021 wgetrc
drwxr-xr-x. 6 root root 81 3月 18 09:52 wireplumber
drwxr-xr-x. 2 root root 33 3月 18 09:52 wpa_supplicant
drwxr-xr-x. 7 root root 121 3月 18 09:54 X11
-rw-r--r--. 1 root root 817 8月 10 2021 xattr.conf
drwxr-xr-x. 6 root root 125 3月 18 09:51 xdg
drwxr-xr-x. 3 root root 36 3月 18 09:51 xml
drwxr-xr-x. 2 root root 57 3月 18 09:56 yum
lrwxrwxrwx. 1 root root 12 6月 29 2023 yum.conf -> dnf/dnf.conf
drwxr-xr-x. 2 root root 25 3月 18 11:33 yum.repos.d
[root@text1 etc]#
(2) mkdir 创建新目录
mkdir [选项] 目录
[root@text1 etc]# mkdir user01
[root@text1 etc]# ls -l
总用量 1312
drwxr-xr-x. 3 root root 28 3月 18 09:51 accountsservice
-rw-r--r--. 1 root root 16 3月 18 10:06 adjtime
-rw-r--r--. 1 root root 1529 6月 23 2020 aliases
drwxr-xr-x. 3 root root 65 3月 18 09:56 alsa
drwxr-xr-x. 2 root root 4096 3月 18 09:56 alternatives
-rw-r--r--. 1 root root 541 7月 11 2022 anacrontab
-rw-r--r--. 1 root root 833 2月 11 2023 appstream.conf
-rw-r--r--. 1 root root 55 5月 15 2023 asound.conf
-rw-r--r--. 1 root root 1 4月 4 2022 at.deny
drwxr-x---. 4 root root 100 3月 18 09:53 audit
drwxr-xr-x. 3 root root 4096 3月 18 10:06 authselect
drwxr-xr-x. 4 root root 71 3月 18 09:51 avahi
drwxr-xr-x. 2 root root 124 3月 18 09:56 bash_completion.d
-rw-r--r--. 1 root root 2658 12月 21 2022 bashrc
-rw-r--r--. 1 root root 535 6月 6 2023 bindresvport.blacklist
drwxr-xr-x. 2 root root 6 8月 22 2023 binfmt.d
drwxr-xr-x. 2 root root 23 3月 18 09:51 bluetooth
-rw-r-----. 1 root brlapi 33 3月 18 09:54 brlapi.key
drwxr-xr-x. 7 root root 84 3月 18 09:54 brltty
-rw-r--r--. 1 root root 28974 8月 10 2021 brltty.conf
drwxr-xr-x. 3 root root 36 3月 18 09:55 chromium
-rw-r--r--. 1 root root 1369 8月 29 2022 chrony.conf
-rw-r-----. 1 root chrony 540 8月 29 2022 chrony.keys
drwxr-xr-x. 2 root root 26 3月 18 09:52 cifs-utils
drwxr-xr-x. 2 root root 6 3月 18 09:54 cni
drwxr-xr-x. 4 root root 66 3月 18 09:55 cockpit
drwxr-xr-x. 7 root root 154 3月 18 09:54 containers
drwxr-xr-x. 2 root root 21 3月 18 09:51 cron.d
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.daily
-rw-r--r--. 1 root root 0 7月 11 2022 cron.deny
drwxr-xr-x. 2 root root 22 3月 23 2022 cron.hourly
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.monthly
-rw-r--r--. 1 root root 451 3月 23 2022 crontab
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.weekly
drwxr-xr-x. 6 root root 81 3月 18 09:49 crypto-policies
-rw-------. 1 root root 0 3月 18 09:48 crypttab
-rw-r--r--. 1 root root 1401 12月 21 2022 csh.cshrc
-rw-r--r--. 1 root root 1087 12月 21 2022 csh.login
drwxr-xr-x. 4 root lp 4096 3月 19 19:06 cups
drwxr-xr-x. 2 root root 34 3月 18 09:54 cupshelpers
drwxr-xr-x. 4 root root 78 3月 18 09:51 dbus-1
drwxr-xr-x. 4 root root 31 3月 18 09:51 dconf
drwxr-xr-x. 2 root root 33 3月 18 10:05 default
drwxr-xr-x. 2 root root 40 3月 18 09:52 depmod.d
drwxr-xr-x. 3 root root 24 3月 18 09:56 dhcp
-rw-r--r--. 1 root root 4673 1月 6 2023 DIR_COLORS
-rw-r--r--. 1 root root 4755 1月 6 2023 DIR_COLORS.lightbgcolor
drwxr-xr-x. 8 root root 128 3月 18 09:49 dnf
-rw-r--r--. 1 root dnsmasq 27839 7月 28 2023 dnsmasq.conf
drwxr-xr-x. 2 root dnsmasq 6 7月 28 2023 dnsmasq.d
-rw-r--r--. 1 root root 117 8月 23 2023 dracut.conf
drwxr-xr-x. 2 root root 6 8月 23 2023 dracut.conf.d
drwxr-xr-x. 3 root root 37 3月 18 09:50 egl
-rw-r--r--. 1 root root 4760 8月 10 2021 enscript.cfg
-rw-r--r--. 1 root root 0 12月 21 2022 environment
-rw-r--r--. 1 root root 1362 6月 23 2020 ethertypes
-rw-r--r--. 1 root root 0 6月 23 2020 exports
lrwxrwxrwx. 1 root root 56 5月 16 2023 favicon.png -> /usr/share/icons/hicolor/16x16/apps/fedora-logo-icon.png
-rw-r--r--. 1 root root 66 6月 23 2020 filesystems
drwxr-xr-x. 3 root root 18 3月 18 09:56 firefox
drwxr-x---. 8 root root 149 3月 18 09:56 firewalld
drwxr-xr-x. 3 root root 23 3月 18 09:53 flatpak
drwxr-xr-x. 3 root root 38 3月 18 09:51 fonts
drwxr-xr-x. 2 root root 28 3月 18 09:54 foomatic
-rw-r--r--. 1 root root 20 8月 20 2021 fprintd.conf
-rw-r--r--. 1 root root 666 3月 18 09:48 fstab
-rw-r--r--. 1 root root 38 8月 10 2023 fuse.conf
drwxr-xr-x. 4 root root 150 3月 18 09:54 fwupd
drwxr-xr-x. 2 root root 6 3月 24 2023 gcrypt
drwxr-xr-x. 6 root root 107 3月 18 09:54 gdm
drwxr-xr-x. 2 root root 26 3月 18 09:52 geoclue
drwxr-xr-x. 3 root root 26 3月 18 09:50 glvnd
drwxr-xr-x. 2 root root 6 4月 26 2023 gnupg
-rw-r--r--. 1 root root 94 8月 10 2021 GREP_COLORS
drwxr-xr-x. 4 root root 40 3月 18 09:50 groff
-rw-r--r--. 1 root root 809 3月 18 10:06 group
-rw-r--r--. 1 root root 798 3月 18 09:56 group-
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2-efi.cfg -> ../boot/grub2/grub.cfg
drwx------. 2 root root 4096 3月 18 10:04 grub.d
----------. 1 root root 650 3月 18 10:06 gshadow
----------. 1 root root 643 3月 18 09:56 gshadow-
drwxr-xr-x. 3 root root 20 3月 18 09:51 gss
-rw-r--r--. 1 root root 9 6月 23 2020 host.conf
-rw-r--r--. 1 root root 6 3月 18 11:31 hostname
-rw-r--r--. 1 root root 158 6月 23 2020 hosts
drwxr-xr-x. 2 root root 24 3月 18 09:50 hp
-rw-r--r--. 1 root root 490 8月 22 2023 inittab
-rw-r--r--. 1 root root 943 6月 23 2020 inputrc
drwxr-xr-x. 2 root root 4096 3月 18 09:54 insights-client
drwxr-xr-x. 2 root root 159 3月 18 09:51 iproute2
drwxr-xr-x. 2 root root 25 3月 18 09:51 iscsi
-rw-r--r--. 1 root root 23 9月 27 15:56 issue
drwxr-xr-x. 2 root root 27 3月 18 09:55 issue.d
-rw-r--r--. 1 root root 22 9月 27 15:56 issue.net
drwxr-xr-x. 4 root root 33 3月 18 09:52 kdump
-rw-r--r--. 1 root root 8979 3月 18 09:52 kdump.conf
drwxr-xr-x. 3 root root 38 3月 18 09:57 kernel
-rw-r--r--. 1 root root 880 8月 9 2023 krb5.conf
drwxr-xr-x. 2 root root 83 3月 18 09:56 krb5.conf.d
-rw-r--r--. 1 root root 39307 3月 18 10:08 ld.so.cache
-rw-r--r--. 1 root root 28 8月 2 2021 ld.so.conf
drwxr-xr-x. 2 root root 39 3月 18 09:56 ld.so.conf.d
-rw-r-----. 1 root root 191 1月 24 2022 libaudit.conf
drwxr-xr-x. 3 root root 20 3月 18 09:52 libblockdev
drwxr-xr-x. 2 root root 4096 3月 18 09:50 libibverbs.d
drwxr-xr-x. 2 root root 35 3月 18 09:50 libnl
drwxr-xr-x. 2 root root 6 8月 10 2021 libpaper.d
drwxr-xr-x. 6 root root 70 3月 18 09:49 libreport
drwxr-xr-x. 2 root root 62 3月 18 09:51 libssh
-rw-r--r--. 1 root root 2391 3月 1 2021 libuser.conf
-rw-r--r--. 1 root root 19 3月 18 10:06 locale.conf
lrwxrwxrwx. 1 root root 35 3月 18 10:06 localtime -> ../usr/share/zoneinfo/Asia/Shanghai
-rw-r--r--. 1 root root 7778 7月 12 2023 login.defs
-rw-r--r--. 1 root root 496 6月 7 2020 logrotate.conf
drwxr-xr-x. 2 root root 4096 3月 18 09:56 logrotate.d
drwxr-xr-x. 3 root root 43 3月 18 09:53 lsm
drwxr-xr-x. 7 root root 115 3月 18 09:52 lvm
-r--r--r--. 1 root root 33 3月 18 09:51 machine-id
-rw-r--r--. 1 root root 111 7月 18 2023 magic
-rw-r--r--. 1 root root 272 4月 22 2020 mailcap
-rw-r--r--. 1 root root 5122 7月 4 2023 makedumpfile.conf.sample
-rw-r--r--. 1 root root 5235 9月 21 2022 man_db.conf
drwxr-xr-x. 3 root root 41 3月 18 09:56 mcelog
drwxr-xr-x. 3 root root 32 3月 18 09:56 microcode_ctl
-rw-r--r--. 1 root root 67454 4月 22 2020 mime.types
-rw-r--r--. 1 root root 1208 6月 8 2022 mke2fs.conf
drwxr-xr-x. 2 root root 54 3月 18 09:56 modprobe.d
drwxr-xr-x. 2 root root 6 8月 22 2023 modules-load.d
-rw-r--r--. 1 root root 0 6月 23 2020 motd
drwxr-xr-x. 2 root root 44 3月 18 09:55 motd.d
lrwxrwxrwx. 1 root root 19 3月 18 09:51 mtab -> ../proc/self/mounts
drwxr-xr-x. 2 root root 6 8月 2 2023 multipath
-rw-r--r--. 1 root root 10373 8月 10 2021 nanorc
-rw-r--r--. 1 root root 767 6月 6 2023 netconfig
drwxr-xr-x. 7 root root 134 3月 18 09:52 NetworkManager
-rw-r--r--. 1 root root 58 6月 23 2020 networks
drwx------. 3 root root 66 3月 18 09:51 nftables
lrwxrwxrwx. 1 root root 29 3月 18 10:06 nsswitch.conf -> /etc/authselect/nsswitch.conf
-rw-r--r--. 1 root root 2108 9月 25 15:47 nsswitch.conf.bak
drwxr-xr-x. 2 root root 57 3月 18 09:55 nvme
drwxr-xr-x. 3 root root 36 3月 18 09:51 openldap
drwxr-xr-x. 3 root root 20 3月 18 09:55 opt
lrwxrwxrwx. 1 root root 21 9月 27 15:56 os-release -> ../usr/lib/os-release
drwxr-xr-x. 3 root root 23 3月 18 09:51 ostree
drwxr-xr-x. 2 root root 76 3月 18 09:56 PackageKit
drwxr-xr-x. 2 root root 4096 3月 18 10:06 pam.d
-rw-r--r--. 1 root root 68 8月 10 2021 papersize
-rw-r--r--. 1 root root 2091 3月 18 10:06 passwd
-rw-r--r--. 1 root root 2057 3月 18 09:56 passwd-
-rw-r--r--. 1 root root 1362 8月 11 2021 pbm2ppa.conf
-rw-r--r--. 1 root root 2872 8月 11 2021 pinforc
drwxr-xr-x. 3 root root 21 3月 18 09:50 pkcs11
drwxr-xr-x. 3 root root 27 3月 18 09:51 pkgconfig
drwxr-xr-x. 15 root root 4096 3月 18 10:09 pki
drwxr-xr-x. 2 root root 28 3月 18 09:52 plymouth
drwxr-xr-x. 5 root root 52 3月 18 09:50 pm
-rw-r--r--. 1 root root 6300 8月 11 2021 pnm2ppa.conf
drwxr-xr-x. 5 root root 72 3月 18 09:51 polkit-1
drwxr-xr-x. 2 root root 6 8月 11 2021 popt.d
-rw-r--r--. 1 root root 233 6月 23 2020 printcap
-rw-r--r--. 1 root root 1899 12月 21 2022 profile
drwxr-xr-x. 2 root root 4096 3月 18 09:56 profile.d
-rw-r--r--. 1 root root 6568 6月 23 2020 protocols
drwxr-xr-x. 2 root root 25 3月 18 09:51 pulse
drwxr-xr-x. 3 root root 50 3月 18 09:56 qemu-ga
drwxr-xr-x. 3 root root 27 3月 18 09:56 ras
drwxr-xr-x. 3 root root 36 3月 18 09:51 rc.d
lrwxrwxrwx. 1 root root 13 8月 22 2023 rc.local -> rc.d/rc.local
-rw-r--r--. 1 root root 44 9月 27 15:56 redhat-release
-rw-r--r--. 1 root root 74 3月 19 19:05 resolv.conf
drwxr-xr-x. 3 root root 40 3月 18 09:56 rhc
drwxr-xr-x. 6 root root 84 3月 18 09:54 rhsm
-rw-r--r--. 1 root root 1634 8月 2 2021 rpc
drwxr-xr-x. 2 root root 6 6月 30 2023 rpm
-rw-r--r--. 1 root root 458 11月 2 2022 rsyncd.conf
-rw-r--r--. 1 root root 3303 7月 31 2023 rsyslog.conf
drwxr-xr-x. 2 root root 6 7月 31 2023 rsyslog.d
drwxr-xr-x. 2 root root 35 3月 18 09:52 rwtab.d
drwxr-xr-x. 2 root root 61 3月 18 09:51 samba
drwxr-xr-x. 3 root root 4096 3月 18 09:52 sane.d
drwxr-xr-x. 2 root root 6 9月 13 2022 sasl2
drwxr-xr-x. 7 root root 4096 3月 18 09:51 security
drwxr-xr-x. 3 root root 57 3月 18 09:51 selinux
-rw-r--r--. 1 root root 692252 6月 23 2020 services
-rw-r--r--. 1 root root 216 6月 27 2023 sestatus.conf
drwxr-xr-x. 2 root root 33 3月 18 09:53 setroubleshoot
drwxr-xr-x. 3 root root 21 3月 18 09:50 sgml
----------. 1 root root 1133 3月 18 10:12 shadow
----------. 1 root root 1134 3月 18 10:06 shadow-
-rw-r--r--. 1 root root 44 6月 23 2020 shells
drwxr-xr-x. 3 root root 78 3月 18 09:50 skel
drwxr-xr-x. 3 root root 74 3月 18 09:56 smartmontools
drwxr-xr-x. 6 root root 86 3月 18 09:54 sos
drwxr-xr-x. 4 root root 56 3月 18 09:52 speech-dispatcher
drwxr-xr-x. 4 root root 4096 3月 18 10:16 ssh
drwxr-xr-x. 2 root root 77 3月 18 09:51 ssl
drwx------. 4 sssd sssd 31 3月 18 09:52 sssd
drwxr-xr-x. 2 root root 6 8月 10 2021 statetab.d
-rw-r--r--. 1 root root 15 3月 18 10:06 subgid
-rw-r--r--. 1 root root 0 6月 23 2020 subgid-
-rw-r--r--. 1 root root 15 3月 18 10:06 subuid
-rw-r--r--. 1 root root 0 6月 23 2020 subuid-
-rw-r-----. 1 root root 3983 1月 19 2023 sudo.conf
-r--r-----. 1 root root 4328 1月 19 2023 sudoers
drwxr-x---. 2 root root 6 1月 19 2023 sudoers.d
-rw-r-----. 1 root root 3181 1月 19 2023 sudo-ldap.conf
drwxr-xr-x. 3 root root 24 3月 18 09:50 swid
drwxr-xr-x. 3 root root 4096 3月 18 10:06 sysconfig
-rw-r--r--. 1 root root 449 8月 22 2023 sysctl.conf
drwxr-xr-x. 2 root root 28 3月 18 09:52 sysctl.d
drwxr-xr-x. 4 root root 166 3月 18 09:52 systemd
lrwxrwxrwx. 1 root root 14 9月 27 15:56 system-release -> redhat-release
-rw-r--r--. 1 root root 41 9月 27 15:56 system-release-cpe
drwxr-xr-x. 2 root root 6 8月 21 2023 terminfo
drwxr-xr-x. 2 root root 22 3月 18 09:54 tmpfiles.d
drwxr-xr-x. 3 root root 51 3月 18 09:51 tpm2-tss
-rw-r--r--. 1 root root 375 9月 20 19:35 trusted-key.key
drwxr-xr-x. 3 root root 136 3月 18 09:56 tuned
drwxr-xr-x. 4 root root 68 3月 18 10:08 udev
drwxr-xr-x. 2 root root 60 3月 18 09:54 udisks2
-rw-r--r--. 1 root root 624 8月 10 2021 updatedb.conf
drwxr-xr-x. 2 root root 25 3月 18 09:52 UPower
-rw-r--r--. 1 root root 1523 8月 11 2021 usb_modeswitch.conf
drwxr-xr-x. 2 root root 6 3月 19 19:32 user01
-rw-r--r--. 1 root root 28 3月 18 10:06 vconsole.conf
-rw-r--r--. 1 root root 4017 2月 10 2023 vimrc
-rw-r--r--. 1 root root 1184 2月 10 2023 virc
drwxr-xr-x. 4 root root 4096 3月 18 09:55 vmware-tools
drwxr-xr-x. 5 root root 67 3月 18 09:50 vulkan
-rw-r--r--. 1 root root 4925 11月 3 2021 wgetrc
drwxr-xr-x. 6 root root 81 3月 18 09:52 wireplumber
drwxr-xr-x. 2 root root 33 3月 18 09:52 wpa_supplicant
drwxr-xr-x. 7 root root 121 3月 18 09:54 X11
-rw-r--r--. 1 root root 817 8月 10 2021 xattr.conf
drwxr-xr-x. 6 root root 125 3月 18 09:51 xdg
drwxr-xr-x. 3 root root 36 3月 18 09:51 xml
drwxr-xr-x. 2 root root 57 3月 18 09:56 yum
lrwxrwxrwx. 1 root root 12 6月 29 2023 yum.conf -> dnf/dnf.conf
drwxr-xr-x. 2 root root 25 3月 18 11:33 yum.repos.d
[root@text1 etc]# mkdir -v user02
mkdir: 已创建目录 'user02'
[root@text1 etc]# ls -l
总用量 1312
drwxr-xr-x. 3 root root 28 3月 18 09:51 accountsservice
-rw-r--r--. 1 root root 16 3月 18 10:06 adjtime
-rw-r--r--. 1 root root 1529 6月 23 2020 aliases
drwxr-xr-x. 3 root root 65 3月 18 09:56 alsa
drwxr-xr-x. 2 root root 4096 3月 18 09:56 alternatives
-rw-r--r--. 1 root root 541 7月 11 2022 anacrontab
-rw-r--r--. 1 root root 833 2月 11 2023 appstream.conf
-rw-r--r--. 1 root root 55 5月 15 2023 asound.conf
-rw-r--r--. 1 root root 1 4月 4 2022 at.deny
drwxr-x---. 4 root root 100 3月 18 09:53 audit
drwxr-xr-x. 3 root root 4096 3月 18 10:06 authselect
drwxr-xr-x. 4 root root 71 3月 18 09:51 avahi
drwxr-xr-x. 2 root root 124 3月 18 09:56 bash_completion.d
-rw-r--r--. 1 root root 2658 12月 21 2022 bashrc
-rw-r--r--. 1 root root 535 6月 6 2023 bindresvport.blacklist
drwxr-xr-x. 2 root root 6 8月 22 2023 binfmt.d
drwxr-xr-x. 2 root root 23 3月 18 09:51 bluetooth
-rw-r-----. 1 root brlapi 33 3月 18 09:54 brlapi.key
drwxr-xr-x. 7 root root 84 3月 18 09:54 brltty
-rw-r--r--. 1 root root 28974 8月 10 2021 brltty.conf
drwxr-xr-x. 3 root root 36 3月 18 09:55 chromium
-rw-r--r--. 1 root root 1369 8月 29 2022 chrony.conf
-rw-r-----. 1 root chrony 540 8月 29 2022 chrony.keys
drwxr-xr-x. 2 root root 26 3月 18 09:52 cifs-utils
drwxr-xr-x. 2 root root 6 3月 18 09:54 cni
drwxr-xr-x. 4 root root 66 3月 18 09:55 cockpit
drwxr-xr-x. 7 root root 154 3月 18 09:54 containers
drwxr-xr-x. 2 root root 21 3月 18 09:51 cron.d
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.daily
-rw-r--r--. 1 root root 0 7月 11 2022 cron.deny
drwxr-xr-x. 2 root root 22 3月 23 2022 cron.hourly
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.monthly
-rw-r--r--. 1 root root 451 3月 23 2022 crontab
drwxr-xr-x. 2 root root 6 3月 23 2022 cron.weekly
drwxr-xr-x. 6 root root 81 3月 18 09:49 crypto-policies
-rw-------. 1 root root 0 3月 18 09:48 crypttab
-rw-r--r--. 1 root root 1401 12月 21 2022 csh.cshrc
-rw-r--r--. 1 root root 1087 12月 21 2022 csh.login
drwxr-xr-x. 4 root lp 4096 3月 19 19:06 cups
drwxr-xr-x. 2 root root 34 3月 18 09:54 cupshelpers
drwxr-xr-x. 4 root root 78 3月 18 09:51 dbus-1
drwxr-xr-x. 4 root root 31 3月 18 09:51 dconf
drwxr-xr-x. 2 root root 33 3月 18 10:05 default
drwxr-xr-x. 2 root root 40 3月 18 09:52 depmod.d
drwxr-xr-x. 3 root root 24 3月 18 09:56 dhcp
-rw-r--r--. 1 root root 4673 1月 6 2023 DIR_COLORS
-rw-r--r--. 1 root root 4755 1月 6 2023 DIR_COLORS.lightbgcolor
drwxr-xr-x. 8 root root 128 3月 18 09:49 dnf
-rw-r--r--. 1 root dnsmasq 27839 7月 28 2023 dnsmasq.conf
drwxr-xr-x. 2 root dnsmasq 6 7月 28 2023 dnsmasq.d
-rw-r--r--. 1 root root 117 8月 23 2023 dracut.conf
drwxr-xr-x. 2 root root 6 8月 23 2023 dracut.conf.d
drwxr-xr-x. 3 root root 37 3月 18 09:50 egl
-rw-r--r--. 1 root root 4760 8月 10 2021 enscript.cfg
-rw-r--r--. 1 root root 0 12月 21 2022 environment
-rw-r--r--. 1 root root 1362 6月 23 2020 ethertypes
-rw-r--r--. 1 root root 0 6月 23 2020 exports
lrwxrwxrwx. 1 root root 56 5月 16 2023 favicon.png -> /usr/share/icons/hicolor/16x16/apps/fedora-logo-icon.png
-rw-r--r--. 1 root root 66 6月 23 2020 filesystems
drwxr-xr-x. 3 root root 18 3月 18 09:56 firefox
drwxr-x---. 8 root root 149 3月 18 09:56 firewalld
drwxr-xr-x. 3 root root 23 3月 18 09:53 flatpak
drwxr-xr-x. 3 root root 38 3月 18 09:51 fonts
drwxr-xr-x. 2 root root 28 3月 18 09:54 foomatic
-rw-r--r--. 1 root root 20 8月 20 2021 fprintd.conf
-rw-r--r--. 1 root root 666 3月 18 09:48 fstab
-rw-r--r--. 1 root root 38 8月 10 2023 fuse.conf
drwxr-xr-x. 4 root root 150 3月 18 09:54 fwupd
drwxr-xr-x. 2 root root 6 3月 24 2023 gcrypt
drwxr-xr-x. 6 root root 107 3月 18 09:54 gdm
drwxr-xr-x. 2 root root 26 3月 18 09:52 geoclue
drwxr-xr-x. 3 root root 26 3月 18 09:50 glvnd
drwxr-xr-x. 2 root root 6 4月 26 2023 gnupg
-rw-r--r--. 1 root root 94 8月 10 2021 GREP_COLORS
drwxr-xr-x. 4 root root 40 3月 18 09:50 groff
-rw-r--r--. 1 root root 809 3月 18 10:06 group
-rw-r--r--. 1 root root 798 3月 18 09:56 group-
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root 22 9月 7 2023 grub2-efi.cfg -> ../boot/grub2/grub.cfg
drwx------. 2 root root 4096 3月 18 10:04 grub.d
----------. 1 root root 650 3月 18 10:06 gshadow
----------. 1 root root 643 3月 18 09:56 gshadow-
drwxr-xr-x. 3 root root 20 3月 18 09:51 gss
-rw-r--r--. 1 root root 9 6月 23 2020 host.conf
-rw-r--r--. 1 root root 6 3月 18 11:31 hostname
-rw-r--r--. 1 root root 158 6月 23 2020 hosts
drwxr-xr-x. 2 root root 24 3月 18 09:50 hp
-rw-r--r--. 1 root root 490 8月 22 2023 inittab
-rw-r--r--. 1 root root 943 6月 23 2020 inputrc
drwxr-xr-x. 2 root root 4096 3月 18 09:54 insights-client
drwxr-xr-x. 2 root root 159 3月 18 09:51 iproute2
drwxr-xr-x. 2 root root 25 3月 18 09:51 iscsi
-rw-r--r--. 1 root root 23 9月 27 15:56 issue
drwxr-xr-x. 2 root root 27 3月 18 09:55 issue.d
-rw-r--r--. 1 root root 22 9月 27 15:56 issue.net
drwxr-xr-x. 4 root root 33 3月 18 09:52 kdump
-rw-r--r--. 1 root root 8979 3月 18 09:52 kdump.conf
drwxr-xr-x. 3 root root 38 3月 18 09:57 kernel
-rw-r--r--. 1 root root 880 8月 9 2023 krb5.conf
drwxr-xr-x. 2 root root 83 3月 18 09:56 krb5.conf.d
-rw-r--r--. 1 root root 39307 3月 18 10:08 ld.so.cache
-rw-r--r--. 1 root root 28 8月 2 2021 ld.so.conf
drwxr-xr-x. 2 root root 39 3月 18 09:56 ld.so.conf.d
-rw-r-----. 1 root root 191 1月 24 2022 libaudit.conf
drwxr-xr-x. 3 root root 20 3月 18 09:52 libblockdev
drwxr-xr-x. 2 root root 4096 3月 18 09:50 libibverbs.d
drwxr-xr-x. 2 root root 35 3月 18 09:50 libnl
drwxr-xr-x. 2 root root 6 8月 10 2021 libpaper.d
drwxr-xr-x. 6 root root 70 3月 18 09:49 libreport
drwxr-xr-x. 2 root root 62 3月 18 09:51 libssh
-rw-r--r--. 1 root root 2391 3月 1 2021 libuser.conf
-rw-r--r--. 1 root root 19 3月 18 10:06 locale.conf
lrwxrwxrwx. 1 root root 35 3月 18 10:06 localtime -> ../usr/share/zoneinfo/Asia/Shanghai
-rw-r--r--. 1 root root 7778 7月 12 2023 login.defs
-rw-r--r--. 1 root root 496 6月 7 2020 logrotate.conf
drwxr-xr-x. 2 root root 4096 3月 18 09:56 logrotate.d
drwxr-xr-x. 3 root root 43 3月 18 09:53 lsm
drwxr-xr-x. 7 root root 115 3月 18 09:52 lvm
-r--r--r--. 1 root root 33 3月 18 09:51 machine-id
-rw-r--r--. 1 root root 111 7月 18 2023 magic
-rw-r--r--. 1 root root 272 4月 22 2020 mailcap
-rw-r--r--. 1 root root 5122 7月 4 2023 makedumpfile.conf.sample
-rw-r--r--. 1 root root 5235 9月 21 2022 man_db.conf
drwxr-xr-x. 3 root root 41 3月 18 09:56 mcelog
drwxr-xr-x. 3 root root 32 3月 18 09:56 microcode_ctl
-rw-r--r--. 1 root root 67454 4月 22 2020 mime.types
-rw-r--r--. 1 root root 1208 6月 8 2022 mke2fs.conf
drwxr-xr-x. 2 root root 54 3月 18 09:56 modprobe.d
drwxr-xr-x. 2 root root 6 8月 22 2023 modules-load.d
-rw-r--r--. 1 root root 0 6月 23 2020 motd
drwxr-xr-x. 2 root root 44 3月 18 09:55 motd.d
lrwxrwxrwx. 1 root root 19 3月 18 09:51 mtab -> ../proc/self/mounts
drwxr-xr-x. 2 root root 6 8月 2 2023 multipath
-rw-r--r--. 1 root root 10373 8月 10 2021 nanorc
-rw-r--r--. 1 root root 767 6月 6 2023 netconfig
drwxr-xr-x. 7 root root 134 3月 18 09:52 NetworkManager
-rw-r--r--. 1 root root 58 6月 23 2020 networks
drwx------. 3 root root 66 3月 18 09:51 nftables
lrwxrwxrwx. 1 root root 29 3月 18 10:06 nsswitch.conf -> /etc/authselect/nsswitch.conf
-rw-r--r--. 1 root root 2108 9月 25 15:47 nsswitch.conf.bak
drwxr-xr-x. 2 root root 57 3月 18 09:55 nvme
drwxr-xr-x. 3 root root 36 3月 18 09:51 openldap
drwxr-xr-x. 3 root root 20 3月 18 09:55 opt
lrwxrwxrwx. 1 root root 21 9月 27 15:56 os-release -> ../usr/lib/os-release
drwxr-xr-x. 3 root root 23 3月 18 09:51 ostree
drwxr-xr-x. 2 root root 76 3月 18 09:56 PackageKit
drwxr-xr-x. 2 root root 4096 3月 18 10:06 pam.d
-rw-r--r--. 1 root root 68 8月 10 2021 papersize
-rw-r--r--. 1 root root 2091 3月 18 10:06 passwd
-rw-r--r--. 1 root root 2057 3月 18 09:56 passwd-
-rw-r--r--. 1 root root 1362 8月 11 2021 pbm2ppa.conf
-rw-r--r--. 1 root root 2872 8月 11 2021 pinforc
drwxr-xr-x. 3 root root 21 3月 18 09:50 pkcs11
drwxr-xr-x. 3 root root 27 3月 18 09:51 pkgconfig
drwxr-xr-x. 15 root root 4096 3月 18 10:09 pki
drwxr-xr-x. 2 root root 28 3月 18 09:52 plymouth
drwxr-xr-x. 5 root root 52 3月 18 09:50 pm
-rw-r--r--. 1 root root 6300 8月 11 2021 pnm2ppa.conf
drwxr-xr-x. 5 root root 72 3月 18 09:51 polkit-1
drwxr-xr-x. 2 root root 6 8月 11 2021 popt.d
-rw-r--r--. 1 root root 233 6月 23 2020 printcap
-rw-r--r--. 1 root root 1899 12月 21 2022 profile
drwxr-xr-x. 2 root root 4096 3月 18 09:56 profile.d
-rw-r--r--. 1 root root 6568 6月 23 2020 protocols
drwxr-xr-x. 2 root root 25 3月 18 09:51 pulse
drwxr-xr-x. 3 root root 50 3月 18 09:56 qemu-ga
drwxr-xr-x. 3 root root 27 3月 18 09:56 ras
drwxr-xr-x. 3 root root 36 3月 18 09:51 rc.d
lrwxrwxrwx. 1 root root 13 8月 22 2023 rc.local -> rc.d/rc.local
-rw-r--r--. 1 root root 44 9月 27 15:56 redhat-release
-rw-r--r--. 1 root root 74 3月 19 19:05 resolv.conf
drwxr-xr-x. 3 root root 40 3月 18 09:56 rhc
drwxr-xr-x. 6 root root 84 3月 18 09:54 rhsm
-rw-r--r--. 1 root root 1634 8月 2 2021 rpc
drwxr-xr-x. 2 root root 6 6月 30 2023 rpm
-rw-r--r--. 1 root root 458 11月 2 2022 rsyncd.conf
-rw-r--r--. 1 root root 3303 7月 31 2023 rsyslog.conf
drwxr-xr-x. 2 root root 6 7月 31 2023 rsyslog.d
drwxr-xr-x. 2 root root 35 3月 18 09:52 rwtab.d
drwxr-xr-x. 2 root root 61 3月 18 09:51 samba
drwxr-xr-x. 3 root root 4096 3月 18 09:52 sane.d
drwxr-xr-x. 2 root root 6 9月 13 2022 sasl2
drwxr-xr-x. 7 root root 4096 3月 18 09:51 security
drwxr-xr-x. 3 root root 57 3月 18 09:51 selinux
-rw-r--r--. 1 root root 692252 6月 23 2020 services
-rw-r--r--. 1 root root 216 6月 27 2023 sestatus.conf
drwxr-xr-x. 2 root root 33 3月 18 09:53 setroubleshoot
drwxr-xr-x. 3 root root 21 3月 18 09:50 sgml
----------. 1 root root 1133 3月 18 10:12 shadow
----------. 1 root root 1134 3月 18 10:06 shadow-
-rw-r--r--. 1 root root 44 6月 23 2020 shells
drwxr-xr-x. 3 root root 78 3月 18 09:50 skel
drwxr-xr-x. 3 root root 74 3月 18 09:56 smartmontools
drwxr-xr-x. 6 root root 86 3月 18 09:54 sos
drwxr-xr-x. 4 root root 56 3月 18 09:52 speech-dispatcher
drwxr-xr-x. 4 root root 4096 3月 18 10:16 ssh
drwxr-xr-x. 2 root root 77 3月 18 09:51 ssl
drwx------. 4 sssd sssd 31 3月 18 09:52 sssd
drwxr-xr-x. 2 root root 6 8月 10 2021 statetab.d
-rw-r--r--. 1 root root 15 3月 18 10:06 subgid
-rw-r--r--. 1 root root 0 6月 23 2020 subgid-
-rw-r--r--. 1 root root 15 3月 18 10:06 subuid
-rw-r--r--. 1 root root 0 6月 23 2020 subuid-
-rw-r-----. 1 root root 3983 1月 19 2023 sudo.conf
-r--r-----. 1 root root 4328 1月 19 2023 sudoers
drwxr-x---. 2 root root 6 1月 19 2023 sudoers.d
-rw-r-----. 1 root root 3181 1月 19 2023 sudo-ldap.conf
drwxr-xr-x. 3 root root 24 3月 18 09:50 swid
drwxr-xr-x. 3 root root 4096 3月 18 10:06 sysconfig
-rw-r--r--. 1 root root 449 8月 22 2023 sysctl.conf
drwxr-xr-x. 2 root root 28 3月 18 09:52 sysctl.d
drwxr-xr-x. 4 root root 166 3月 18 09:52 systemd
lrwxrwxrwx. 1 root root 14 9月 27 15:56 system-release -> redhat-release
-rw-r--r--. 1 root root 41 9月 27 15:56 system-release-cpe
drwxr-xr-x. 2 root root 6 8月 21 2023 terminfo
drwxr-xr-x. 2 root root 22 3月 18 09:54 tmpfiles.d
drwxr-xr-x. 3 root root 51 3月 18 09:51 tpm2-tss
-rw-r--r--. 1 root root 375 9月 20 19:35 trusted-key.key
drwxr-xr-x. 3 root root 136 3月 18 09:56 tuned
drwxr-xr-x. 4 root root 68 3月 18 10:08 udev
drwxr-xr-x. 2 root root 60 3月 18 09:54 udisks2
-rw-r--r--. 1 root root 624 8月 10 2021 updatedb.conf
drwxr-xr-x. 2 root root 25 3月 18 09:52 UPower
-rw-r--r--. 1 root root 1523 8月 11 2021 usb_modeswitch.conf
drwxr-xr-x. 2 root root 6 3月 19 19:32 user01
drwxr-xr-x. 2 root root 6 3月 19 19:33 user02
-rw-r--r--. 1 root root 28 3月 18 10:06 vconsole.conf
-rw-r--r--. 1 root root 4017 2月 10 2023 vimrc
-rw-r--r--. 1 root root 1184 2月 10 2023 virc
drwxr-xr-x. 4 root root 4096 3月 18 09:55 vmware-tools
drwxr-xr-x. 5 root root 67 3月 18 09:50 vulkan
-rw-r--r--. 1 root root 4925 11月 3 2021 wgetrc
drwxr-xr-x. 6 root root 81 3月 18 09:52 wireplumber
drwxr-xr-x. 2 root root 33 3月 18 09:52 wpa_supplicant
drwxr-xr-x. 7 root root 121 3月 18 09:54 X11
-rw-r--r--. 1 root root 817 8月 10 2021 xattr.conf
drwxr-xr-x. 6 root root 125 3月 18 09:51 xdg
drwxr-xr-x. 3 root root 36 3月 18 09:51 xml
drwxr-xr-x. 2 root root 57 3月 18 09:56 yum
lrwxrwxrwx. 1 root root 12 6月 29 2023 yum.conf -> dnf/dnf.conf
drwxr-xr-x. 2 root root 25 3月 18 11:33 yum.repos.d
[root@text1 etc]# mkdir -p /mnt/user03/a01 /mnt/user03/a02
[root@text1 etc]# ls -l /mnt/user03
总用量 0
drwxr-xr-x. 2 root root 6 3月 19 19:35 a01
drwxr-xr-x. 2 root root 6 3月 19 19:35 a02
[root@text1 etc]#
(3) rmdir 删除目录
rmdir [选项] 目录名
[root@text1 etc]# clear
[root@text1 etc]# rmdir -v /mnt/user03/a01
rmdir: 正在删除目录,'/mnt/user03/a01'
[root@text1 etc]# ls -l /mnt/user03
总用量 0
drwxr-xr-x. 2 root root 6 3月 19 19:35 a02
[root@text1 etc]#
(4) rm删除文件或者目录
rm [选项] 文件或者目录
[root@text1 etc]# clear
[root@text1 etc]# rmdir -v /mnt/user03/a01
rmdir: 正在删除目录,'/mnt/user03/a01'
[root@text1 etc]# ls -l /mnt/user03
总用量 0
drwxr-xr-x. 2 root root 6 3月 19 19:35 a02
[root@text1 etc]#
(5)cp 复制文件或者目录
cp [选项] 源目录或者文件名
[root@text1 etc]# cd /mnt
[root@text1 mnt]# touch a01.txt a02.txt a03.txt
[root@text1 mnt]# mkdir user01 user02 user03
[root@text1 mnt]# dir
a01.txt a02.txt a03.txt user01 user02 user03
[root@text1 mnt]# ls -l
总用量 0
-rw-r--r--. 1 root root 0 3月 19 19:47 a01.txt
-rw-r--r--. 1 root root 0 3月 19 19:47 a02.txt
-rw-r--r--. 1 root root 0 3月 19 19:47 a03.txt
drwxr-xr-x. 2 root root 6 3月 19 19:47 user01
drwxr-xr-x. 2 root root 6 3月 19 19:47 user02
drwxr-xr-x. 2 root root 6 3月 19 19:47 user03
[root@text1 mnt]# cd ~
[root@text1 ~]# cp -r /mnt/a01.txt /mnt/user01/test01.txt
[root@text1 ~]# ls -l /mnt/user01/test01.txt
-rw-r--r--. 1 root root 0 3月 19 19:48 /mnt/user01/test01.txt
[root@text1 ~]#
(6) mv 移动文件或者目录
mv [选项] 源目录或者文件
[root@text1 ~]# ls -l /mnt
总用量 0
-rw-r--r--. 1 root root 0 3月 19 19:47 a01.txt
-rw-r--r--. 1 root root 0 3月 19 19:47 a02.txt
-rw-r--r--. 1 root root 0 3月 19 19:47 a03.txt
drwxr-xr-x. 2 root root 24 3月 19 19:48 user01
drwxr-xr-x. 2 root root 6 3月 19 19:47 user02
drwxr-xr-x. 2 root root 6 3月 19 19:47 user03
[root@text1 ~]# mv -f /mnt/a01.txt /mnt/test01.txt
[root@text1 ~]# ls -l /mnt
总用量 0
-rw-r--r--. 1 root root 0 3月 19 19:47 a02.txt
-rw-r--r--. 1 root root 0 3月 19 19:47 a03.txt
-rw-r--r--. 1 root root 0 3月 19 19:47 test01.txt
drwxr-xr-x. 2 root root 24 3月 19 19:48 user01
drwxr-xr-x. 2 root root 6 3月 19 19:47 user02
drwxr-xr-x. 2 root root 6 3月 19 19:47 user03
[root@text1 ~]#
(7)tar 打包 归档文件或者目录
tar [选项] 文件目录列表
[root@text1 ~]# rm -rf /mnt/*
[root@text1 ~]# ls -l /mnt
总用量 0
[root@text1 ~]# touch /mnt/a01.txt /mnt/a02.txt
[root@text1 ~]# mkdir /mnt/test01 /mnt/test02
[root@text1 ~]# ls -l /mnt
总用量 0
-rw-r--r--. 1 root root 0 3月 19 20:03 a01.txt
-rw-r--r--. 1 root root 0 3月 19 20:03 a02.txt
drwxr-xr-x. 2 root root 6 3月 19 20:03 test01
drwxr-xr-x. 2 root root 6 3月 19 20:03 test02
[root@text1 ~]# mkdir /root/user01
[root@text1 ~]# tar -cvf /root/user01/test01.tar /mnt
tar: 从成员名中删除开头的“/”
/mnt/
/mnt/a01.txt
/mnt/a02.txt
/mnt/test01/
/mnt/test02/
[root@text1 ~]# ls /root/user01
test01.tar
[root@text1 ~]# gzip /root/user01/test01.tar
[root@text1 ~]# ls-l /root/user01
bash: ls-l: command not found...
[root@text1 ~]# ls -l /root/user01
总用量 4
-rw-r--r--. 1 root root 186 3月 19 20:04 test01.tar.gz
[root@text1 ~]# tar -zcvf /root/user01.tar.gz /mnt
tar: 从成员名中删除开头的“/”
/mnt/
/mnt/a01.txt
/mnt/a02.txt
/mnt/test01/
/mnt/test02/
[root@text1 ~]# ls -l /root/user01
总用量 4
-rw-r--r--. 1 root root 186 3月 19 20:04 test01.tar.gz
[root@text1 ~]# cd /root/user01
[root@text1 user01]# ls -l
总用量 4
-rw-r--r--. 1 root root 186 3月 19 20:04 test01.tar.gz
[root@text1 user01]# gzip -d test01.tar.gz
[root@text1 user01]# tar -xf test01.tar
[root@text1 user01]# tar -zxf test01.tar.gz
tar (child): test01.tar.gz:无法 open: 没有那个文件或目录
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
[root@text1 user01]# tar -zxf test01.tar.gz
tar (child): test01.tar.gz:无法 open: 没有那个文件或目录
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
[root@text1 user01]# cd mnt
[root@text1 mnt]#
[root@text1 mnt]#
[root@text1 mnt]# ls -l
总用量 0
-rw-r--r--. 1 root root 0 3月 19 20:03 a01.txt
-rw-r--r--. 1 root root 0 3月 19 20:03 a02.txt
drwxr-xr-x. 2 root root 6 3月 19 20:03 test01
drwxr-xr-x. 2 root root 6 3月 19 20:03 test02
[root@text1 mnt]#
(8)du查看文件或者目录大小
du [选项] 目录
[root@text1 mnt]# du -h /boot
1020K /boot/efi/EFI/BOOT
6.0M /boot/efi/EFI/redhat
7.0M /boot/efi/EFI
7.0M /boot/efi
2.3M /boot/grub2/fonts
2.3M /boot/grub2
8.0K /boot/loader/entries
8.0K /boot/loader
260M /boot
[root@text1 mnt]# du -hs /boot
260M /boot
[root@text1 mnt]#
文件的内容显示和处理
(1)cat 显示文件内容
cat [选项] 文件名
[root@text1 ~]# dir
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg history.txt user01 user01.tar.gz
[root@text1 ~]# cat a1 -test01.txt
cat: 不适用的选项 -- 0
请尝试执行 "cat --help" 来获取更多信息。
[root@text1 ~]# cat a1-test01.txt
cat: a1-test01.txt: 没有那个文件或目录
[root@text1 ~]# cat user01
cat: user01: 是一个目录
[root@text1 ~]#
(2)tac 反向显示文件内容
tac [选项] 文件名
[root@text1 ~]# cat user01
cat: user01: 是一个目录
[root@text1 ~]# tac -r a1-test01.txt
tac: 以读模式打开 'a1-test01.txt' 时失败: 没有那个文件或目录
[root@text1 ~]# tac -r user01
tac: user01:读取出错: 是一个目录
[root@text1 ~]#
(3)more 逐页显示文件内容(仅可以向下翻页)
more [选项] 文件名
[root@text1 ~]# more /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
tss:x:59:59:Account used for TPM access:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
polkitd:x:998:996:User for polkitd:/:/sbin/nologin
avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
colord:x:997:995:User for colord:/var/lib/colord:/sbin/nologin
rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin
--更多--(44%)
(4)less 逐页显示文件内容(可向上向下翻页)
less [选项] 文件名
C:\Users\asus>ssh root@192.168.248.132
root@192.168.248.132's password:
Activate the web console with: systemctl enable --now cockpit.socket
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Thu Mar 21 19:10:07 2024
[root@text1 ~]#
[root@text1 ~]#
[root@text1 ~]#
[root@text1 ~]#
[root@text1 ~]#
[root@text1 ~]#
[root@text1 ~]# dir
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg history.txt user01 user01.tar.gz
[root@text1 ~]# cat a1 -test01.txt
cat: 不适用的选项 -- 0
请尝试执行 "cat --help" 来获取更多信息。
[root@text1 ~]# cat a1-test01.txt
cat: a1-test01.txt: 没有那个文件或目录
[root@text1 ~]# cat user01
cat: user01: 是一个目录
[root@text1 ~]# tac -r a1-test01.txt
tac: 以读模式打开 'a1-test01.txt' 时失败: 没有那个文件或目录
[root@text1 ~]# tac -r user01
tac: user01:读取出错: 是一个目录
[root@text1 ~]# more /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
tss:x:59:59:Account used for TPM access:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
polkitd:x:998:996:User for polkitd:/:/sbin/nologin
avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
colord:x:997:995:User for colord:/var/lib/colord:/sbin/nologin
rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin
[root@text1 ~]# less -N /etc/passwd
[root@text1 ~]#
[root@text1 ~]#
(5)head 查看文件的n行
head [选项] 文件名
[root@text1 ~]# head -n5 -v /etc/passwd
==> /etc/passwd <==
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
[root@text1 ~]#
(6)tail 查看文件最后几行
tail [选项] 文件
[root@text1 ~]# tail -n5 -v /etc/passwd
==> /etc/passwd <==
sshd:x:74:74:Privilege-separated SSH:/usr/share/empty.sshd:/sbin/nologin
chrony:x:980:979:chrony system user:/var/lib/chrony:/sbin/nologin
dnsmasq:x:979:978:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/usr/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
w:x:1000:1000:w:/home/w:/bin/bash
[root@text1 ~]#
(7)file 查看文件或者目录类型
file [选项] 文件名
[root@text1 ~]# dir
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg history.txt user01 user01.tar.gz
[root@text1 ~]# feil history
bash: feil: command not found...
[root@text1 ~]# file history
history: cannot open `history' (No such file or directory)
[root@text1 ~]# file user01.tar.qz
user01.tar.qz: cannot open `user01.tar.qz' (No such file or directory)
[root@text1 ~]#
[root@text1 ~]#
(8)wc 统计
wc [选项] 文件名
[root@text1 ~]# wc user01
wc: user01: 是一个目录
0 0 0 user01
[root@text1 ~]#
(9)sort 排序
sort [选项] 文件名
[root@text1 ~]# cat testfile01.txt
cat: testfile01.txt: 是一个目录
[root@text1 ~]# sort testfile01.txt
sort: 读取失败: testfile01.txt: 是一个目录
[root@text1 ~]#
(10)uniq 去重
uniq [选项] 文件名
(11) echo 将显示内容输出到屏幕上
echo [选项] 输出内容
文件查找命令
(1)whereis 查找文件位置
whereis [选项] 文件
[root@text1 ~]# whereis passwd
passwd: /usr/bin/passwd /etc/passwd /usr/share/man/man5/passwd.5.gz /usr/share/man/man1/passwd.1ossl.gz /usr/share/man/man1/passwd.1.gz
[root@text1 ~]#
(2)locate 查找绝对路径中包含指定字符串的文件的位置
locate [选项]文件名
[root@text1 ~]# locate passwd
/etc/passwd
/etc/passwd-
/etc/pam.d/passwd
/etc/security/opasswd
/usr/bin/gpasswd
/usr/bin/grub2-mkpasswd-pbkdf2
/usr/bin/passwd
/usr/lib/firewalld/services/kpasswd.xml
/usr/lib64/samba/pdb/smbpasswd.so
/usr/lib64/security/pam_unix_passwd.so
/usr/sbin/chgpasswd
/usr/sbin/chpasswd
/usr/sbin/lpasswd
/usr/sbin/saslpasswd2
/usr/share/awk/ns_passwd.awk
/usr/share/awk/passwd.awk
/usr/share/bash-completion/completions/chpasswd
/usr/share/bash-completion/completions/gpasswd
/usr/share/bash-completion/completions/htpasswd
/usr/share/bash-completion/completions/ldappasswd
/usr/share/bash-completion/completions/passwd
/usr/share/bash-completion/completions/smbpasswd
/usr/share/doc/passwd
/usr/share/doc/passwd/AUTHORS
/usr/share/doc/passwd/ChangeLog
/usr/share/doc/passwd/NEWS
/usr/share/doc/perl-Net-SSLeay/examples/passwd-cb.pl
/usr/share/licenses/passwd
/usr/share/licenses/passwd/COPYING
/usr/share/locale/ar/LC_MESSAGES/passwd.mo
/usr/share/locale/as/LC_MESSAGES/passwd.mo
/usr/share/locale/ast/LC_MESSAGES/passwd.mo
/usr/share/locale/bg/LC_MESSAGES/passwd.mo
/usr/share/locale/bn/LC_MESSAGES/passwd.mo
/usr/share/locale/bn_IN/LC_MESSAGES/passwd.mo
/usr/share/locale/bs/LC_MESSAGES/passwd.mo
/usr/share/locale/ca/LC_MESSAGES/passwd.mo
/usr/share/locale/cs/LC_MESSAGES/passwd.mo
/usr/share/locale/cy/LC_MESSAGES/passwd.mo
/usr/share/locale/da/LC_MESSAGES/passwd.mo
/usr/share/locale/de/LC_MESSAGES/passwd.mo
/usr/share/locale/el/LC_MESSAGES/passwd.mo
/usr/share/locale/en_GB/LC_MESSAGES/passwd.mo
/usr/share/locale/es/LC_MESSAGES/passwd.mo
/usr/share/locale/et/LC_MESSAGES/passwd.mo
/usr/share/locale/eu/LC_MESSAGES/passwd.mo
/usr/share/locale/fa/LC_MESSAGES/passwd.mo
/usr/share/locale/fi/LC_MESSAGES/passwd.mo
/usr/share/locale/fr/LC_MESSAGES/passwd.mo
/usr/share/locale/gl/LC_MESSAGES/passwd.mo
/usr/share/locale/gu/LC_MESSAGES/passwd.mo
/usr/share/locale/he/LC_MESSAGES/passwd.mo
/usr/share/locale/hi/LC_MESSAGES/passwd.mo
/usr/share/locale/hr/LC_MESSAGES/passwd.mo
/usr/share/locale/hu/LC_MESSAGES/passwd.mo
/usr/share/locale/hy/LC_MESSAGES/passwd.mo
/usr/share/locale/id/LC_MESSAGES/passwd.mo
/usr/share/locale/is/LC_MESSAGES/passwd.mo
/usr/share/locale/it/LC_MESSAGES/passwd.mo
/usr/share/locale/ja/LC_MESSAGES/passwd.mo
/usr/share/locale/ka/LC_MESSAGES/passwd.mo
/usr/share/locale/kn/LC_MESSAGES/passwd.mo
/usr/share/locale/ko/LC_MESSAGES/passwd.mo
/usr/share/locale/ku/LC_MESSAGES/passwd.mo
/usr/share/locale/lo/LC_MESSAGES/passwd.mo
/usr/share/locale/mk/LC_MESSAGES/passwd.mo
/usr/share/locale/ml/LC_MESSAGES/passwd.mo
/usr/share/locale/mr/LC_MESSAGES/passwd.mo
/usr/share/locale/ms/LC_MESSAGES/passwd.mo
/usr/share/locale/my/LC_MESSAGES/passwd.mo
/usr/share/locale/nb/LC_MESSAGES/passwd.mo
/usr/share/locale/nds/LC_MESSAGES/passwd.mo
/usr/share/locale/nl/LC_MESSAGES/passwd.mo
/usr/share/locale/nn/LC_MESSAGES/passwd.mo
/usr/share/locale/or/LC_MESSAGES/passwd.mo
/usr/share/locale/pa/LC_MESSAGES/passwd.mo
/usr/share/locale/pl/LC_MESSAGES/passwd.mo
/usr/share/locale/pt/LC_MESSAGES/passwd.mo
/usr/share/locale/pt_BR/LC_MESSAGES/passwd.mo
/usr/share/locale/ro/LC_MESSAGES/passwd.mo
/usr/share/locale/ru/LC_MESSAGES/passwd.mo
/usr/share/locale/si/LC_MESSAGES/passwd.mo
/usr/share/locale/sk/LC_MESSAGES/passwd.mo
/usr/share/locale/sl/LC_MESSAGES/passwd.mo
/usr/share/locale/sq/LC_MESSAGES/passwd.mo
/usr/share/locale/sr/LC_MESSAGES/passwd.mo
/usr/share/locale/sr@latin/LC_MESSAGES/passwd.mo
/usr/share/locale/sv/LC_MESSAGES/passwd.mo
/usr/share/locale/ta/LC_MESSAGES/passwd.mo
/usr/share/locale/te/LC_MESSAGES/passwd.mo
/usr/share/locale/tr/LC_MESSAGES/passwd.mo
/usr/share/locale/uk/LC_MESSAGES/passwd.mo
/usr/share/locale/ur/LC_MESSAGES/passwd.mo
/usr/share/locale/vi/LC_MESSAGES/passwd.mo
/usr/share/locale/wa/LC_MESSAGES/passwd.mo
/usr/share/locale/zh_CN/LC_MESSAGES/passwd.mo
/usr/share/locale/zh_TW/LC_MESSAGES/passwd.mo
/usr/share/man/cs/man1/gpasswd.1.gz
/usr/share/man/de/man1/gpasswd.1.gz
/usr/share/man/de/man8/chgpasswd.8.gz
/usr/share/man/de/man8/chpasswd.8.gz
/usr/share/man/fr/man1/gpasswd.1.gz
/usr/share/man/fr/man8/chgpasswd.8.gz
/usr/share/man/fr/man8/chpasswd.8.gz
/usr/share/man/hu/man1/gpasswd.1.gz
/usr/share/man/it/man1/gpasswd.1.gz
/usr/share/man/it/man8/chgpasswd.8.gz
/usr/share/man/it/man8/chpasswd.8.gz
/usr/share/man/ja/man1/gpasswd.1.gz
/usr/share/man/ja/man1/passwd.1.gz
/usr/share/man/ja/man8/chpasswd.8.gz
/usr/share/man/man1/gpasswd.1.gz
/usr/share/man/man1/grub2-mkpasswd-pbkdf2.1.gz
/usr/share/man/man1/lpasswd.1.gz
/usr/share/man/man1/openssl-passwd.1ossl.gz
/usr/share/man/man1/passwd.1.gz
/usr/share/man/man1/passwd.1ossl.gz
/usr/share/man/man3/passwd2des.3.gz
/usr/share/man/man5/passwd.5.gz
/usr/share/man/man5/smbpasswd.5.gz
/usr/share/man/man8/chgpasswd.8.gz
/usr/share/man/man8/chpasswd.8.gz
/usr/share/man/pt_BR/man1/gpasswd.1.gz
/usr/share/man/ru/man1/gpasswd.1.gz
/usr/share/man/ru/man8/chgpasswd.8.gz
/usr/share/man/ru/man8/chpasswd.8.gz
/usr/share/man/zh_CN/man1/gpasswd.1.gz
/usr/share/man/zh_CN/man8/chgpasswd.8.gz
/usr/share/man/zh_CN/man8/chpasswd.8.gz
/usr/share/man/zh_TW/man8/chpasswd.8.gz
/usr/share/vim/vim82/ftplugin/passwd.vim
/usr/share/vim/vim82/syntax/passwd.vim
[root@text1 ~]# locate -c passwd
132
(3)find 文件查找
find [路径] 匹配表达式
/home/w/.cache/gnome-software/flatpak-user-user/components.xmlb
/home/w/.cache/gnome-software/odrs
/home/w/.cache/gstreamer-1.0
/home/w/.cache/gstreamer-1.0/registry.x86_64.bin
/home/w/.cache/flatpak
/home/w/.cache/flatpak/system-cache
/home/w/.cache/appstream
/home/w/.bash_history
/home/w/.viminfo
/media
/mnt
/mnt/a01.txt
/mnt/a02.txt
/mnt/test01
/mnt/test02
/opt
/srv
(4)which 确定程序具体位置
which [选项]
/home/w/.cache/gnome-software/flatpak-user-user/components.xmlb
/home/w/.cache/gnome-software/odrs
/home/w/.cache/gstreamer-1.0
/home/w/.cache/gstreamer-1.0/registry.x86_64.bin
/home/w/.cache/flatpak
/home/w/.cache/flatpak/system-cache
/home/w/.cache/appstream
/home/w/.bash_history
/home/w/.viminfo
/media
/mnt
/mnt/a01.txt
/mnt/a02.txt
/mnt/test01
/mnt/test02
/opt
/srv
(5)grep 查找文件中包含指定字符串的行
grep [选项] 文件名
[root@text1 ~]# grep "root" /etc/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
[root@text1 ~]# grep -il "root" /etc/passwd
/etc/passwd
[root@text1 ~]#
2.3文件管理进阶
软连接和硬链接
通配符及文件名变量
通配符星号(*)问号(?)方括号([])
[root@text1 ~]# cd /root
[root@text1 ~]#
[root@text1 ~]#
[root@text1 ~]# mkdir temp
[root@text1 ~]# cd temp
[root@text1 temp]# touch test1.txt test2.txt test3.txt test4.txt test5.txt test11.txt test22.txt test33.txt
[root@text1 temp]# dir test*
test11.txt test1.txt test22.txt test2.txt test33.txt test3.txt test4.txt test5.txt
[root@text1 temp]# dir *3*
test33.txt test3.txt
[root@text1 temp]# dir test?.txt
test1.txt test2.txt test3.txt test4.txt test5.txt
[root@text1 temp]# dir test[2-3]*
test22.txt test2.txt test33.txt test3.txt
[root@text1 temp]# dir test[2-3].txt
test2.txt test3.txt
[root@text1 temp]#
输入 输出重定向于管道
(1)标准文件
linux把所有设备都当做文件来管理,每个设备都有相应的文件名。
[root@text1 temp]# ls -l /dev
总用量 0
crw-r--r--. 1 root root 10, 235 3月 26 20:09 autofs
drwxr-xr-x. 2 root root 180 3月 26 20:09 block
drwxr-xr-x. 2 root root 60 3月 26 20:08 bsg
drwxr-xr-x. 3 root root 60 3月 26 20:08 bus
lrwxrwxrwx. 1 root root 3 3月 26 20:09 cdrom -> sr0
drwxr-xr-x. 2 root root 3240 3月 26 20:10 char
crw--w----. 1 root tty 5, 1 3月 26 20:08 console
lrwxrwxrwx. 1 root root 11 3月 26 20:08 core -> /proc/kcore
drwxr-xr-x. 4 root root 80 3月 26 20:08 cpu
crw-------. 1 root root 10, 124 3月 26 20:09 cpu_dma_latency
drwxr-xr-x. 9 root root 180 3月 26 20:08 disk
brw-rw----. 1 root disk 253, 0 3月 26 20:08 dm-0
brw-rw----. 1 root disk 253, 1 3月 26 20:08 dm-1
drwxr-xr-x. 2 root root 60 3月 26 20:08 dma_heap
crw-rw----+ 1 root audio 14, 9 3月 26 20:09 dmmidi
drwxr-xr-x. 3 root root 100 3月 26 20:08 dri
crw-rw----. 1 root video 29, 0 3月 26 20:08 fb0
lrwxrwxrwx. 1 root root 13 3月 26 20:08 fd -> /proc/self/fd
crw-rw-rw-. 1 root root 1, 7 3月 26 20:09 full
crw-rw-rw-. 1 root root 10, 229 3月 26 20:09 fuse
crw-------. 1 root root 242, 0 3月 26 20:08 hidraw0
crw-------. 1 root root 10, 228 3月 26 20:09 hpet
drwxr-xr-x. 2 root root 0 3月 26 20:08 hugepages
crw-------. 1 root root 10, 183 3月 26 20:09 hwrng
lrwxrwxrwx. 1 root root 12 3月 26 20:08 initctl -> /run/initctl
drwxr-xr-x. 4 root root 340 3月 26 20:10 input
crw-r--r--. 1 root root 1, 11 3月 26 20:09 kmsg
lrwxrwxrwx. 1 root root 28 3月 26 20:08 log -> /run/systemd/journal/dev-log
crw-rw----. 1 root disk 10, 237 3月 26 20:08 loop-control
crw-rw----. 1 root lp 6, 0 3月 26 20:08 lp0
crw-rw----. 1 root lp 6, 1 3月 26 20:08 lp1
crw-rw----. 1 root lp 6, 2 3月 26 20:08 lp2
crw-rw----. 1 root lp 6, 3 3月 26 20:08 lp3
drwxr-xr-x. 2 root root 100 3月 26 20:08 mapper
crw-------. 1 root root 10, 227 3月 26 20:09 mcelog
crw-r-----. 1 root kmem 1, 1 3月 26 20:09 mem
crw-rw----+ 1 root audio 14, 2 3月 26 20:09 midi
drwxrwxrwt. 2 root root 40 3月 26 20:08 mqueue
drwxr-xr-x. 2 root root 60 3月 26 20:08 net
crw-------. 1 root root 240, 0 3月 26 20:08 ng0n1
crw-rw-rw-. 1 root root 1, 3 3月 26 20:09 null
crw-------. 1 root root 241, 0 3月 26 20:08 nvme0
brw-rw----. 1 root disk 259, 0 3月 26 20:08 nvme0n1
brw-rw----. 1 root disk 259, 1 3月 26 20:09 nvme0n1p1
brw-rw----. 1 root disk 259, 2 3月 26 20:08 nvme0n1p2
brw-rw----. 1 root disk 259, 3 3月 26 20:08 nvme0n1p3
crw-------. 1 root root 10, 144 3月 26 20:09 nvram
crw-r-----. 1 root kmem 1, 4 3月 26 20:09 port
crw-------. 1 root root 108, 0 3月 26 20:08 ppp
crw-rw-rw-. 1 root tty 5, 2 3月 26 20:28 ptmx
drwxr-xr-x. 2 root root 0 3月 26 20:08 pts
crw-rw-rw-. 1 root root 1, 8 3月 26 20:09 random
crw-rw-r--+ 1 root root 10, 242 3月 26 20:09 rfkill
drwxr-xr-x. 2 root root 80 3月 26 20:08 rhel
lrwxrwxrwx. 1 root root 4 3月 26 20:08 rtc -> rtc0
crw-------. 1 root root 250, 0 3月 26 20:08 rtc0
crw-rw----+ 1 root cdrom 21, 0 3月 26 20:08 sg0
drwxrwxrwt. 2 root root 40 3月 26 20:08 shm
crw-------. 1 root root 10, 231 3月 26 20:09 snapshot
drwxr-xr-x. 3 root root 200 3月 26 20:09 snd
brw-rw----+ 1 root cdrom 11, 0 3月 26 20:09 sr0
lrwxrwxrwx. 1 root root 15 3月 26 20:08 stderr -> /proc/self/fd/2
lrwxrwxrwx. 1 root root 15 3月 26 20:08 stdin -> /proc/self/fd/0
lrwxrwxrwx. 1 root root 15 3月 26 20:08 stdout -> /proc/self/fd/1
crw-rw-rw-. 1 root tty 5, 0 3月 26 20:08 tty
crw--w----. 1 root tty 4, 0 3月 26 20:08 tty0
crw--w----. 1 root tty 4, 1 3月 26 20:09 tty1
crw--w----. 1 root tty 4, 10 3月 26 20:08 tty10
crw--w----. 1 root tty 4, 11 3月 26 20:08 tty11
crw--w----. 1 root tty 4, 12 3月 26 20:08 tty12
crw--w----. 1 root tty 4, 13 3月 26 20:08 tty13
crw--w----. 1 root tty 4, 14 3月 26 20:08 tty14
crw--w----. 1 root tty 4, 15 3月 26 20:08 tty15
crw--w----. 1 root tty 4, 16 3月 26 20:08 tty16
crw--w----. 1 root tty 4, 17 3月 26 20:08 tty17
crw--w----. 1 root tty 4, 18 3月 26 20:08 tty18
crw--w----. 1 root tty 4, 19 3月 26 20:08 tty19
crw--w----. 1 root tty 4, 2 3月 26 20:09 tty2
crw--w----. 1 root tty 4, 20 3月 26 20:08 tty20
crw--w----. 1 root tty 4, 21 3月 26 20:08 tty21
crw--w----. 1 root tty 4, 22 3月 26 20:08 tty22
crw--w----. 1 root tty 4, 23 3月 26 20:08 tty23
crw--w----. 1 root tty 4, 24 3月 26 20:08 tty24
crw--w----. 1 root tty 4, 25 3月 26 20:08 tty25
crw--w----. 1 root tty 4, 26 3月 26 20:08 tty26
crw--w----. 1 root tty 4, 27 3月 26 20:08 tty27
crw--w----. 1 root tty 4, 28 3月 26 20:08 tty28
crw--w----. 1 root tty 4, 29 3月 26 20:08 tty29
crw--w----. 1 root tty 4, 3 3月 26 20:08 tty3
crw--w----. 1 root tty 4, 30 3月 26 20:08 tty30
crw--w----. 1 root tty 4, 31 3月 26 20:08 tty31
crw--w----. 1 root tty 4, 32 3月 26 20:08 tty32
crw--w----. 1 root tty 4, 33 3月 26 20:08 tty33
crw--w----. 1 root tty 4, 34 3月 26 20:08 tty34
crw--w----. 1 root tty 4, 35 3月 26 20:08 tty35
crw--w----. 1 root tty 4, 36 3月 26 20:08 tty36
crw--w----. 1 root tty 4, 37 3月 26 20:08 tty37
crw--w----. 1 root tty 4, 38 3月 26 20:08 tty38
crw--w----. 1 root tty 4, 39 3月 26 20:08 tty39
crw--w----. 1 root tty 4, 4 3月 26 20:08 tty4
crw--w----. 1 root tty 4, 40 3月 26 20:08 tty40
crw--w----. 1 root tty 4, 41 3月 26 20:08 tty41
crw--w----. 1 root tty 4, 42 3月 26 20:08 tty42
crw--w----. 1 root tty 4, 43 3月 26 20:08 tty43
crw--w----. 1 root tty 4, 44 3月 26 20:08 tty44
crw--w----. 1 root tty 4, 45 3月 26 20:08 tty45
crw--w----. 1 root tty 4, 46 3月 26 20:08 tty46
crw--w----. 1 root tty 4, 47 3月 26 20:08 tty47
crw--w----. 1 root tty 4, 48 3月 26 20:08 tty48
crw--w----. 1 root tty 4, 49 3月 26 20:08 tty49
crw--w----. 1 root tty 4, 5 3月 26 20:08 tty5
crw--w----. 1 root tty 4, 50 3月 26 20:08 tty50
crw--w----. 1 root tty 4, 51 3月 26 20:08 tty51
crw--w----. 1 root tty 4, 52 3月 26 20:08 tty52
crw--w----. 1 root tty 4, 53 3月 26 20:08 tty53
crw--w----. 1 root tty 4, 54 3月 26 20:08 tty54
crw--w----. 1 root tty 4, 55 3月 26 20:08 tty55
crw--w----. 1 root tty 4, 56 3月 26 20:08 tty56
crw--w----. 1 root tty 4, 57 3月 26 20:08 tty57
crw--w----. 1 root tty 4, 58 3月 26 20:08 tty58
crw--w----. 1 root tty 4, 59 3月 26 20:08 tty59
crw--w----. 1 root tty 4, 6 3月 26 20:08 tty6
crw--w----. 1 root tty 4, 60 3月 26 20:08 tty60
crw--w----. 1 root tty 4, 61 3月 26 20:08 tty61
crw--w----. 1 root tty 4, 62 3月 26 20:08 tty62
crw--w----. 1 root tty 4, 63 3月 26 20:08 tty63
crw--w----. 1 root tty 4, 7 3月 26 20:08 tty7
crw--w----. 1 root tty 4, 8 3月 26 20:08 tty8
crw--w----. 1 root tty 4, 9 3月 26 20:08 tty9
crw-rw----. 1 root dialout 4, 64 3月 26 20:08 ttyS0
crw-rw----. 1 root dialout 4, 65 3月 26 20:08 ttyS1
crw-rw----. 1 root dialout 4, 66 3月 26 20:08 ttyS2
crw-rw----. 1 root dialout 4, 67 3月 26 20:08 ttyS3
crw-rw----. 1 root kvm 10, 125 3月 26 20:09 udmabuf
crw-------. 1 root root 10, 239 3月 26 20:08 uhid
crw-------. 1 root root 10, 223 3月 26 20:09 uinput
crw-rw-rw-. 1 root root 1, 9 3月 26 20:09 urandom
crw-------. 1 root root 244, 0 3月 26 20:09 usbmon0
crw-------. 1 root root 244, 1 3月 26 20:08 usbmon1
crw-------. 1 root root 244, 2 3月 26 20:08 usbmon2
crw-------. 1 root root 10, 126 3月 26 20:09 userfaultfd
crw-rw----. 1 root tty 7, 0 3月 26 20:09 vcs
crw-rw----. 1 root tty 7, 1 3月 26 20:09 vcs1
crw-rw----. 1 root tty 7, 2 3月 26 20:09 vcs2
crw-rw----. 1 root tty 7, 3 3月 26 20:09 vcs3
crw-rw----. 1 root tty 7, 4 3月 26 20:09 vcs4
crw-rw----. 1 root tty 7, 5 3月 26 20:09 vcs5
crw-rw----. 1 root tty 7, 6 3月 26 20:09 vcs6
crw-rw----. 1 root tty 7, 128 3月 26 20:09 vcsa
crw-rw----. 1 root tty 7, 129 3月 26 20:09 vcsa1
crw-rw----. 1 root tty 7, 130 3月 26 20:09 vcsa2
crw-rw----. 1 root tty 7, 131 3月 26 20:09 vcsa3
crw-rw----. 1 root tty 7, 132 3月 26 20:09 vcsa4
crw-rw----. 1 root tty 7, 133 3月 26 20:09 vcsa5
crw-rw----. 1 root tty 7, 134 3月 26 20:09 vcsa6
crw-rw----. 1 root tty 7, 64 3月 26 20:09 vcsu
crw-rw----. 1 root tty 7, 65 3月 26 20:09 vcsu1
crw-rw----. 1 root tty 7, 66 3月 26 20:09 vcsu2
crw-rw----. 1 root tty 7, 67 3月 26 20:09 vcsu3
crw-rw----. 1 root tty 7, 68 3月 26 20:09 vcsu4
crw-rw----. 1 root tty 7, 69 3月 26 20:09 vcsu5
crw-rw----. 1 root tty 7, 70 3月 26 20:09 vcsu6
drwxr-xr-x. 2 root root 60 3月 26 20:08 vfio
crw-------. 1 root root 10, 127 3月 26 20:09 vga_arbiter
crw-------. 1 root root 10, 137 3月 26 20:08 vhci
crw-rw-rw-. 1 root kvm 10, 238 3月 26 20:08 vhost-net
crw-rw-rw-. 1 root kvm 10, 241 3月 26 20:08 vhost-vsock
crw-------. 1 root root 10, 123 3月 26 20:09 vmci
crw-rw-rw-. 1 root root 10, 122 3月 26 20:09 vsock
crw-rw-rw-. 1 root root 1, 5 3月 26 20:09 zero
[root@text1 temp]#
对于输入输出设备一样
1.文件/dev/stdin:标准输入(standard input)文件
2.文件/dev/stdin:标准输出(standard output)文件
3.文件/dev/stdin:标准错误输出(standard error)文件
(2)输入重定向
有些命令需要用户从标准输入键盘来输入,但有些时候用手输入有相当麻烦,这时候可以使用“<”.
输入重定向是指把命令或可执行程序的标准重定向输入到指定文件,意思是输入可以不来自键盘,而来自一个指定文件,所以,输入重定向主要用于改变一个命令的输入源。
[root@text1 temp]# wc < /etc/resolv.conf
3 8 74
[root@text1 temp]# wc < ./test01.txt
(3)输出重定向
输出重定向能把一个命令的输出重定向到一个文件中,而不是显示在屏幕上。
(4)错误重定向
若一个命令执行时发生错误,则会在屏幕上显示错误信息,虽然其与标准输出一样都会将结果显示在屏幕上,但它们占用的l/O通道不同,错误输出也可以重定向。使用符号“2>"(或追加符号“2>>'表示对错误输出设备的重定向,如执行以下命令。
[root@text1 ~]# dir test???.txt
dir: 无法访问 'test???.txt': 没有那个文件或目录
[root@text1 ~]# dir test???.txt 2>>error.txt
[root@text1 ~]# cat error.txt
dir: 无法访问 'test???.txt': 没有那个文件或目录
[root@text1 ~]#
(5)管道
若想将一个程序或命令的输出作为另一一个程 序或命令的输入,有两种方法:一种是通过一 个暂有文件将两个命令或程序结合在一起; 另一-种是通过Linux提供的管道功能,这种方法比第一种方法更好、更常用。管道具有把多个命令从左到右串联起来的能力,可以通过使用管道符号“1” 来建立-个管道行,管道的功能是把左边命令的输出重定向,并将其传送给右边的命令作为输入,同时把右边命令的输入重定向,并以左边命令的输出结果作为输入,如执行以下命令。
crw-rw----. 1 root tty 7, 2 3月 26 20:09 vcs2
crw-rw----. 1 root tty 7, 3 3月 26 20:09 vcs3
crw-rw----. 1 root tty 7, 4 3月 26 20:09 vcs4
crw-rw----. 1 root tty 7, 5 3月 26 20:09 vcs5
crw-rw----. 1 root tty 7, 6 3月 26 20:09 vcs6
crw-rw----. 1 root tty 7, 128 3月 26 20:09 vcsa
crw-rw----. 1 root tty 7, 129 3月 26 20:09 vcsa1
crw-rw----. 1 root tty 7, 130 3月 26 20:09 vcsa2
crw-rw----. 1 root tty 7, 131 3月 26 20:09 vcsa3
crw-rw----. 1 root tty 7, 132 3月 26 20:09 vcsa4
crw-rw----. 1 root tty 7, 133 3月 26 20:09 vcsa5
crw-rw----. 1 root tty 7, 134 3月 26 20:09 vcsa6
crw-rw----. 1 root tty 7, 64 3月 26 20:09 vcsu
crw-rw----. 1 root tty 7, 65 3月 26 20:09 vcsu1
crw-rw----. 1 root tty 7, 66 3月 26 20:09 vcsu2
crw-rw----. 1 root tty 7, 67 3月 26 20:09 vcsu3
crw-rw----. 1 root tty 7, 68 3月 26 20:09 vcsu4
crw-rw----. 1 root tty 7, 69 3月 26 20:09 vcsu5
crw-rw----. 1 root tty 7, 70 3月 26 20:09 vcsu6
drwxr-xr-x. 2 root root 60 3月 26 20:08 vfio
crw-------. 1 root root 10, 127 3月 26 20:09 vga_arbiter
crw-------. 1 root root 10, 137 3月 26 20:08 vhci
crw-rw-rw-. 1 root kvm 10, 238 3月 26 20:08 vhost-net
crw-rw-rw-. 1 root kvm 10, 241 3月 26 20:08 vhost-vsock
crw-------. 1 root root 10, 123 3月 26 20:09 vmci
crw-rw-rw-. 1 root root 10, 122 3月 26 20:09 vsock
crw-rw-rw-. 1 root root 1, 5 3月 26 20:09 zero
[root@text1 temp]#
对于输入输出设备一样
1.文件/dev/stdin:标准输入(standard input)文件
2.文件/dev/stdin:标准输出(standard output)文件
3.文件/dev/stdin:标准错误输出(standard error)文件
(2)输入重定向
有些命令需要用户从标准输入键盘来输入,但有些时候用手输入有相当麻烦,这时候可以使用“<”.
输入重定向是指把命令或可执行程序的标准重定向输入到指定文件,意思是输入可以不来自键盘,而来自一个指定文件,所以,输入重定向主要用于改变一个命令的输入源。
[root@text1 temp]# wc < /etc/resolv.conf
3 8 74
[root@text1 temp]# wc < ./test01.txt
(3)输出重定向
输出重定向能把一个命令的输出重定向到一个文件中,而不是显示在屏幕上。
(4)错误重定向
若一个命令执行时发生错误,则会在屏幕上显示错误信息,虽然其与标准输出一样都会将结果显示在屏幕上,但它们占用的l/O通道不同,错误输出也可以重定向。使用符号“2>"(或追加符号“2>>'表示对错误输出设备的重定向,如执行以下命令。
[root@text1 ~]# dir test???.txt
dir: 无法访问 ‘test???.txt’: 没有那个文件或目录
[root@text1 ~]# dir test???.txt 2>>error.txt
[root@text1 ~]# cat error.txt
dir: 无法访问 ‘test???.txt’: 没有那个文件或目录
[root@text1 ~]#
(5)管道
若想将一个程序或命令的输出作为另一一个程 序或命令的输入,有两种方法:一种是通过一 个暂有文件将两个命令或程序结合在一起; 另一-种是通过Linux提供的管道功能,这种方法比第一种方法更好、更常用。管道具有把多个命令从左到右串联起来的能力,可以通过使用管道符号“1” 来建立-个管道行,管道的功能是把左边命令的输出重定向,并将其传送给右边的命令作为输入,同时把右边命令的输入重定向,并以左边命令的输出结果作为输入,如执行以下命令。