LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2011, 01:16 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
Not able to run ls -ltr


Hi ,

Whenever i try to execute ls with ltr as an option the system hangs.

The workload on server is not more than 1.
What could be the reason .

Normal ls works fine but ls -ltr causes the system to hang.

Distribution details
Code:
# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)
Release:        5.2
Codename:       Carthage

Last edited by pinga123; 07-11-2011 at 01:36 AM.
 
Old 07-11-2011, 01:19 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
what is your working directory when you try this?
does it hang when you are in a different directory?
which distribution?

try just plain ls
then

ls -l
ls -t
ls -r

ls -lt
ls -lr
ls -ltr

note when it hangs.
 
Old 07-11-2011, 01:20 AM   #3
rabbit2345
Member
 
Registered: Apr 2007
Location: 中国上海
Distribution: openSUSE 11.3
Posts: 371

Rep: Reputation: 40
Hi,

Your problem seems very odd, but to identify the problem in more detail, try running each switch individually and see which one will hang the system. This way, we can isolate the problematic switch. Like this:
Code:
ls -l
ls -r
ls -t

good luck,
rabbit2345
 
Old 07-11-2011, 01:30 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Is it different for different users; specifically root vs normal user.
Check
Code:
which ls
for both and
Code:
ls -l
the result for both and post results so we can compare with our own.
 
Old 07-11-2011, 01:33 AM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by rabbit2345 View Post
Hi,

Your problem seems very odd, but to identify the problem in more detail, try running each switch individually and see which one will hang the system. This way, we can isolate the problematic switch. Like this:
Code:
ls -l
ls -r
ls -t

good luck,
rabbit2345
Code:
pwd
/usr/local/sbin
ls works find but ls -l causes the system to hang.
Code:
# which ls
alias ls='ls --color=tty'
        /bin/ls
I can see that the output is getting generated after 3-4 minutes.

See the comparison.
Code:
#time ls
real    0m0.004s
user    0m0.000s
sys     0m0.002s
#time ls -ltr
real    3m2.443s
user    0m0.003s
sys     0m0.002s

Last edited by pinga123; 07-11-2011 at 01:50 AM.
 
Old 07-11-2011, 11:52 PM   #6
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
It was a problem of ownership .When i tried executing ls -n it resulted in faster responce .
-n option make sure that only uid and gid are displayed.

So i figured out that one of the folder has wrong ownership.
I changed the ownership of the folder and the problem is solved.
 
Old 07-13-2011, 05:48 PM   #7
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
well done and thanx for sharing.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LITE-ON LTR-52246S not detected by cdrecord Armon Linux - Hardware 2 07-10-2006 12:52 AM
Lite-On LTR-40125S only burns cd-rw's not cd-r's corso64 Fedora 0 02-03-2005 10:49 AM
Lite-On LTR-40125S only burns cd-rw's not cd-r's corso64 Linux - Hardware 0 02-03-2005 12:47 AM
Problems with cd/r lite-on ltr-16102b Fulminedio Linux - Hardware 1 08-10-2004 06:57 PM
LITE-ON cdrw # LTR-12101b chilibowl Linux - Hardware 3 07-27-2004 03:16 PM


All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration