unable to list the files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers unable to list the files
# 1  
Old 01-05-2009
unable to list the files

Hi,

$ ls -ltr *.log

Error :
argument list too long: ls

How to rectify this ?
# 2  
Old 01-05-2009
Hi risshant,

Pls try with the below command to list the files.

find . -name "*.log" -exec ls -ltr {} \;

Thanks
# 3  
Old 01-05-2009
This won't work as intended, as find passes only one argument at a time to ls, rendering -t (sort by time) and -r (reverse sorting) useless.
If you want the files newer than a certain timespan use
Code:
find . -prune -name '*.log*' -mtime -20 -print|xargs ls -ltr

(finds files modified in the last 20 days, without recursion, and passes them to ls -ltr)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unable to ssh and list files in local directory from remote.

#!/bin/bash script_work_dir="/home/websys/TEST_dpi_42_file_trnsfer_engine/PORT22/script_work_area" script_config_dir="/home/websys/TEST_dpi_42_file_trnsfer_engine/PORT22/script_config" dpi_sourceServerList=$script_config_dir"/dpi_sourceServerList" dpi_srvr_42="rtm@1.1.1.1"... (8 Replies)
Discussion started by: sadique.manzar
8 Replies

2. Solaris

Unable to list files in a directory

Hi have a system running solaris with a mount point running 58% capacity used, but unfortunately when I type ls -lrtin a specific directory, it returns: ls: Not enough space. I suspect there are millions of files in this directory. So what I did is to create a script like this: touch -mt... (13 Replies)
Discussion started by: fretagi
13 Replies

3. UNIX for Dummies Questions & Answers

Unable to list folder contents

I'm unable to list the contents of a directory once I move into it. I have full permissions on this directory (called "Scripts" in the below example). The scenario is shown below in detail: Command 'ls' works fine to begin with: 1: pmn@linuxhost /home/pmn > cd /opt/smt/proiv 2:... (4 Replies)
Discussion started by: pmn
4 Replies

4. Shell Programming and Scripting

Unable to list particular file in dir.

Hi i am trying to list all the file starting with CSA.CHENAISCP* i am using below command to do that ls -lrt | grep CSA.CHENAISCP*however i am getting below error. 0403-027 The parameter list is too long.please suggest me some alternative way. scriptor (3 Replies)
Discussion started by: scriptor
3 Replies

5. Shell Programming and Scripting

Unable to list files in ascending order

Hi ! I am just trying to list my files in ascending order so that in some other software, I just want merge with some modification, when I list its coming like this new-10.txt new-11.txt new-12.txt new-13.txt new-14.txt new-15.txt new-16.txt new-17.txt new-18.txt new-19.txt... (2 Replies)
Discussion started by: nex_asp
2 Replies

6. Red Hat

Unable to copy files due to many files in directory

I have directory that has some billion file inside , i tried copy some files for specific date but it's always did not respond for long time and did not give any result.. i tried everything with find command and also with xargs.. even this command find . -mtime -2 -print | xargs ls -d did not... (2 Replies)
Discussion started by: before4
2 Replies

7. Shell Programming and Scripting

Take a list if strings from a file and search them in a list of files and report them

I have a file 1.txt with the below contents. -----cat 1.txt----- 1234 5678 1256 1234 1247 ------------------- I have 3 more files in a folder -----ls -lrt------- A1.txt A2.txt A3.txt ------------------- The contents of those three files are similar format with different data values... (8 Replies)
Discussion started by: realspirituals
8 Replies

8. Shell Programming and Scripting

unable to put cc list in mailx

Hi, I am using mailx command to send mail. But unable to use -c option to send mails by cc list. eg. ..mailx -s "subject" -c "CCLIST" "TOLIST" Its showing " illegal option -- c" I am using HP UX. Can anybody help me out. Thanks in advance..! (3 Replies)
Discussion started by: Kattoor
3 Replies

9. UNIX for Dummies Questions & Answers

I'm unable to run Keyed List commands(in ubuntu's terminal and Evolane Tcl Engine)

I'm trying to run these commands (keylset,keylget) but i keep getting a error message "invalid command name "keylset"". I've tried running it on both ubuntu's terminal and also Evolane Tcl Engine. Any idea what could be the problem? (1 Reply)
Discussion started by: abe171
1 Replies

10. UNIX for Dummies Questions & Answers

Unable to get initial list of users

I cannot access the Accounts Manager facility when using SCO (F2 Screen) or scoadmin from the Command prompt. when using System Administration screen the Error "Unable to get initial list of users" is given. (0 Replies)
Discussion started by: Waitstejo
0 Replies
Login or Register to Ask a Question