linux命令-cut/sed

一、cut:从一行上移除部分内容,选择性显示

1)cut -cnum1-num2 filename

➜  Downloads  cat example 
helloworld!usa!china!
➜  Downloads  cut -c6-13 example 
world!us

 2)cut -d 'sep' -f cnum filename

➜  Downloads  cut -d '!' -f 3 example
china

猜你喜欢

转载自mingren135.iteye.com/blog/1893022