执行split -a 3 -b `expr 100 \* 1024` --numeric-suffixes=100 "uImage" "./u.ext3-"会报错split: option '--numeric-suffixes' doesn't allow an argument。
根本原因是当前使用的split版本较低。
Ubuntu12.04中的版本为8.13:
root@ubuntu:/# split --version
split (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjörn Granlund and Richard M. Stallman.
---------------------------------------------
root@ubuntu:/aaron/toradex/nvida/split-test# split --help
Usage: split [OPTION]... [INPUT [PREFIX]]
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default
size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT
is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-a, --suffix-length=N use suffixes of length N (default 2)
-b, --bytes=SIZE put SIZE bytes per output file
-C, --line-bytes=SIZE put at most SIZE bytes of lines per output file
-d, --numeric-suffixes use numeric suffixes instead of alphabetic(此处没有指明可以接收起点的参数)
-e, --elide-empty-files do not generate empty output files with `-n'
--filter=COMMAND write to shell COMMAND; file name is $FILE
-l, --lines=NUMBER put NUMBER lines per output file
-n, --number=CHUNKS generate CHUNKS output files. See below
-u, --unbuffered immediately copy input to output with `-n r/...'
--verbose print a diagnostic just before each output file is opened
--help display this help and exit
--version output version information and exit
SIZE may be (or may be an integer optionally followed by) one of following:
KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
Ubuntu14.04中的版本为8.21:
root@ubuntu:/aaron/split-test# split --version
split (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjörn Granlund and Richard M. Stallman.root@ubuntu:/aaron/split-test# split --help
Usage: split [OPTION]... [INPUT [PREFIX]]
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default
size is 1000 lines, and default PREFIX is 'x'. With no INPUT, or when INPUT
is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-a, --suffix-length=N generate suffixes of length N (default 2)
--additional-suffix=SUFFIX append an additional SUFFIX to file names.
-b, --bytes=SIZE put SIZE bytes per output file
-C, --line-bytes=SIZE put at most SIZE bytes of lines per output file
-d, --numeric-suffixes[=FROM] use numeric suffixes instead of alphabetic.
FROM changes the start value (default 0).(此处指明可以接收起点的参数)
-e, --elide-empty-files do not generate empty output files with '-n'
--filter=COMMAND write to shell COMMAND; file name is $FILE
-l, --lines=NUMBER put NUMBER lines per output file
-n, --number=CHUNKS generate CHUNKS output files. See below
-u, --unbuffered immediately copy input to output with '-n r/...'
--verbose print a diagnostic just before each output file is opened
--help display this help and exit
--version output version information and exit
SIZE is an integer and optional unit (example: 10M is 10*1024*1024). Units
are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000).
Ubuntu14.04可以正常执行,Ubuntu12.04会报错。
root@ubuntu:/aaron/split-test# ls
u.ext3-100 u.ext3-110 u.ext3-120 u.ext3-130 u.ext3-140 u.ext3-150
u.ext3-101 u.ext3-111 u.ext3-121 u.ext3-131 u.ext3-141 u.ext3-151
u.ext3-102 u.ext3-112 u.ext3-122 u.ext3-132 u.ext3-142 u.ext3-152
u.ext3-103 u.ext3-113 u.ext3-123 u.ext3-133 u.ext3-143 u.ext3-153
u.ext3-104 u.ext3-114 u.ext3-124 u.ext3-134 u.ext3-144 uImage
u.ext3-105 u.ext3-115 u.ext3-125 u.ext3-135 u.ext3-145
u.ext3-106 u.ext3-116 u.ext3-126 u.ext3-136 u.ext3-146
u.ext3-107 u.ext3-117 u.ext3-127 u.ext3-137 u.ext3-147
u.ext3-108 u.ext3-118 u.ext3-128 u.ext3-138 u.ext3-148
u.ext3-109 u.ext3-119 u.ext3-129 u.ext3-139 u.ext3-149
附:Linux命令学习手册-split命令