shell - find and grep command this but not that -
I am trying to find all the files that are I am using this command. Edit: Looks like no comment / suggestions. (Added keith.layne correction) You do not need In GRP, search patterns should be a regular expression. Therefore, *. O (object) files are not stored and stored in the MyFile.lst file in the current directory tree.
#! / Usr / bin / ksh search-type F | Grep -v "* .o" & gt; & Gt;
find-type F | Grep -v '\ .o $' & gt; & Gt; MyFile.lst
grep .
Search Type 'F!' -name '* .o' & gt; & Gt; MyFile.lst
. ,
$ and
* have special meaning.
. That means match any character, it means that the line X * means the match matches the end of X, zero or more times (greedy)
Grep -v '\ .o $ "
.o will match the files with the extension. (You need to avoid the
for your code. ) .
Comments
Post a Comment