Basically I want do the following:
ls -l[+someflags]
(or by some other means) that will only display files that are symbolic links
so the output would look
-rw-r--r-- 1 username grp size date-time filename -> somedir
-rw-r--r-- 1 username grp size date-time filename2 -> somsdfsdf
etc.
For example,
to show only directories I have an alias:
alias lsd 'ls -l | grep ^d'
I wonder how to display only hidden files or only hidden directories?
I have the following solution, however it doesn't display the output in color :(
ls -ltra | grep '\->'
You were almost there with your grep solution; let's focus on getting you COLOR again.
Try this:
Improving a little on the accepted answer given by @ChristopheD (coudnt comment on the accepted answer since I dont have enough reputation)
I use an alias
where the alias is
shows only symlinks (files and directories). Not sure how to get them colorful, though.
shows only hidden files/directories
shows directories only.
For bash:
This provides a nice output.
To display JUST the symlinks and what they link to:
To limit to JUST THIS DIR
Example output (after ln -s /usr/bin moo):
For (t)csh:
(This is simply pbr's answer but with the hyphen escaped.)
Mac OSX
On OSX,
ls
works differently, so add this to your~/.cshrc
file:And then call: