find command nonrecurslu listing ls -lrt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find command nonrecurslu listing ls -lrt
# 1  
Old 09-26-2008
find command nonrecurslu listing ls -lrt

----------------------------------------------------------------------
I have tried
find . type -f -exec ls -lrt {} \;
but it listed files recursively ,I need only that dir files not internal dir file.
---------------------------------------------------------------------
# 2  
Old 09-26-2008
What's wrong with ls?

Code:
ls -ltr

# 3  
Old 09-26-2008
Quote:
Originally Posted by RahulJoshi
----------------------------------------------------------------------
I have tried
find . type -f -exec ls -lrt {} \;
but it listed files recursively ,I need only that dir files not internal dir file.
---------------------------------------------------------------------
Remove (-r) , man ls
# 4  
Old 09-26-2008
I _think_ the OP means recursively, not in reverse order.
# 5  
Old 09-26-2008
Now I _think_ that the OP need maxdepth 1, however I don't understand why he need -r ?
Code:
find . -maxdepth 1 -type f -exec ls -lrt {} \;

# 6  
Old 09-26-2008
@OP, using find to do a listing on 1 level of directory is redundant. use ls , as radoulov stated.
# 7  
Old 09-26-2008
Thanks all ,but this code show error :
find . -maxdepth 1 -type f -exec ls -lrt {} \;
find: 0652-017 -maxdepth is not a valid option.

please resove this problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Getting files through find command and listing file modification time upto seconds

I have to list the files of particular directory using file filter like find -name abc* something and if multiple file exist I also want time of each file up to seconds. Currently we are getting time up to minutes in AIX is there any way I can get file last modification time up to seconds. (4 Replies)
Discussion started by: Nitesh sahu
4 Replies

2. UNIX for Dummies Questions & Answers

Listing only the files under a directory from the result of find command

Hi, I have a main folder 'home'. Lets say there is a folder 'bin' under 'home'. I want to check the list of files under subdirectories present under the /bin directory created in the last 24 hours. I am using the following find command under home/bin directory: find . -mtime -1 -print ... (3 Replies)
Discussion started by: DJose
3 Replies

3. UNIX for Dummies Questions & Answers

What does total no. of files in ls -lrt o/p means?

when we fire ls -lrt command we see o/p as total 16 drwx------ 9 root root 8192 May 8 2002 lost+found drwxr-xr-x 2 root root 512 Jun 14 2002 TT_DB drwxrwxr-x 2 root root 512 Jul 31 2002 mail here total no. of files is always greater than... (4 Replies)
Discussion started by: Jcpratap
4 Replies

4. Shell Programming and Scripting

find command listing

Hello, I have been trying to understand how the 'find' command lists the search results. I have a list of songs in different file formats (mp3, wav, aac etc) in a huge directory hierarchy organized by genre and am trying to get the list of all songs of a particular format. I found ls -R... (9 Replies)
Discussion started by: ajayram
9 Replies

5. Shell Programming and Scripting

Problems with ls -lrt

I am doing ls -lrt and it does not respond and have to close the xterm ls works ok (4 Replies)
Discussion started by: kristinu
4 Replies

6. UNIX for Dummies Questions & Answers

Long listing of files using find command on remote server via SSH

Hi , I am trying to find some files on a remote machine using the find command. >ssh -q atukuri@remotehostname find /home/atukuri/ -name abc.txt /home/atukuri/abc.txt The above command works fine and lists the file, but if I want to do a long listing of files (ls -l) its not working . ... (2 Replies)
Discussion started by: atukuri
2 Replies

7. UNIX for Dummies Questions & Answers

find command -- listing files twice

I noticed the other day that after i used the find command to search for some files, the computer listed them twice -- first with just the names of the files (meaning ./(then the individual file names), then with the directory name, followed by the file names (./directory name/file name). I was... (2 Replies)
Discussion started by: Straitsfan
2 Replies

8. UNIX for Dummies Questions & Answers

using ls -lrt instead of ls

I have a requirement in which I shud use ls -lrt instead of ls command because when we use ls command we get an error..the script part where i get error is given below for SAPRESPONSEFILES in `ls $SAPRESPONSEGOFILE | sed "s/go/dat/g"` basically the script processes the files of format... (11 Replies)
Discussion started by: praviper
11 Replies

9. Shell Programming and Scripting

Find problem listing directories even -type f

Hi All, #!/bin/ksh find /home/other -ls -type f -xdev | sort -nrk7 | head -2 >bigfile.txt The above is my script, which writes the large file into a file called bigfile.txt. My script contains only the above two lines. after execution i am getting the output like find: cannot chdir to... (1 Reply)
Discussion started by: Arunprasad
1 Replies

10. UNIX for Dummies Questions & Answers

Find files older than 5 days and remove tem after listing

need help with this ... Find files older than 5 days and remove tem after listing list "test" file older than 5 days and then remove them (1 Reply)
Discussion started by: ypatel6871
1 Replies
Login or Register to Ask a Question