LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-24-2008, 10:00 AM   #1
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Rep: Reputation: 32
ls problem


I am trying to see some of the files in a directory but even when I do ls | tail -10, the command is slow (probably because of the large number of files) that nothing happens and I can not see any files. Any ideas?
 
Old 09-24-2008, 10:23 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by davholla View Post
I am trying to see some of the files in a directory but even when I do ls | tail -10, the command is slow (probably because of the large number of files) that nothing happens and I can not see any files. Any ideas?
You've got a large number of files. I've seen this happen lots, when a directory gets very, VERY full. You'll either get "argument list too long" or some other sort of error, if you've got tons of files.

I'd clean the directory up. A quick-and-dirty way would be to create a sub-directory, and do a "mv * ./<sub directory you just created name>", let it run a few seconds, and CTRL-C. There's a flag for MV that'll just move files, but I don't know what it is off the top of my head, check out the man page for mv.

Repeat those steps...soon you'll have all your files into separate sub-directories, of more manageable size. If the MV blows off due to too many files, you'll have to give it a finer filter, like "mv 1*.ext". I feel your pain...
 
Old 09-24-2008, 10:26 AM   #3
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by TB0ne View Post
You've got a large number of files. I've seen this happen lots, when a directory gets very, VERY full. You'll either get "argument list too long" or some other sort of error, if you've got tons of files.

I'd clean the directory up. A quick-and-dirty way would be to create a sub-directory, and do a "mv * ./<sub directory you just created name>", let it run a few seconds, and CTRL-C. There's a flag for MV that'll just move files, but I don't know what it is off the top of my head, check out the man page for mv.

Repeat those steps...soon you'll have all your files into separate sub-directories, of more manageable size. If the MV blows off due to too many files, you'll have to give it a finer filter, like "mv 1*.ext". I feel your pain...
Sadly or maybe happily it is not my directory but I will try using cp.

I do need to use these files so I am not too happy with this set up.
 
Old 09-24-2008, 10:58 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I would try to list them alphabetically and see if that works:

Code:
ls a*
ls b*
ls c*
Unless everything starts with the same letter.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:07 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
Open Source Consulting | Domain Registration