linux 中cut -b和cut -c的区别

 

-b:以字节为单位进行截取。

-c:以字符为单位进行截取。

001、

[root@PC1 test1]# ls
a.txt  b.txt
[root@PC1 test1]# cat a.txt
ewr23436546cfgfd
[root@PC1 test1]# cut -b 2 a.txt
w
[root@PC1 test1]# cut -c 2 a.txt
w

 

 

002、

[root@PC1 test1]# ls
a.txt  b.txt
[root@PC1 test1]# cat b.txt
大师傅额外的是否
[root@PC1 test1]# cut -b 2 b.txt
▒
[root@PC1 test1]# cut -c 2 b.txt

 

posted @ 2022-11-02 10:52  小鲨鱼2018  阅读(692)  评论(0编辑  收藏  举报