writing the output from split command to a separate directory

≡放荡痞女 提交于 2020-01-14 14:39:11

问题


So I'm using split command to split a file into separate lines and save them into a different directory than the current directory which I'm executing the command.

split -l 1 -d -a 5 --additional-suffix=.txt file1.dat file toindex/

so i want the output files to be written inside toindex/, but this gives me a error saying: split: extra operand ‘toindex/’. This works fine if I don't have the output dir path or don't have the prefix ("file").

How do I get this to work? I need to have the prefix as well as the additional-suffix.


回答1:


Try:

split -l 1 -d -a 5 --additional-suffix=.txt file1.dat toindex/file

Note that the directory toindex must exist.



来源:https://stackoverflow.com/questions/34391181/writing-the-output-from-split-command-to-a-separate-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!