歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> cut 命令 通過列來提取文本字符,cut文本

cut 命令 通過列來提取文本字符,cut文本

日期:2017/3/3 17:32:35   编辑:學習Linux

cut 命令 通過列來提取文本字符,cut文本


熱度3 評論 64 www.BkJia.Com 網友分享於: 2017-02-13 04:02:10 浏覽數43327次

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]#

 

Copyright © Linux教程網 All Rights Reserved