I would like to use an ls
alias (like l.
) to output a colored list, consisting of only hidden files & directories, whether or not they begin with a dot. Any suggestions?
Example of desired results...
## Listing all contents of $PWD
$ ls -AF
file directory/
.dot-file .dot-directory/
hidden-file hidden-directory/
## Listing all hidden contents of $PWD, using alias `l.`
$ l.
.dot-file .dot-directory/
hidden-file hidden-directory/
Research...
I've seen answers to similar questions. These answers are awesome, but don't quite accomplish what I'm asking because:
- They only display hidden dot files
- If I ran
chflags hidden file
, thenfile
would be excluded from thel.
output
- If I ran
- They are confined to displaying the hidden dot files in
grep
style, as opposed tols
style- This is important because I may want to throw a flag like
-l
on there
- This is important because I may want to throw a flag like
DETAILS
## Current `ls` alias
alias ls="ls -h ${COLORFLAG}"
I use both bash
& zsh
.
chflags hidden
bit was just an example, I appreciate the correction. – SuitAndCape Apr 13 '16 at 21:08