ls -A | xargs chown -R chris ?
On Thu, 2009-03-12 at 21:04 +0000, Chris G wrote:
I often have this problem! :-)
How can one refer to all one's own files and directories easily?
E.g. I am sitting at /home/chris and, for whatever reason, I want to apply a command to all the files, including hidden files.
A command like this for example (where I have moved some files in which belong to someone else), I become root and do:-
chown -R chris *
Well, that's OK but it doesn't include hidden files, so:-
chown -R chris .*
That's no good either because it tries to run the command on .. as well as . and the hidden files.
There are things like:-
chown -R chris .[a-zA-Z][a-zA-Z]*
but it feels like there should be an easier way. I know there's better syntax than [a-zA-Z][a-zA-Z]* (using + I think), but it's still hardly elegant.