My OS is SunOS mymac1 5.10 Generic_148888-04 sun4v sparc SUNW,SPARC-Enterprise-T5220
When i cd /var/output
ls -ltr *.css
It yields the output in less than a second. While
Code:
find /var/output -type f -name "*.css"
does not complete for a while.
and
Code:
find /var/output -type f *.css
find: bad option current_017.css
find: [-H | -L] path-list predicate-list
Can you please let me know what is incorrect and also how can i add the date to the current find command so that it lists only those .css files that match that date [yyyy-mm-dd]
Thank you !!
Last edited by mohtashims; 01-09-2014 at 11:15 AM..
The find command will be searching down every directory under /var/output for matching files. This can be a good thing if that's really what you want.
Have a read of the man page for find The command you have entered second has two problems. Firstly it does not say that *.css is going to be a file name and secondly, the shell will expand this before actually executing the find
If you have a file current_017.css then this will be used in the find command.
I would suggest you use:-
Code:
find /var/output -type f -name "*.css"
as you have listed, if this is really what you want.
For matching on a date, then you have a number of options all listed on the amnual pages, such as -newer & -mtime and you might need to be a little creative to get the listing you want.
If you can create to files, you can search between their timestamps:-
Touch two files one with the date you're looking for and the other dated the next day:
i.e. January 09, 2014
touch -t "20140109000" /tmp/file1
touch -t "20140110000" /tmp/file2
Then fun the find command:
find . -name '*.css' -type f -newer /tmp/file1 ! -newer /tmp/file2 -ls
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)