- 論壇徽章:
- 32
|
我來拿吧~ - split -b 100M file
- ls x* | sort | awk '{f=sprintf("abc_%03d.txt",++i);system("mv "$0" "f)}'
復(fù)制代碼 以下是測試過程:- [root@localhost test]# ls
- [root@localhost test]# dd if=/dev/zero of=file bs=150M count=1
- 記錄了1+0 的讀入
- 記錄了1+0 的寫出
- 157286400字節(jié)(157 MB)已復(fù)制,1.6806 秒,93.6 MB/秒
- [root@localhost test]# ll -h
- 總用量 150M
- -rw-r--r--. 1 root root 150M 7月 16 20:06 file
- [root@localhost test]# split -b 100M file
- [root@localhost test]# ll -h
- 總用量 300M
- -rw-r--r--. 1 root root 150M 7月 16 20:06 file
- -rw-r--r--. 1 root root 100M 7月 16 20:06 xaa
- -rw-r--r--. 1 root root 50M 7月 16 20:06 xab
- [root@localhost test]# ls x* | sort | awk '{f=sprintf("abc_%03d.txt",++i);system("mv "$0" "f)}'
- [root@localhost test]# ll -h
- 總用量 300M
- -rw-r--r--. 1 root root 100M 7月 16 20:06 abc_001.txt
- -rw-r--r--. 1 root root 50M 7月 16 20:06 abc_002.txt
- -rw-r--r--. 1 root root 150M 7月 16 20:06 file
- [root@localhost test]# rm -f *
- [root@localhost test]# dd if=/dev/zero of=file bs=230M count=1
- 記錄了1+0 的讀入
- 記錄了1+0 的寫出
- 241172480字節(jié)(241 MB)已復(fù)制,1.49992 秒,161 MB/秒
- [root@localhost test]# ll -h
- 總用量 230M
- -rw-r--r--. 1 root root 230M 7月 16 20:07 file
- [root@localhost test]# split -b 100M file
- [root@localhost test]# ll -h
- 總用量 460M
- -rw-r--r--. 1 root root 230M 7月 16 20:07 file
- -rw-r--r--. 1 root root 100M 7月 16 20:08 xaa
- -rw-r--r--. 1 root root 100M 7月 16 20:08 xab
- -rw-r--r--. 1 root root 30M 7月 16 20:08 xac
- [root@localhost test]# ls x* | sort | awk '{f=sprintf("abc_%03d.txt",++i);system("mv "$0" "f)}'
- [root@localhost test]# ll -h
- 總用量 460M
- -rw-r--r--. 1 root root 100M 7月 16 20:08 abc_001.txt
- -rw-r--r--. 1 root root 100M 7月 16 20:08 abc_002.txt
- -rw-r--r--. 1 root root 30M 7月 16 20:08 abc_003.txt
- -rw-r--r--. 1 root root 230M 7月 16 20:07 file
- [root@localhost test]#
復(fù)制代碼 |
|