- cat 查看纯文本文件的内容
[root@ZZH ~]# ls
anaconda-ks.cfg Documents initial-setup-ks.cfg Pictures Templates zhou.txt
Desktop Downloads Music Public Videos
[root@ZZH ~]# cat anaconda-ks.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
========
- 查看文件前n行
[root@ZZH ~]# head -15 anaconda-ks.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
- tail
tail -15 anaconda-ks.cfg
@x11
chrony
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
- more查看大文件
root@ZZH ~]# more anaconda-ks.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/
HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/
ResilientStorage
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=ens32 --onboot=off --ipv6=auto --no-activate
network --hostname=ZZH
--More--(38%)
==============
tail -f持续刷新
===========
- wc统计字数行数字节数
[root@ZZH ~]# wc -l anaconda-ks.cfg
65 anaconda-ks.cfg
[root@ZZH ~]# wc -w anaconda-ks.cfg
149 anaconda-ks.cfg
[root@ZZH ~]# wc -c anaconda-ks.cfg
1702 anaconda-ks.cfg
============
tr替换、stat查看三种时间状态,cut提取列,diff比较文件差异(brief、c)
touch创建空白文件,设置a/m 时间
mkdir 创建空白目录
cp复制
mv剪切
rm删除
dd指定大小和块数复制
tar -czvf压缩
tar -xzvf解压缩
grep 按行提取,用于所搜关键字
find查找文件