Re: do it all with grep and ls or is there another option



On Mar 25, 5:22 pm, "Chris F.A. Johnson" <cfajohn...@xxxxxxxxx> wrote:
On 2008-03-26, mmccaws2 wrote:
Supposed a simple request
I'd like to search through a directory for all files having Feb in
them that begin with 'q1' then list those files out into a file with
most recent change last. and I need to know how many files.

I get so far
grep Feb q1* | cat -n

but this doesn't give me the most recent last.

ls -ltr q1* | cat -n
give most recent last and counts but it doesn't eliminate q1*s that
don't have 'Feb'

ls -ltr q1*Feb* | cat -n

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence

Woops
thanks for your effort, but shame on me for not clarifying that the
Feb is not part of the filename. Feb should be found in a line within
each file name that begins with q1. In fact it'll probably be a date
like Feb 03, 2008, so I'll be looking for a string.

Mike
.



Relevant Pages

  • Re: do it all with grep and ls or is there another option
    ... but shame on me for not clarifying that the ... Feb is not part of the filename. ... like Feb 03, 2008, so I'll be looking for a string. ...
    (comp.unix.shell)
  • Re: do it all with grep and ls or is there another option
    ... mmccaws2 wrote: ... but shame on me for not clarifying that the ... Feb is not part of the filename. ...
    (comp.unix.shell)
  • Re: do it all with grep and ls or is there another option
    ... mmccaws2 wrote: ... but shame on me for not clarifying that the ... Feb is not part of the filename. ...
    (comp.unix.shell)
  • file class
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: file class
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)