Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to list files Created in last 2 hrs Post 302293010 by shivamdhawan on Monday 2nd of March 2009 05:56:44 AM
Old 03-02-2009
find /admin//dump -type f -newer t.tmp -print -exec ls -lt {} \; | pg

This looks good but I am not able to understand this command...can you explain it?
:?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

command unix to list all files created since n month ago

Hello, I want to list all files that were created since 3 month ago. it exist a unix command to do it ? thank you (8 Replies)
Discussion started by: yacsil
8 Replies

2. Shell Programming and Scripting

List Files & Folders created/modified

Hello people, I want to list the files & folders created/modified since a particular date say June 2006. I know I can list recursively thru the folders and use awk to extract the date column to get the desired output. Just wanted to check whether there is an easier way to do this. Please... (2 Replies)
Discussion started by: tipsy
2 Replies

3. Shell Programming and Scripting

List files created between specific date and time

Hi I need to write a script to list files in a directory created within specific date and time for eg list files created between Apr 25 2007 11:00 to Apr 26 2007 18:00. and then i have to count them Any suggestions pls ? (3 Replies)
Discussion started by: jazjit
3 Replies

4. Filesystems, Disks and Memory

How to list files with specific created date

Hi, Would like to ask, which command is used to list all the files for specific date (says 1st May) and its size, for all files (including its subdirectory), in a mounted NFS disk to HP-UX. I would like to check for the total files came into my disk on 1st May. Very much appreciating your... (2 Replies)
Discussion started by: Draculla
2 Replies

5. Solaris

command to list files that are created before some date

Can you please let me know the command to list the files that are created before some date, this we want to use for the following Eg: Move all the files that got created before 2006 to new folder in Solaris (3 Replies)
Discussion started by: csreenivas
3 Replies

6. Shell Programming and Scripting

List files created before Noon 2 days prior

Our nightly updates run in the evening and finish around 8am. My boss wants the current log files kept on the server for 2 days, but wants anything created before noon, 2 days prior archived. I was thinking of using touch to set a temporary file with a date of today-2 and a time of noon, then... (3 Replies)
Discussion started by: prismtx
3 Replies

7. UNIX for Dummies Questions & Answers

To list all the files created today with directory path

Hi, Can any one tell the command to list all the files that are created as of today from all the directories? The Command "ls -ltR" is listing all the files. But I want the list of files that has been created as of today along with the directory path:) Thank you in advance.:) Regards,... (4 Replies)
Discussion started by: meetusha.b
4 Replies

8. Shell Programming and Scripting

List last 10 Hrs file and find error files

Hi, I need a script that can search a word "Error" in last 10 Hrs generated logs in /log/App1 and /log/App2 folder.. Note these directories have massive log files ...actually our application generate 100 Log files of size 2MB in just a min so script must be fast enough to cater this I... (9 Replies)
Discussion started by: Mujtaba khan
9 Replies

9. Linux

List all files created today exclude last one

Hi, ALL thanks in advance, i listed all files using this command ls -ltr $(date +%Y%m%d)*.xmlbut i would like to exclude the last one created ; Best regard MEROUAN Use code tags, thanks. (4 Replies)
Discussion started by: merouan
4 Replies

10. Shell Programming and Scripting

Check if file got created in less than 10 hrs

Dear Gurus, I want to check if file got created in less than 10 hrs in .ksh. Here is my requirement In $var5 : I'm storing file name In $var4 I have stored : select to_char(sysdate,'YYYYMMDDHH:MM:SS') from dual; If that file date time is less than 10 hrs, then I need to check if less... (1 Reply)
Discussion started by: thummi9090
1 Replies
find(1) 						      General Commands Manual							   find(1)

Name
       find - find files

Syntax
       find pathname-list  expression

Description
       The  command  recursively  descends the directory hierarchy for each pathname in the pathname-list (that is, one or more pathnames) seeking
       files that match a boolean expression written in the primaries given below.  In the descriptions, the argument n is used as a decimal inte-
       ger where +n means more than n, -n means less than n , and n means exactly n.

Options
       -atime n       Tests true if the file has been accessed in n days.

       -cpio output   Writes current file on output in the format (5120-byte records) specified in the reference page.	The output can be either a
		      file or tape device.  If output is a tape device the B key must be used to read data from the tape.

       -ctime n       Tests true if the file has been changed in n days.

       -depth	      Always true; causes descent of the directory hierarchy to be done so that all entries in a directory are acted on before the
		      directory  itself (that is, postorder instead of preorder).  This can be useful when is used with to transfer files that are
		      contained in directories without write permission.

       -exec command  Tests true if specified command returns a 0 on exit.  The end of the command must be punctuated by an escaped semicolon.	 A
		      command argument `{}' is replaced by the current pathname.

       -group gname   Tests true if group ID matches specified group name.

       -inum n	      Tests true if the file has inode number n.

       -links n       Tests true if the file has n links.

       -mount	      Tests true if the current file is on the same file system as the current starting pathname.

       -mtime n       Tests true if the file has been modified in n days.

       -name filename Tests  true  if  the  filename  argument matches the current file name.  Normal Shell argument syntax may be used if escaped
		      (watch out for `[', `?' and `*').

       -newer file    Tests true if the current file has been modified more recently than the argument file.

       -ok command    Executes specified command on standard output, then standard input is read and command executed only upon response y.

       -perm onum     Tests true if file has specified octal number.  For further information, see If onum is prefixed by a minus sign, more  flag
		      bits (017777) become significant and the flags are compared: (flags&onum)==onum.	For further information, see

       -print	      Prints current pathname.

       -size n	      Tests true if the file is n blocks long (512 bytes per block).

       -type c	      Tests  true  if  file is c type ( c = b, block special file: c, character special file: d, directory: f, plain file: l, sym-
		      bolic link: p, type port: s, type socket).

       -user uname    Tests true if file owner is login name or numeric user ID.

       The primaries may be combined using the following operators (in order of decreasing precedence):

       1)  A parenthesized group of primaries and operators (parentheses are special to the Shell and must be escaped).

       2)  The negation of a primary (`!' is the unary not operator).

       3)  Concatenation of primaries (the and operation is implied by the juxtaposition of two primaries).

       4)  Alternation of primaries (`-o' is the or operator).

Examples
       To remove all files named `a.out' or `*.o' that have not been accessed for a week:
       find / ( -name a.out -o -name '*.o' ) 
       -atime +7 -exec rm {} ;

       To find all files on the root file system type:
       find / -mount -print

       To write all the files on the root file system to tape:
       find / -mount -print -cpio /dev/rmt?h
       cpio -iBvt < /dev/rmt?h

       To find all the mount points on the root file system type:
       find / ! -mount -print

Files
See Also
       cpio(1), sh(1), test(1), cpio(5), fs(5)

																	   find(1)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy