Mac bash拆分不能按行字节拆分
我想将文件按字节分割,同时通过Mac bash拆分不能按行字节拆分,bash,macos,Bash,Macos,我想将文件按字节分割,同时通过 split -C <bytes> filename 我已经安装了brew coreutils,它可以 如何将split更改为使用coreutils?brew install coreutils将默认安装前缀为“g”的命令。因此,如果键入gsplit,split应该可用 如果要使用原始名称使用命令,请将/usr/local/opt/coreutils/libexec/gnubin添加到$PATH 有关详细信息,请参阅和brew info coreuti
split -C <bytes> filename
我已经安装了brew coreutils,它可以
如何将split更改为使用coreutils?brew install coreutils将默认安装前缀为“g”的命令。因此,如果键入gsplit,split应该可用
如果要使用原始名称使用命令,请将/usr/local/opt/coreutils/libexec/gnubin添加到$PATH
有关详细信息,请参阅和brew info coreutils。默认情况下,brew install coreutils将安装前缀为“g”的命令。因此,如果键入gsplit,split应该可用
如果要使用原始名称使用命令,请将/usr/local/opt/coreutils/libexec/gnubin添加到$PATH
有关详细信息,请参阅和brew info coreutils。找到它
brew info coreutils
...
==> Caveats
All commands have been installed with the prefix 'g'.
所以它只是gsplit-C$BYTES文件名找到了它
brew info coreutils
...
==> Caveats
All commands have been installed with the prefix 'g'.
所以它只是gsplit-C$BYTES文件名请转到文件路径并执行以下命令 split-b 500m输入文件输出文件\u files.split.txt 范例
split-b 500m sample.txt输出_files.split.txt请转到文件路径并执行以下命令 split-b 500m输入文件输出文件\u files.split.txt 范例 split-b 500m sample.txt output_files.split.txt(默认名称)已从brew中删除,因此,如果您需要使用普通名称运行一个命令,则需要在路径中添加一些内容。见下文
brew info coreutils
...
==> Caveats
Commands also provided by macOS have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
-默认名称已从brew中删除,因此如果您需要使用其正常名称运行一个命令,则需要在路径中添加一些内容。见下文
brew info coreutils
...
==> Caveats
Commands also provided by macOS have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
-如果默认名称已弃用,请参阅我的答案感谢@louis_guitton,根据您的调查结果更新了答案。-如果默认名称已弃用,请参阅我的答案感谢@louis_guitton,根据您的调查结果更新了答案。