Sort and Clean
How
- Pipe output to
sortto alphabetize:ls | sort - Use
sort -uto sort and remove duplicates - Or use
uniqto remove duplicate lines:command | uniq - Combine them:
ls | sort | uniq
Try this
Run ls ~ | sort to see your home directory files sorted alphabetically. Compare it to plain ls ~ to see the difference.
Why it works
Make messy lists usable.