You just add all the options you need as suggested before, such as the -name, -newer etc.
I would worry though that using /var/output/* as the place to search from might be expanded by the shell to a very long list and exceed the command line limit if there are lots of files in /var/output.
Robin
Last edited by rbatte1; 01-09-2014 at 12:20 PM..
Reason: Clarity (I hope)
There are still two problems with the current command.
A) I wanted files for 2nd Jan only. But it displays all .css files
The help for find told me to use mtime
B) The file names is displays as ./P010111.css instead of just P010111.css
There are other problems with this that you didn't mention. But, to get closer to what you wanted move the -ls primary after the -mtime primary:
But the files this lists will be files that are more than 6 * 24 hours old and less than or equal to 7 * 24 hours old at the time find starts; not files with dates between midnight at the start of the day and midnight at the end of the day on January 2, 2014.
If you want files with the date January 2, 2014 and you don't want the names to have the leading ./, you have several choices. Among them are:
and:
Both of these scripts use features that are not defined by the POSIX Standards nor the Single UNIX Specifications. Although written using the Korn shell, the 1st script above should work with any ksh or bash shell.
The 2nd script may fail if *.css expands to a list of files that creates a find command line longer than your system's ARG_MAX limits or if the version of find on your system doesn't support the -ls primary.
If you just want a list of the file names (instead of long format ls output), change:
in the 1st script to:
and change:
in the 2nd script to:
This User Gave Thanks to Don Cragun For This Post:
I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation.
When I tried like below,
-bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation
-bash-4.1$ find ./ -name % Retail by State
find: paths must precede expression: Retail
Usage: find ... (10 Replies)
hi,
i want to list the files from the below find commands output.
find ./* -name "*.txt" -type f -mtime +10
will give the output like
./a.txt
but i need the output in the format like (ls -lrt a.txt )
-rw-rw-rw- 1 srea nast 5 May 23 07:34 a.txt
i used xargs for the... (4 Replies)
Hi All,
I need to list the files based modification time of the files from a directory, I cannot use "ls -t" as there are lot of files, which "ls" command cannot handle. New files will land there daily. So iam looking for an alternative through "find"command.
All suggestions are welcomed.
... (6 Replies)
The purpose of those comands are to find the newest file in a directory acvrdind to system date, and it has to be recursively found in each directory.
The problem is that i want to list in a long format every found file, but the commands i use produce unexpected results ,so the output lists in a... (5 Replies)
Hello,
I create a file touch 1201093003 fichcomp
and inside a repertory (which hava a lot of files) I want to list all files created before this file :
find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long
but i make a filter all... (1 Reply)
Okay here is a DOS comparison. When I search for a file in DOS and I was not sure what directory it was in then I would put dir /s/o/p filename the s would tell it to look in every directory including subs, the o would sort it alphabetically and the p would limit the display to one page at a... (1 Reply)
Hi Gurus!
I recently got my shell account (HP UX v11) created by our sysadmin and am having problem deleting with the backspace key.
After doing some reading, I believe I need to enter a custom "STTY..." statement in my profile.
Can someone please help me with the correct "STTY" sequence... (3 Replies)
Hi. What command can be used to determine the system
configuration. For example I want to find out how much CPU,
how much memory, what CPU and 233mhz or 400mhz, etc.
Please help.... (4 Replies)