4 ms·
tar is like that because of command lines tar [args] [one thing] [list of things] it'd be wierd if it was tar [args] [list of things] [filename] ... but i w
by joshu 16y ago
tar is like that because of command lines
tar [args] [one thing] [list of things]
it'd be wierd if it was
tar [args] [list of things] [filename]
... but i will admit i frequently make that mistake.
- ramidarigaz 16y agoBut, as a counterpoint, if you want to copy several things to a folder, you do: cp [args] [list of things] [destination folder]
- BrandonM 16y agoBut you can also do cp [args] -t [destination folder] [list of things] The same is true of mv. This is useful if you are piping filenames to xargs.
- Nick_C 16y agoThanks! I always wondered what was the purpose of -t. Never occurred to me it was to allow you to reverse the order of args.
- Sharlin 16y agotar is actually tar [args] [list of things] where [args] may contain [-f filename], among other things. That is, the destination filename is an optional argument; by default tar outputs to a tape device or stdout, depending on the implementation. At least in GNU tar, the target filename can very well be specified as the last argument: tar -c foo.txt bar.txt baz.txt -f stuff.tar
- joshu 16y agogood point!