cut 命令 通过列来提取文本字符,cut文本


格式:cut [参数] 文本

参数:-d [分隔符]  指定分割符,默认为TAB

   -f       指定显示的列数

   -c       单位改为字符  

示例:查看系统中所有的用户名

[root@localhost network-scripts]# cut -d : -f 1 /etc/passwd
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
operator
games
ftp
nobody
dbus
polkitd
unbound
colord
usbmuxd
avahi
avahi-autoipd
libstoragemgmt
saslauth
qemu
rpc
rpcuser
nfsnobody
rtkit
radvd
ntp
chrony
abrt
pulse
gdm
gnome-initial-setup
postfix
sshd
tcpdump
dagege

[root@localhost network-scripts]#

 

相关内容