Bugzilla – Bug 153303
ls options as root include -a rather than -A
Last modified: 2006-04-27 15:14:31 UTC
default $LS_OPTIONS as root are -a -N --color=tty -T 0 so ls gets aliased to /bin/ls -a -N --color=tty -T 0 this means . and .. are in directory listings, and -A does not override, this can be annoying when trying to for example copy all files starting with . perhaps -A would be more sensible than -a by default?
I don't think I get your point here. Why is it a problem to copy all hidden files? If you use the shell's file completion feature it will always include `.' and `..'?
copying all hidden files was just one example, but can you think of a good reason /for/ having . and .. in the path, given that it causes problems doing some things. for example to copy hidden files one could do: for i in $(ls -A | grep '^\.'); do cp $i /someplace; but as ls is aliased to "ls -a" then the above copies everything in the current folder, not just the hidden files, as -a overrides -A.
Benjamin, what has `ls' to do with either of your examples? `ls' is no shell-builtin and `cp' neither? Your example would work because cp would omit `.' and `..' because they are directories. However changing LS_OPTIONS would change nothing of this behaviour.
I'm sorry, if I were doing "cp -r" rather than just cp, then . and .. would not be excluded and everything would be copied. and changing LS_OPTIONS would change this behaviour, as with -a in LS_OPTIONS gives : lcars:/home/benji # ls -A | head -n 2 . .. and without -a in LS_OPTIONS gives: benji@lcars:~> ls -A | head -n 2 .bash_history .bashrc
OK I got it. You can use quotes with the command this would not apply the alias including the $LS_OPTIONS. Werner: Please decide what should be done.
We do nothing. Root has to see all files even hidden files. This is a security requirement and will not changed.
I think you are misunderstanding, -A still shows all files even hidden files, it just doesn't show "." and ".." (current and parent directories) If you can think of a good reason for including these in the directory listings by default then I'll understand, but afaik other distros all have -A in options by default, not -a.
OK, I've changed -a to -A
why did you change l and la? I don't care about plain ls but for l -A sucks. I do want to see the permissions of the directory I am in when using l. l is suse specific anyways and I loved it just the way it used to be.
Please discuss this with Benjamin Weber.
He didn't even mention l or la, only ls.
OK -A for ls and -a for l and la