Sponsored Content
Top Forums UNIX for Dummies Questions & Answers help me out with find command , -prune option Post 302351298 by rimser9 on Tuesday 8th of September 2009 04:26:03 AM
Old 09-08-2009
MySQL

Hi,
It might seem like hijacking a thread but my question is almost similar so I'm posting it here.
So, taking the tree below
.
./t1
./t1/t2
./t1/t2/t4 ------------------- (1)
./t1/t2/t3
./t1/t2/t3/t4 ------------------- (2)
./t1/t3
./t1/t3/t5/t4 ------------------- (3)
./t1/t3/t5/t6/t4 ------------------- (4)

Similar case, I need to know the directory where t4 files are stored but once t4 is located in a branch { as in (1) } the code should stop descending and should search the next branch for t4 { as shown in (3)}, and again once located should abort searching/descending that branch. Is it possible using 'find'.

Note: In my case the file is an empty file and currently I'm using "find . -name t4 -maxdepth 10 -mindepth 1 -type f -empty -size 0b". The min and max depth are a gamble so I want a solution even when depth is not known. I'm on Linux.

Thanks & Best Regards,
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Find command with prune and exec

Hi, I'm using the following command to get a list of files on the system. find /releases -type f -exec ls -l > /home/sebarry/list.txt '{}' \; however, its searching a directory I don't want it to search so I know I have to use prune but I don't seem to be able to get prune and exec to work... (1 Reply)
Discussion started by: Sebarry
1 Replies

2. UNIX for Dummies Questions & Answers

find command with prune help

I have a directory named https-abcd Under that I have some directories, files and links. One of those directories is with name logs and the logs directory has lot of files in it. I need to tar the whole https-abcd directory excluding the logs directory only, I should get all the links, files and... (2 Replies)
Discussion started by: venu_nbk
2 Replies

3. UNIX for Dummies Questions & Answers

Using prune with find command

Hi, I am using a find command like below in my script: find /outfiles -type f -name cat -o -name vi -o -name grep 2>/dev/null Which will search for files like "cat" , "vi" or "grep" in the "/outfiles" and subdirectories. I want to ignore a particular subdirectory from the search. I... (4 Replies)
Discussion started by: deepakgang
4 Replies

4. Solaris

correct usage of find's -prune option

I know one of the more seasoned veterans probably opened this thread looking for their chance to refer me to the site's search feature and let me tell you. I'VE LOOKED!!!! And I didn't find anything helpful... So, I've got a windows background and I'm fond of its search feature which comes... (6 Replies)
Discussion started by: ProGrammar
6 Replies

5. Shell Programming and Scripting

find with prune option

Hi, I want to list files only from the current dir and its child dir (not from child's child dir). i have the following files, ./ABC/1.log ./ABC/2.log ./ABC/ABC1/A.log ./ABC/ABC1/B.log ./ABC/ABC1/XYZ/A1.log ./ABC/ABC1/XYZ/A2.log Here i want to list only the log file from current... (1 Reply)
Discussion started by: apsprabhu
1 Replies

6. Shell Programming and Scripting

help with find command and prune option

Hi I have a directory say mydir and inside it there are many files and subdirectories and also a directory called lost+found owned by root user I want to print all files directories and subdirectorres from my directory using find command except lost+found If i do find . \( -name... (3 Replies)
Discussion started by: xiamin
3 Replies

7. UNIX for Dummies Questions & Answers

AIX find command using prune option

Hi, I am trying to find some files in a directory and then remove/list them if they are 30 days old. I also have 2 directories in that directory which I need to skip. Can someone please tell me what is the correct syntax? find /developer/. -name "lost+found" "projects" -prune -o -type f... (2 Replies)
Discussion started by: tkhan9
2 Replies

8. UNIX for Dummies Questions & Answers

find with prune option help needed

Hello, I am using ksh93 (/usr/dt/bin/dtksh) on Solaris and am stuck when trying to use find with the -prune option. I need to search a directory (supplied in a variable) for files matching a certain pattern, but ignore any sub-directories. I have tried: find ${full_path_to_dir_to_search}... (9 Replies)
Discussion started by: gary_w
9 Replies

9. UNIX for Beginners Questions & Answers

Prune Option for Find Command on AIX

I need to delete all files from the working directory and its sub directories using the find command, for that I am using -prune option but some how I am having a syntax issue. I have tried the below, please help me correct the syntax find . -name \* -type f -exec rm -f {} \; >> Works but... (4 Replies)
Discussion started by: rosebud123
4 Replies
GIT-ARCHIMPORT(1)						    Git Manual							 GIT-ARCHIMPORT(1)

NAME
git-archimport - Import an Arch repository into git SYNOPSIS
git archimport [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir] <archive/branch>[:<git-branch>] ... DESCRIPTION
Imports a project from one or more Arch repositories. It will follow branches and repositories within the namespaces defined by the <archive/branch> parameters supplied. If it cannot find the remote branch a merge comes from it will just import it as a regular commit. If it can find it, it will mark it as a merge whenever possible (see discussion below). The script expects you to provide the key roots where it can start the import from an initial import or tag type of Arch commit. It will follow and import new branches within the provided roots. It expects to be dealing with one project only. If it sees branches that have different roots, it will refuse to run. In that case, edit your <archive/branch> parameters to define clearly the scope of the import. git archimport uses tla extensively in the background to access the Arch repository. Make sure you have a recent version of tla available in the path. tla must know about the repositories you pass to git archimport. For the initial import, git archimport expects to find itself in an empty directory. To follow the development of a project that uses Arch, rerun git archimport with the same parameters as the initial import to perform incremental imports. While git archimport will try to create sensible branch names for the archives that it imports, it is also possible to specify git branch names manually. To do so, write a git branch name after each <archive/branch> parameter, separated by a colon. This way, you can shorten the Arch branch names and convert Arch jargon to git jargon, for example mapping a "PROJECT--devo--VERSION" branch to "master". Associating multiple Arch branches to one git branch is possible; the result will make the most sense only if no commits are made to the first branch, after the second branch is created. Still, this is useful to convert Arch repositories that had been rotated periodically. MERGES
Patch merge data from Arch is used to mark merges in git as well. git does not care much about tracking patches, and only considers a merge when a branch incorporates all the commits since the point they forked. The end result is that git will have a good idea of how far branches have diverged. So the import process does lose some patch-trading metadata. Fortunately, when you try and merge branches imported from Arch, git will find a good merge base, and it has a good chance of identifying patches that have been traded out-of-sequence between the branches. OPTIONS
-h Display usage. -v Verbose output. -T Many tags. Will create a tag for every commit, reflecting the commit name in the Arch repository. -f Use the fast patchset import strategy. This can be significantly faster for large trees, but cannot handle directory renames or permissions changes. The default strategy is slow and safe. -o Use this for compatibility with old-style branch names used by earlier versions of git archimport. Old-style branch names were category--branch, whereas new-style branch names are archive,category--branch--version. In both cases, names given on the command-line will override the automatically-generated ones. -D <depth> Follow merge ancestry and attempt to import trees that have been merged from. Specify a depth greater than 1 if patch logs have been pruned. -a Attempt to auto-register archives at http://mirrors.sourcecontrol.net This is particularly useful with the -D option. -t <tmpdir> Override the default tempdir. <archive/branch> Archive/branch identifier in a format that tla log understands. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-ARCHIMPORT(1)
All times are GMT -4. The time now is 10:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy