General discussion


'ls' hangs session but 'ls | more' works

By wbarker ·
This is probably a stty setting but I've tried several and I can't find it.

When I log in to a UNIX box through a network, any command that causes lots of text to scroll past on my terminal window causes telnet to hang.

In a directory with 308 items, I can do 'ls | more' and see all the contents, I can also do 'ls | wc' to see the number of items, but when I do 'ls' or 'ls -l', the session echos back a newline and then hangs. I can't break out with ctrl-C or ctrl-D, but ctrl-] brings me back to my local shell.

Other users who aren't as far away physically from the machine can telnet to it and do an 'ls'. I have tried multiple telnet clients (netterm and telnet from Windows), I have tried multiple computers from my more distant site without luck also.

This was working a week ago.

Any ideas?

This conversation is currently closed to new comments.

12 total posts (Page 1 of 2)   01 | 02   Next
Thread display: Collapse - | Expand +

All Comments

Collapse -

by jmgarvin In reply to 'ls' hangs session but 'l ...

Check your shell configuration file (eg. .bashrc) and see if ls hasn't been aliased.

It sounds like your problem is that ls doesn't work in that particular directory or is it all directories?

Collapse -

by jmgarvin In reply to

Have you also checked your various initializiation scritps for any wonky characters that may have an affect on this?

Collapse -

by wbarker In reply to

Poster rated this answer.

Collapse -

by wbarker In reply to 'ls' hangs session but 'l ...

This happens in any directory with many items, when doing 'cat'ing a file to see contents (if there are more than a couple hundred lines), and even when logging in if there's a large disclaimer text splash configured on login.

Collapse -

by Black Panther In reply to 'ls' hangs session but 'l ...

Has something changed along the network? If it was working a week ago something may have changed?

Are you able to go to a closer site using your login to make sure it works ( or get someone else to use your login at the closer site ).

Can you use someones login at your site to see if the same thing happens?

How long do you wait to know it is hung?? If there is a great distance involved depending on how much data needs transferring it might take some time - especially if you are logged on via a slow link.

Have you tried this stty setting

# stty ixon ixany


# stty sane

This sets ixon mode, which lets you stop runaway listing by pressing the
Ctrl-S key sequence. The ixany flag allows you to resume the listing by
pressing any key. The normal workstation configuration includes the ixon
and ixany flags, which allows you to stop a listing with the Ctrl-S key
sequence that only the Ctrl-Q key sequence will restart.

Collapse -

by wbarker In reply to

I'm not aware of anything having changed in the network. This is a site-to-site VPN connection over dual-T1's.

I had someone else that's on-site there login using this account and they had no problems. I had a new account generated and it has the same problem for me from my remote site.

I only wait about 10 minutes. When I do ls|more, it comes back instantly and when I do ls it comes back instantly to put me onto a new line.

I tried those stty settings but they didn't resolve the issue for me. Any other ideas?

Collapse -

by Black Panther In reply to 'ls' hangs session but 'l ...

The only other suggestion I would have is to get the VPN Line Checked. Does ls -x work??

Collapse -

by solrak29 In reply to 'ls' hangs session but 'l ...

Does this only happen in a certain directory or any directory....I may be reaching far for this one but, could there be a file stored there with escape characters as its name that is affecting your terminal? The "more" application and/or feeding it through the pipe may be not allowing the control characters to take affect to the terminal.

Collapse -

by wbarker In reply to

Poster rated this answer.

Collapse -

by sarahmeggs In reply to 'ls' hangs session but 'l ...

* check the number of files in the directory you are trying to ls. if there are too many, it could hang
* check the performance of the machine - if too overloaded CPU wise, then any command that will tax the machine will hang. (perhaps even ps)

Back to Linux Forum
12 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums