Sort in .bashrc
Im trying to setup .bashrc so I can put it in skel. But first I want to have it so "normal" ppl (aka windows users) can read the out put. So what I was thinking is to set it up so it lists this in order, dir then files. But also alphabeticaly.
So far I can do either ls -la (then I got sort) or ls -Ula (then I got dirs first, unsorted). I did check the man pages. Could not figure out who to accomplish this, so Im asking here... :) Any one care to give me a hint? Thanks! |
I don't know of any option to accomplish what you're shooting for. This might do what you need:
Code:
alias dir='ls -lA | grep "^d" | sort -k 9; ls -lA | grep -v "^d" | grep -v "^total" | sort -k 9' |
Yeah! That works! :)
Thanks!!! Edit: How do I get the colors to work with this? |
I'm not sure that you can. The output of "ls" is being fed through other commands, and they are likely stripping off the special character sequences that denote color changes.
|
Its looking good anyhow! Thanks alot!
|
All times are GMT -5. The time now is 08:12 PM. |