English 中文(简体)
• 如何排除索罗西岛指挥中一条完整的航道清单
原标题:How to exclude a list of full directory paths in find command on Solaris

我非常具体地需要使用文字,在太阳系找到无人拥有的档案和目录,并且需要能够排除完全的目录途径,因为它们可能包含数千份未经拥有的档案(而且由于档案存放在其他服务器上),因此是正常的。 我甚至想对这些名录进行搜索,因为这样会hang服务器(长时间停泊到99%),因此,将发现结果egre为过滤这些目录并不是一种选择。

我知道,我可以这样做,以名字排除另一个名录:

http://www.un.org (姓名: dir1 -o -name dir2 -o dir3 ) -prune -o (-nouser -o -nogroup ) -print

然而,这将与任何名录的目录结构的任何地点,即not/strong>的目录结构相匹配。

我想能够防止在以下目录中找到证据(例如:

/opt/dir1
/opt/dir2
/var/dir3/dir4

And I still want it to find unowned files and directories in the following directories:

/opt/somedir/dir1
/var/dir2
/home/user1/dir1

我曾尝试在名称论点中使用ex子,但既然找到的名字与它所发现的基名相对应,我可以指明一条道路。 遗憾的是,Solas的发现并不支持GNU的备选办法,例如,全称或——整整段,这样一米的螺旋转。

我的目标是用文字说明如下:

我如何利用太阳系的发现和标准描述(5.8和上)?

最佳回答

http://download.oracle.com/docs/cd/E19253-01/816-5165/6mbb0m9ft/index.html 因此,使用<代码>ls -i,以生成一份登峰造册,然后打电话find。 假设如此之多的司长们想推一下,你会超越指挥线的长度限制。

inode_matches=$(ls -bdi /opt/dir1 /opt/dir2 /var/dir3/dir4 |
                sed -e  s/ *([0-9][0-9]*) .*/-inum 1 -o/ )
find / -xdev ( $inode_matches -nouser -o -nogroup ) -prune -o -print

另一种做法是使用Perl或Avl字母和滚动自己的目录。 带find2perl的每艘船舶,可从File:Find模块入手。 参看walk功能,载于os.path模块。

问题回答

暂无回答




相关问题
What does it mean "to write a web service"?

I just asked a question about whether it was possible to write a web-page-checking code and run it from free web server, and one supporter answered and said that it was possible only if I run "a web ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Dynamically building a command in bash

I am construcing a command in bash dynamically. This works fine: COMMAND="java myclass" ${COMMAND} Now I want to dynamically construct a command that redirectes the output: LOG=">> myfile.log ...

Why does Scala create a ~/tmp directory when I run a script?

When I execute a Scala script from the command line, a directory named "tmp" is created in my home directory. It is always empty, so I simply deleted it without any apparent problem. Of course, when I ...

Ivy, ant and start scripts

I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...