Question

To list files I use ls. I know how to list almost (-A) or all (-a) of them. But when I try to show the hidden files and hide the shown files I'm out of luck with:

ls --hide='*' -A

The behavior that the -A option neutralizes the --hide option is described in the documentation of ls.

So is there another option to ls I could use? The find-xargs-ls combo cannot be the only solution, right?

Was it helpful?

Solution

Indeed, use:

ls -A -I'*'

In order to ease my everday command line experience with the bash shell I defined the following aliases building on top of each other:

alias ls="ls -h --color=auto"
alias lsa="ls -A"
alias lsh="lsa -I'*'"
alias ll="ls -l --time-style=long-iso"
alias lla="ll -A"
alias llh="lla -I'*'"
alias lv="ll -v"
alias lva="lv -A"
alias lvh="lva -I'*'"
alias lt="ll -t"
alias lta="lt -A"
alias lth="lta -I'*'"
alias lr="ll -R"
alias lra="lr -A"
alias lrh="lra -I'*'"

OTHER TIPS

To list only the dotfiles but omit . and .. :

alias ldot='ls -ld .??*'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top