On Tue, Dec 19, 2017 at 11:16 PM, David Christensen <dpchr...@holgerdanske.com> wrote: > On 12/19/17 14:07, Dan Hitt wrote: >> >> Just for reference, although the attributes exist and i ithink are >> exactly what i need, it looks like the system has to be nudged a >> little to use them. >> >> So, for example, with cp, you need to do 'cp -a' to carry along the >> attributes ('cp -p' is not enough). >> >> Also, it looks like tar has to be told about the attributes both on >> the way in and on the way out: >> tar --xattr -cf my_archive.tar my_file >> tar --xattr -xf my_archive.tar
I goofed here, should have been tar --xattrs -cf my_archive.tar my_file tar --xattrs -xf my_archive.tar >> >> It would be nice if the system could be told to use attributes by default. > > > How about using aliases? > > > For example, in my ~/.bashrc: > > alias cp='cp -ip' > alias mv='mv -i' > > > See bash(1) ALIASES. > > > David > Thanks David. That's a good idea, so i aliased cp to '/bin/cp -ai' It was a little more problematic for tar (for me, at least), and i also goofed on the tar command above :( (correction inline). For tar, when you use the '--xattrs' option, then you must precede your 'cf' or 'xf' with a dash. So an alias of tar='tar --xattrs' changes how you type your tar command. (But maybe that's just a poor choice of alias for me.) And there's another very common program, for me, anyway, which is rsync. For rsync, you need to add the -X option. So i also aliased that (rsync=/usr/bin/rsync -X). So i do still think that a global option would be useful, as the commands with options for paying attention to attributes keep dribbling in, but your alias idea is very helpful. One other point on this whole attr business is that apparently the attr program only acts on one file at a time. That point however i can't really complain about, because if i'm unhappy, i can just write my own attr program which will allow multiple files to be specified. And for my use case, i probably won't have to use attr so much anyway (just the attributes themselves, via the interface that Roberto pointed out). Thanks again everybody for your help, and thanks Tomas for pulling me out of the dark ages!! :) dan