Question

I did a lot of customization to bash recently, and I've noticed a small but frustrating problem. When I enter $ ls -a into my home directory it lists all the files and directories one per line rather than the normal two or three per line. What is particularly strange is that this does not happen with $ ls or $ ls -a into any other directory the output is standard.

It only happens with the -a flag when in my home directory. Has anyone else encountered this problem, and have any tips on solving it?

Was it helpful?

Solution

It sounds like you have a particularly long dotfile in your home dir.

ls shows files in columns, but if one filename is exceptionally long, it can only fit one column.

Here's a command that will show the longest filenames in your ls output:

ls -a | awk '{print length($0), $0}' | sort -n
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top