English 中文(简体)
bash: 记录目录和发现的延伸?
原标题:bash: Filtering out directories and extensions from find?
  • 时间:2010-08-03 19:22:35
  •  标签:
  • bash
  • find

我试图找到最近经过修改的档案

find . -mtime 0

en/content/file.xml
es/file.php
en/file.php.swp
css/main.css
js/main.js

但我要从<条码>en和es的名录中删除,但愿照搬其他内容。 此外,我要从这些结果中筛选出<代码>swp的档案。

因此,我要回过来:

css/main.css
js/main.js
xml/foo.xml

除在<条码>内不填入的所有其他文件外,在<条码>上不填入。

最佳回答

适当找到:

find -mtime 0 -not ( -name  *.swp  -o -path  ./es*  -o -path  ./en*  )
问题回答

www.un.org/Depts/DGACM/index_french.htm 指令阻止了你希望避免的降级表:

find . ( -name en -o -name es ) -prune , -mtime 0 ! -name "*.swp"

为此:

find . -mtime 0 | grep -v  ^en  | grep -v  ^es 

添加“<>><>cap>>/em><>>>>>> > > 灰色的形态一开始,即确保必须在该线一开始就找到这种模式。

> Chen Levy s comment (s), use the following than the above

find . -mtime 0 | grep -v  ^./en  | grep -v  ^./es 

发现的是巨大的,但各种UNIX版本的实施有所不同,因此,我更希望找到解决办法,以更标准的办法,使司令部更便于纪念和使用。

find . -mtime 0 | grep -v  ^en  | grep -v  ^es  | grep -v .swp

灰色的五条旗帜使得它回到了所有线上don t

第(1)条(可与E选择相结合,使定期表达成为可能)也符合整个档案途径。

find . -mtime 0 -not ( -name  *.swp  -o -regex  ./es.*  -o -regex  ./en.*  )
find "$(pwd -P)" -mtime 0 -not ( -name  *.swp  -o -regex  .*/es.*  -o -regex  .*/en.*  )




相关问题
Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

Bash usage of vi or emacs

From a programming standpoint, when you set the bash shell to use vi or emacs via set -o vi or set -o emacs What is actually going on here? I ve been reading a book where it claims the bash shell ...

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 ...

Perform OR on two hash outputs of sha1sum

I want perform sha1sum file1 and sha1sum file2 and perform bitwise OR operation with them using bash. Output should be printable i.e 53a23bc2e24d039 ... (160 bit) How can I do this? I know echo $(( ...

Set screen-title from shellscript

Is it possible to set the Screen Title using a shell script? I thought about something like sending the key commands ctrl+A shift-A Name enter I searched for about an hour on how to emulate ...

热门标签