Running Ubuntu, I open a terminal and do
sudo bash cd / ls | head -n 1000 And predictably about 20 directories are returned.
However, if I do an ls, and don't pipe it into anything, the ls just hangs there until I kill it from another terminal. What could be happening?
EDIT:
> type ls ls is aliased to `ls --color=auto` EDIT:
> /bin/ls / <normal response> > /bin/ls --color=auto <hangs indefinitely> Why is coloring the output of ls causing this command to hang?
type lsto check any possible aliases etc.strace lscan potentially help you identify the issue.stracedisplays all system calls made by the program it invokes./bin/ls(or rather,command ls) to runlswithout the aliased options, to confirm whether or not it is the color option that is making a difference. FWIW,lsturns off coloring when its output is a pipe or other non-terminal device.\ls