cut : display the specific fragments, -d delimiter -f fileds filename
[root@localhost ~]# ifconfig eth0|grep 'inet add'|cut -d : -f 2 |cut -d " "
[root@localhost ~]# uname -a|cut -d " " -f 3,5,10,11,12
4.12.0-rc6-g48ec1f0-dirty 2017 i586 GNU/Linux
[root@localhost ~]# ifconfig
Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[root@localhost ~]# ifconfig|grep 'inet addr'|cut -d : -f 2|cut -d " " -f 1
127.0.0.1
[root@localhost ~]#
split -b bytes file_name -d -a length[number] new_file_prefix
split -l lines_number_each_file -d -a number_length_in_name new_file_prefix
[root@localhost ~]# split -b 20k temp -d -a 5 new_f
[root@localhost ~]# ls
f1 new_f00003 new_f00010 new_f00017 new_f00024 new_f00031
f2 new_f00004 new_f00011 new_f00018 new_f00025 temp
f3 new_f00005 new_f00012 new_f00019 new_f00026
f4 new_f00006 new_f00013 new_f00020 new_f00027
new_f00000 new_f00007 new_f00014 new_f00021 new_f00028
new_f00001 new_f00008 new_f00015 new_f00022 new_f00029
new_f00002 new_f00009 new_f00016 new_f00023 new_f00030
[root@localhost ~]$ split -l 1000 temp -d -a 6 lines_f
[root@localhost ~]ll
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000000
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000001
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000002
-rw-r--r-- 1 mmxpa 197609 59683 3月 14 14:34 lines_f000003
-rw-r--r-- 1 mmxpa 197609 61030 3月 14 14:34 lines_f000004
-rw-r--r-- 1 mmxpa 197609 60402 3月 14 14:34 lines_f000005
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000006
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000007
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000008
-rw-r--r-- 1 mmxpa 197609 60716 3月 14 14:34 lines_f000009
-rw-r--r-- 1 mmxpa 197609 29241 3月 14 14:34 lines_f000010
-rw-r--r-- 1 mmxpa 197609 635368 3月 14 14:26 temp
[root@localhost ~]
网友评论