Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux cut

# -c: cut string (e.g. cut from 1 to 10 chars)
cut -c 1-10 /etc/passwd

# -d SYMBOL set a SYMBOL be delimiter
# -f then -f show seperate part (e.g.  1,2,3,7,8  1-3,7-8)
cut -d : -f 1-2,4 /etc/passwd

# --complement exclude cut setting
cut -d : -f 1-2,4 --complement /etc/passwd
Source by blog.gtwang.org #
 
PREVIOUS NEXT
Tagged: #linux #cut
ADD COMMENT
Topic
Name
3+8 =