10-16-2006
Thanks Reborg,
I did not have any idea about this prune, now I tried it and I was successful in doing it
Syntax :
find . -name unwanted -prune -o -type f -exec fgrep -l 'pattern' {} \;
Example:
find . -name logs -prune -o -type f -exec grep "7001" {} \;
Thanks once again.
But i have a doubt regarding -o why should it be used here?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I did not understand why the following did not work out as I expected:
find . -name "pqp.txt" | grep -v "Permission"
I thought I would be able to catch whichever paths containing my pqp.txt file without receiving the display of messages such as "find: cannot access... Permisson... (1 Reply)
Discussion started by: 435 Gavea
1 Replies
2. UNIX for Dummies Questions & Answers
Is there any command, so I can retrieve all the records in a file from the first occurance of a search string, within that file? (4 Replies)
Discussion started by: videsh77
4 Replies
3. UNIX for Dummies Questions & Answers
Hi all
How can i find Exactly line using grep.
my input file:
avg_configfile:
Recalculation Dates|4|
Recalculation|147|
I tryed like;
grep ^"Recalculation" avg_configfile
out put;
Recalculation Dates|4|
Recalculation|147|
But i want second line avg_configfile.i.e... (4 Replies)
Discussion started by: koti_rama
4 Replies
4. Shell Programming and Scripting
Haven't worked in bash for ages. did a good bit of shell scripting in regular sh, but have forgotten most of it.
I have several thousand php files that now include the following line at the end of the file. There is no LF or CR/LF before it begins, it is just concatenated to the final line of... (3 Replies)
Discussion started by: sjburden
3 Replies
5. Shell Programming and Scripting
i have some 2000 file. i need to grep a particular word in all those files and list the filename that contains it?
grep -l '0008345923LG' *.*
the above command is not working? giving o/p as arg list too long
PLZ anyone help me
Thnaks in advance (1 Reply)
Discussion started by: ali560045
1 Replies
6. HP-UX
Hi
Could someone help me with "find", "grep" or other idea, I have handrad files in different folders and I need to replace a word inside that files. e.g:
file name = test.txt
inside that test.txt a have a word "00001"
I want to replace the value "00001" to "00002".
thank you (8 Replies)
Discussion started by: ean01c
8 Replies
7. Shell Programming and Scripting
Hi all ,
I'm new to unix
I have a checked project , there exists a file called xxx.config .
now my task is to find all the files in the checked out project which references to this xxx.config file.
how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I'm using the below command to search the files with the patterns given below. Created a file "searchtest.sh" with all the patterns.
The below find command retrieves the file "AB940Insert.xml" also which shouldn't be in the desired output. Any help to fine tune the find command and to... (1 Reply)
Discussion started by: venkatesht
1 Replies
9. UNIX for Dummies Questions & Answers
Kinldy help me to write the find command on following:
There are different version of file 'abc.txt' located in many folders similar as below.
/home/gupta/abc.txt
/home/gupta/db/abc.txt
/home/gupta/temp/abc.txt
/home/gupta/db/test/abc.txt
1) I want to know... (4 Replies)
Discussion started by: ravigupta2u
4 Replies
10. Shell Programming and Scripting
Platform: AIX 6.1/ksh
Question1.
I want to grep for the string "CUSTOM_PKMS" in all the files in server except those files with extensions .dbf , .ctl and .dmp
I started running the following command but it is taking too long because there are lots of .dbf , .ctl and .dmp files in this... (6 Replies)
Discussion started by: John K
6 Replies
LEARN ABOUT LINUX
git-prune
GIT-PRUNE(1) Git Manual GIT-PRUNE(1)
NAME
git-prune - Prune all unreachable objects from the object database
SYNOPSIS
git prune [-n] [-v] [--expire <expire>] [--] [<head>...]
DESCRIPTION
Note
In most cases, users should run git gc, which calls git prune. See the section "NOTES", below.
This runs git fsck --unreachable using all the refs available in refs/, optionally with additional set of objects specified on the command
line, and prunes all unpacked objects unreachable from any of these head objects from the object database. In addition, it prunes the
unpacked objects that are also found in packs by running git prune-packed.
Note that unreachable, packed objects will remain. If this is not desired, see git-repack(1).
OPTIONS
-n, --dry-run
Do not remove anything; just report what it would remove.
-v, --verbose
Report all removed objects.
--
Do not interpret any more arguments as options.
--expire <time>
Only expire loose objects older than <time>.
<head>...
In addition to objects reachable from any of our references, keep objects reachable from listed <head>s.
EXAMPLE
To prune objects not used by your repository nor another that borrows from your repository via its .git/objects/info/alternates:
$ git prune $(cd ../another && git rev-parse --all)
NOTES
In most cases, users will not need to call git prune directly, but should instead call git gc, which handles pruning along with many other
housekeeping tasks.
For a description of which objects are considered for pruning, see git fsck's --unreachable option.
SEE ALSO
git-fsck(1), git-gc(1), git-reflog(1)
GIT
Part of the git(1) suite
Git 1.8.5.3 01/14/2014 GIT-PRUNE(1)