Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does listing the folders in unix take such a long command? [duplicate]

What can I do to map ls -l | grep ^d to lsf? I am wading around in the mess of files and folders and trying to just see the folders so it's easier to cd ... around to places.

like image 578
SwimBikeRun Avatar asked Jan 24 '26 15:01

SwimBikeRun


2 Answers

This should do it good sir

alias lsf='ls -l | grep ^d'

to add permanent, do this

echo "alias lsf='ls -l | grep ^d'" >> ~/.bash_profile
like image 187
Zombo Avatar answered Jan 26 '26 07:01

Zombo


If you are using a decent shell (i.e. ZSH) you can do

ls -d *(/)
like image 20
Michael Wild Avatar answered Jan 26 '26 07:01

Michael Wild



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!