向右转(尽量每天更新…)

2007-11-24

ut3[虚幻3] beta patch 101出来了

Filed under: 游戏 — admin @ 12:47 am

下载地址:

Epic Games
Multtiplay UK
Multiplay EU
 

修改的东西有:

UT3第一个patch的修改列表已经出来了,可以看到很多被人指出的不足和bug都得到了修正,希望它越来越好吧。

主要修正包括
game play:

修正一些模型的大小,增大模型高度和眼睛高度。
增加hellbender副活力威力
增加坦克上机枪的威力
增加Flak, Rocket, Shock 对manta 和viper的伤害

Demo播放
修正主视角看demo的bug
demo可以暂停
可以从菜单里删除demo
修正旁观载具的问题

Server Browser
加入历史服务器页面,可以在里面添加favourite
可以用旁观模式加入服务器

UI
不建立profile也可以保存设置
增加ping和游戏时间到分数板上
可以精确控制鼠标灵敏度
可以改变FOV

具体看原文:

UT3 Beta Patch 1 - start your download!!! *Mirrors added*

 

The first Beta Patch for Unreal Tournament 3 is now available, so dont hesitate and start your download!

Epic Games
Multtiplay UK
Multiplay EU

Changelog

Gameplay:
- Fixed scaling of certain player meshes (increased in size some human and
robot meshes). Addresses meshes being smaller than collision box, as well as
eyeheight issues.
- Fixed feigning death into/through ForcedDirVolumes.
- Fixed grenade effects in water.
- Increased hellbender rear turret damage.
- Reduced Goliath machine gun spread, plus slight damage increase.
- Fixed warfare scoring for locking down a prime node not called “prime
node”.
- Slightly increased momentum taken for damage by mantas and vipers.
- Flak, Rocket, and Shock do slightly more damage to manta and viper.
- Made sure Hellfire SPMA cannon can’t fire through walls.
- Increased incoming SPMA fire sound radius.
- Fixed impact jumping with hoverboard.
- Fixed bot Pawns losing their PRI at the end of the match, causing them to,
among other things, be invisible
- Fixed being able to switch away from the rocket launcher in the delay
between the third rocket being loaded and the weapon autofiring.

AI:
- Improved bot AI with darkwalker.
- Tweaked bot voice message frequencies.
- Bot aiming tweaks.
- Fixed bots attacking friendly player in rare cases when that player recently
stole an enemy vehicle.
- Fixed bots not handling the “Hold This Position” order correctly when the
player giving the order is in a multi-person vehicle.

Demo playback:
- Fixed demo playback not ending/looping correctly when the demo ends due to
the DemoRecSpectator being destroyed before the end of the file is reached.
- Demos can now be paused.
- By default, demo playback now runs at full speed and interpolates in between
demo frames using the normal client simulation code. The old frame-locked
method is still available by passing ?disallowinterp. Timedemos are unaffected
by this change.
- Fixed demoplay URL parsing counting the options as part of the filename
unless an extension was specified in the demo name
- Added a “Delete Demo” button to the demo playback menu.
- Demo playback now properly handles rotation when viewing a Pawn in first
person.
- Fixed looking around while spectating a vehicle.

Server Browser:
- Implemented “Server History” tab page in server browser, with ability to
“lock” favorites on that page.
- Added ‘Join as spectator’ feature.
- Server browser uses smaller font to display more servers.
- Fixed custom mutators not appearing in server browser.
- Fixed custom gametypes not displayed in server browser’s window.
- Fixed server browser’s listed MaxPlayers being incorrect.
- Added filter option for dedicated servers.
- Fixed server browser showing an incorrect goal score and time limit when the
.ini values were used.

User Interface:
- Can now save settings/progress even if have never created a profile.
- Added ping and connect time to scoreboard.
- Removed annoying confirmation menu when starting a game.
- Removed unnecessary top settings page (can use tabs at the top of the
settings to navigate).
- Added a Messages tab to the mid game menu.
- Friends messages now saved until explicitly deleted.
- Finer control over mouse sensitivity, using an edit box instead of a
slider.
- Added framerate smoothing and FOV options to the advanced video menu.
- Increased max players/bots in menus to 32.
- Fixed auto switching to vote menu at end of match.
- Improved mid game menu performance (don’t render world behind it).
- Added version number to main menu.
- Fixed binding gamepad/joystick keys (you must set AllowJoystickInput=1 in
the [WinDrv.WindowsClient] of your UTEngine.ini to enable
gamepads/joysticks).

HUD:
- Added the killer weapon to victim messages.
- Fixed flag and orb scaling in minimap at high resolutions.
- Fixed node teleporter not showing “You can’t teleport with orb” message on
clients.
- Fixed situations where “get in vehicle” pictograph wouldn’t work correctly.
- Still draw the clock on the scoreboard after the game is over.
- Fixed Duel HUD issues.

Networking:
- Implemented STUN support (Simple Traversal of UDP Through Network Address
Translators) to enable clients and servers to connect from behind a NAT.
- Fixed team scores very rarely not updating for a client.
- Fixed bot faction option when running a listen server.
- Fixed link setup not reset correctly when going from a map with a custom
link setup to one using the default.
- Fixed a case where Duel would place an incoming player on the wrong team
when some players were still travelling.
- Bullseye stats are now properly recorded.
- Fixed clients not travelling to downloaded maps correctly.
- Fixed the client and server getting into a loop sending each other close
messages in some situations.
- Quick match incorporates player rating into search decision.
- Fixed issue where Vista clients would not receive all servers from a server
browser search.
- Applied proper fix to suppressing voice on dedicated servers.
- Fixed issues with players not getting on right team in Duel and
Duel+Survival if a player leaves in certain timing windows during map
transitions.
- Fixed previous level PRIs showing up on the scoreboard/leaderboard after the
client travels (making it look like players have already scored lots of points
when those clients are in fact still loading)
- Fixed losing your custom character mesh after changing teams during a
match.

Server Administration:
- Reduced tick rate for dedicated servers with no clients (saves CPU on idle
servers).
- Dedicated servers do not require CD keys.
- Added -configsubdir= command line option to cause .ini files to be
loaded/saved from the specified subdirectory of Game\Config\
- Added QueryPort configuration and command line option.
- Added an “AdminChangeOption [option] [value]” console command for server
admins. This allows changing most simple .ini values (e.g. GoalScore) from the
client. This command will not override URL options. The change will take
effect after the next map change.
- Added an “AdminPublishMapList” console command for server admins. This
overrides the server’s map list for the current game type with the one on the
client that used the command.
- Uses GameReplicationInfo.ServerName if set for the name of the server on the
server browser.
- Added “AdminForceVoiceMute” and “AdminForceVoiceUnMute”: Stops/Starts a
player from sending voip to others
- Added “AdminForceTextMut” and “AdminForceTextUnMute”: Stops/Starts a player
from send text messages to others
- Updated AdminPlayerList to show the PlayerID of the players on the server.
- Updated Kick/Ban to allow for using either the player name or the id

Map Specific:
- Fixed WAR-Avalanche terrain LOD popping issue on high end PCs.
- Fixed bots rarely getting stuck in mid air in DM-Gateway in the city
section.
- Fixed some VCTF-Suspense pathing issues.
- Fixed issues with circular lift on DM-Deimos.
- Fixed translucent mesh sorting issues in DM-Gateway.

Campaign/Co-op:
- Fixed a bug that could cause too many bots to be added to co-op matches in
some cases.
- Added support for seamless travel interrupting a travel to start another
travel. This fixes single player breaking if the host selects the next mission
before the clients have finished travelling to the mission selection level
- Fixed extra copy of a character when a human player leaves a co-op game at
the right time.
- Changed network loss during single player to result in player signed in
locally.

Modding:
- Added a SupportedGameTypes field to UTUIDataProvider_Mutator. If some
entries are in this array, the mutator will only be visible in the menus if
the selected gametype is found in the array.
- Fixed custom gametype midgame menus not being used correctly.
- Shipping script compiler now allows localized/config defaultproperties
because otherwise autodownloaded mods have no way for their localized/config
variables to work.
- Added Get/SetSpecialValue() stubs to Object to allow mods to expose values
that can be modified without creating a dependancy.

2007-11-23

周爱民建议之思考

Filed under: 思想情感 — admin @ 8:51 pm

周爱民说:
1、不要急。

个人认为不是应该急,但也不能完全放松.要做的事太多.要完成的理想也太远.所以拥有真实目标的人还是急的.急容易让自己失去方向,迷失自己。应该把自己放在不急,但有紧迫感的位置。这种紧迫感应该让自己更加积极主动做事,而且要做踏实的事。一步一个脚印的。不需要三步并做两步,那会大大添加自己摔倒的机会。但也不能走三步,退两步。其实感觉做事,做人,朝着理想前进的感觉有如竞走,不能学做兔子,不能学做乌龟.兔子太快,多数人并没有兔子的步频的。乌龟太慢,亦做不成事。

2、不要只做不想。

学而不思则罔,思而不学则殆。

3、听别人的话,即使你不想听。

他们不是神,我们也不是。

4、订一个五个期的目标,写一个一年期的计划,然后回顾它。

远景只能张望。中短期才是基本。要走很长的路会不知道什么时候完成,但从这里到你能看到的电线杆处却很容易做到。以此推进,则容易成功些。

5、学好中文,学好写文章,学会打标点符号。

写出来是总结也会升华。懂得并不一定能掌握。

6、把工作当成事业做,天天都在做事业,才会成功。

如果不这样,你则很容易推动动力,激情,积极向上的心态则会离你远去。

7、理论看不懂,就去实践;实践遇到问题,就去看理论。

学习掌握的方法有时是迂回的,也是相互佐证的。

8、参加一个开源项目,如果没你感兴趣的,就自己发起一个。

可以让自己主动创新。创新是一种知识积累到一定程度上的主动思考的结果。知识积累随机随地进行着,但主动与被动思考却不那么容易。

9、保持自己对某一件事物的热心、执着,即使这件事与你是不是程序员毫无关系。

兴趣让自己更充实,也会让自己不单一。假如我们有条件的话。

10、成功不能被复制,但失败总在不停复制。看看别人是怎么倒下的,你可以更早地成功。

有多少倒下人们从来不去关心,有多少人成功却都能看到。成事者不过是基本十之一二。失败总容易找到原因。而成事者却是要避这些原因,却会成功。

2007-11-20

关于find 命令 常用收藏

Filed under: 转贴 — admin @ 11:16 pm

前言:关于find命令

一、find 命令格式

二、find命令的例子;

三、xargs
四、find 命令的参数;

五、关于本文
六、相关文档


+++++++++++++++++++++++++++++++++++++++++++++++++
正文
+++++++++++++++++++++++++++++++++++++++++++++++++


版权声明

本文是zhyfly兄贴在LinuxSir.Org 的一个帖子而整理出来的,如果您对版权有疑问,请在本帖后面跟帖。谢谢;本文的HTML版本由北南南北整理;修改了整篇文档的全角及说明文字中的单词中每个字母空格的问题;为标题加了编号,方便大家阅读;

前言:关于find命令

由于find具有强大的功能,所以它的选项也很多,其中大部分选项都值得我们花时间来了解一下。即使系统中含有网络文件系统( NFS),find命令在该文件系统中同样有效,只你具有相应的权限。

在运行一个非常消耗资源的find命令时,很多人都倾向于把它放在后台执行,因为遍历一个大的文件系统可能会花费很长的时间(这里是指30G字节以上的文件系统)。


一、find 命令格式


1、find命令的一般形式为;

find pathname -options [-print -exec -ok …]


2、find命令的参数;

pathname: find命令所查找的目录路径。例如用.来表示当前目录,用/来表示系统根目录。
-print: find命令将匹配的文件输出到标准输出。
-exec: find命令对匹配的文件执行该参数所给出的shell命令。相应命令的形式为’command’ { } \;,注意{ }和\;之间的空格。
-ok: 和-exec的作用相同,只不过以一种更为安全的模式来执行该参数所给出的shell命令,在执行每一个命令之前,都会给出提示,让用户来确定是否执行。


3、find命令选项

-name按照文件名查找文件。-perm
按照文件权限来查找文件。
-prune
使用这一选项可以使find命令不在当前指定的目录中查找,如果同时使用-depth选项,那么-prune将被find命令忽略。

-user
按照文件属主来查找文件。

-group
按照文件所属的组来查找文件。

-mtime -n +n
按照文件的更改时间来查找文件, - n表示文件更改时间距现在n天以内,+ n表示文件更改时间距现在n天以前。find命令还有-atime和-ctime 选项,但它们都和-m time选项。

-nogroup
查找无有效所属组的文件,即该文件所属的组在/etc/groups中不存在。

-nouser
查找无有效属主的文件,即该文件的属主在/etc/passwd中不存在。
-newer file1 ! file2

查找更改时间比文件file1新但比文件file2旧的文件。
-type

查找某一类型的文件,诸如:

b - 块设备文件。
d - 目录。
c - 字符设备文件。
p - 管道文件。
l - 符号链接文件。
f - 普通文件。

-size n:[c] 查找文件长度为n块的文件,带有c时表示文件长度以字节计。
-depth:在查找文件时,首先查找当前目录中的文件,然后再在其子目录中查找。
-fstype:查找位于某一类型文件系统中的文件,这些文件系统类型通常可以在配置文件/etc/fstab中找到,该配置文件中包含了本系统中有关文件系统的信息。

-mount:在查找文件时不跨越文件系统mount点。
-follow:如果find命令遇到符号链接文件,就跟踪至链接所指向的文件。
-cpio:对匹配的文件使用cpio命令,将这些文件备份到磁带设备中。

另外,下面三个的区别:

-amin n
  查找系统中最后N分钟访问的文件
  -atime n
  查找系统中最后n*24小时访问的文件
  -cmin n
  查找系统中最后N分钟被改变文件状态的文件
  -ctime n
  查找系统中最后n*24小时被改变文件状态的文件

 -mmin n
  查找系统中最后N分钟被改变文件数据的文件

  -mtime n
  查找系统中最后n*24小时被改变文件数据的文件


4、使用exec或ok来执行shell命令

使用find时,只要把想要的操作写在一个文件里,就可以用exec来配合find查找,很方便的

在有些操作系统中只允许-exec选项执行诸如l s或ls -l这样的命令。大多数用户使用这一选项是为了查找旧文件并删除它们。建议在真正执行rm命令删除文件之前,最好先用ls命令看一下,确认它们是所要删除的文件。

exec选项后面跟随着所要执行的命令或脚本,然后是一对儿{ },一个空格和一个\,最后是一个分号。为了使用exec选项,必须要同时使用print选项。如果验证一下find命令,会发现该命令只输出从当前路径起的相对路径及文件名。

例如:为了用ls -l命令列出所匹配到的文件,可以把ls -l命令放在find命令的-exec选项中

# find . -type f -exec ls -l { } \;
-rw-r–r– 1 root root 34928 2003-02-25 ./conf/httpd.conf
-rw-r–r– 1 root root 12959 2003-02-25 ./conf/magic
-rw-r–r– 1 root root 180 2003-02-25 ./conf.d/README

上面的例子中,find命令匹配到了当前目录下的所有普通文件,并在-exec选项中使用ls -l命令将它们列出。
在/logs目录中查找更改时间在5日以前的文件并删除它们:

$ find logs -type f -mtime +5 -exec rm { } \;

记住:在shell中用任何方式删除文件之前,应当先查看相应的文件,一定要小心!当使用诸如mv或rm命令时,可以使用-exec选项的安全模式。它将在对每个匹配到的文件进行操作之前提示你。

在下面的例子中, find命令在当前目录中查找所有文件名以.LOG结尾、更改时间在5日以上的文件,并删除它们,只不过在删除之前先给出提示。

$ find . -name “*.conf” -mtime +5 -ok rm { } \;
< rm … ./conf/httpd.conf > ? n

按y键删除文件,按n键不删除。

任何形式的命令都可以在-exec选项中使用。

在下面的例子中我们使用grep命令。find命令首先匹配所有文件名为“ passwd*”的文件,例如passwd、passwd.old、passwd.bak,然后执行grep命令看看在这些文件中是否存在一个sam用户。

# find /etc -name “passwd*” -exec grep “sam” { } \;
sam:x:501:501::/usr/sam:/bin/bash


二、find命令的例子;


1、查找当前用户主目录下的所有文件:

下面两种方法都可以使用

$ find $HOME -print
$ find ~ -print


2、让当前目录中文件属主具有读、写权限,并且文件所属组的用户和其他用户具有读权限的文件;

$ find . -type f -perm 644 -exec ls -l { } \;


3、为了查找系统中所有文件长度为0的普通文件,并列出它们的完整路径;

$ find / -type f -size 0 -exec ls -l { } \;


4、查找/var/logs目录中更改时间在7日以前的普通文件,并在删除之前询问它们;

$ find /var/logs -type f -mtime +7 -ok rm { } \;


5、为了查找系统中所有属于root组的文件;

$find . -group root -exec ls -l { } \;
-rw-r–r– 1 root root 595 10月 31 01:09 ./fie1


6、find命令将删除当目录中访问时间在7日以来、含有数字后缀的admin.log文件。

该命令只检查三位数字,所以相应文件的后缀不要超过999。先建几个admin.log*的文件 ,才能使用下面这个命令

$ find . -name “admin.log[0-9][0-9][0-9]” -atime -7 -ok
rm { } \;
< rm … ./admin.log001 > ? n
< rm … ./admin.log002 > ? n
< rm … ./admin.log042 > ? n
< rm … ./admin.log942 > ? n


7、为了查找当前文件系统中的所有目录并排序;

$ find . -type d | sort


8、为了查找系统中所有的rmt磁带设备;

$ find /dev/rmt -print


三、xargs

xargs - build and execute command lines from standard input

在使用find命令的-exec选项处理匹配到的文件时, find命令将所有匹配到的文件一起传递给exec执行。但有些系统对能够传递给exec的命令长度有限制,这样在find命令运行几分钟之后,就会出现溢出错误。错误信息通常是“参数列太长”或“参数列溢出”。这就是xargs命令的用处所在,特别是与find命令一起使用。

find命令把匹配到的文件传递给xargs命令,而xargs命令每次只获取一部分文件而不是全部,不像-exec选项那样。这样它可以先处理最先获取的一部分文件,然后是下一批,并如此继续下去。

在有些系统中,使用-exec选项会为处理每一个匹配到的文件而发起一个相应的进程,并非将匹配到的文件全部作为参数一次执行;这样在有些情况下就会出现进程过多,系统性能下降的问题,因而效率不高;

而使用xargs命令则只有一个进程。另外,在使用xargs命令时,究竟是一次获取所有的参数,还是分批取得参数,以及每一次获取参数的数目都会根据该命令的选项及系统内核中相应的可调参数来确定。

来看看xargs命令是如何同find命令一起使用的,并给出一些例子。

下面的例子查找系统中的每一个普通文件,然后使用xargs命令来测试它们分别属于哪类文件

#find . -type f -print | xargs file
./.kde/Autostart/Autorun.desktop: UTF-8 Unicode English text
./.kde/Autostart/.directory: ISO-8859 text\
……

在整个系统中查找内存信息转储文件(core dump) ,然后把结果保存到/tmp/core.log 文件中:

$ find / -name “core” -print | xargs echo “” >/tmp/core.log

上面这个执行太慢,我改成在当前目录下查找

#find . -name “file*” -print | xargs echo “” > /temp/core.log
# cat /temp/core.log
./file6

在当前目录下查找所有用户具有读、写和执行权限的文件,并收回相应的写权限:

# ls -l
drwxrwxrwx 2 sam adm 4096 10月 30 20:14 file6
-rwxrwxrwx 2 sam adm 0 10月 31 01:01 http3.conf
-rwxrwxrwx 2 sam adm 0 10月 31 01:01 httpd.conf
# find . -perm -7 -print | xargs chmod o-w
# ls -l
drwxrwxr-x 2 sam adm 4096 10月 30 20:14 file6
-rwxrwxr-x 2 sam adm 0 10月 31 01:01 http3.conf
-rwxrwxr-x 2 sam adm 0 10月 31 01:01 httpd.conf
用grep命令在所有的普通文件中搜索hostname这个词:

# find . -type f -print | xargs grep “hostname”
./httpd1.conf:# different IP addresses or hostnames and have them handled by the
./httpd1.conf:# VirtualHost: If you want to maintain multiple domains/hostnames
on your

用grep命令在当前目录下的所有普通文件中搜索hostnames这个词:

# find . -name \* -type f -print | xargs grep “hostnames”
./httpd1.conf:# different IP addresses or hostnames and have them handled by the
./httpd1.conf:# VirtualHost: If you want to maintain multiple domains/hostnames
on your

注意,在上面的例子中, \用来取消find命令中的*在shell中的特殊含义。

find命令配合使用exec和xargs可以使用户对所匹配到的文件执行几乎所有的命令。


四、find 命令的参数

下面是find一些常用参数的例子,有用到的时候查查就行了,像上面前几个贴子,都用到了其中的的一些参数,也可以用man或查看论坛里其它贴子有find的命令手册


1、使用name选项

文件名选项是find命令最常用的选项,要么单独使用该选项,要么和其他选项一起使用。

可以使用某种文件名模式来匹配文件,记住要用引号将文件名模式引起来。

不管当前路径是什么,如果想要在自己的根目录$HOME中查找文件名符合*.txt的文件,使用~作为 ‘pathname’参数,波浪号~代表了你的$HOME目录。

$ find ~ -name “*.txt” -print

想要在当前目录及子目录中查找所有的‘ *.txt’文件,可以用:

$ find . -name “*.txt” -print

想要的当前目录及子目录中查找文件名以一个大写字母开头的文件,可以用:

$ find . -name “[A-Z]*” -print

想要在/etc目录中查找文件名以host开头的文件,可以用:

$ find /etc -name “host*” -print

想要查找$HOME目录中的文件,可以用:

$ find ~ -name “*” -print 或find . -print

要想让系统高负荷运行,就从根目录开始查找所有的文件。

$ find / -name “*” -print

如果想在当前目录查找文件名以两个小写字母开头,跟着是两个数字,最后是.txt的文件,下面的命令就能够返回名为ax37.txt的文件:

$find . -name “[a-z][a-z][0–9][0–9].txt” -print


2、用perm选项

按照文件权限模式用-perm选项,按文件权限模式来查找文件的话。最好使用八进制的权限表示法。

如在当前目录下查找文件权限位为755的文件,即文件属主可以读、写、执行,其他用户可以读、执行的文件,可以用:

$ find . -perm 755 -print

还有一种表达方法:在八进制数字前面要加一个横杠-,表示都匹配,如-007就相当于777,-006相当于666

# ls -l
-rwxrwxr-x 2 sam adm 0 10月 31 01:01 http3.conf
-rw-rw-rw- 1 sam adm 34890 10月 31 00:57 httpd1.conf
-rwxrwxr-x 2 sam adm 0 10月 31 01:01 httpd.conf
drw-rw-rw- 2 gem group 4096 10月 26 19:48 sam
-rw-rw-rw- 1 root root 2792 10月 31 20:19 temp
# find . -perm 006
# find . -perm -006
./sam
./httpd1.conf
./temp
-perm mode:文件许可正好符合mode-perm +mode:文件许可部分符合mode

-perm -mode: 文件许可完全符合mode


3、忽略某个目录

如果在查找文件时希望忽略某个目录,因为你知道那个目录中没有你所要查找的文件,那么可以使用-prune选项来指出需要忽略的目录。在使用-prune选项时要当心,因为如果你同时使用了-depth选项,那么-prune选项就会被find命令忽略。

如果希望在/apps目录下查找文件,但不希望在/apps/bin目录下查找,可以用:

$ find /apps -path “/apps/bin” -prune -o -print


4、使用find查找文件的时候怎么避开某个文件目录

比如要在/usr/sam目录下查找不在dir1子目录之内的所有文件

find /usr/sam -path “/usr/sam/dir1″ -prune -o -print

find [-path ..] [expression] 在路径列表的后面的是表达式

-path “/usr/sam” -prune -o -print 是 -path “/usr/sam” -a -prune -o
-print 的简写表达式按顺序求值, -a 和 -o 都是短路求值,与 shell 的 && 和 || 类似如果 -path “/usr/sam” 为真,则求值 -prune , -prune 返回真,与逻辑表达式为真;否则不求值 -prune,与逻辑表达式为假。如果 -path “/usr/sam” -a -prune 为假,则求值 -print ,-print返回真,或逻辑表达式为真;否则不求值 -print,或逻辑表达式为真。

这个表达式组合特例可以用伪码写为

if -path “/usr/sam” then
  -prune
else
  -print

避开多个文件夹

find /usr/sam \( -path /usr/sam/dir1 -o -path /usr/sam/file1 \) -prune -o -print

圆括号表示表达式的结合。

\ 表示引用,即指示 shell 不对后面的字符作特殊解释,而留给 find 命令去解释其意义。

查找某一确定文件,-name等选项加在-o 之后

#find /usr/sam \(-path /usr/sam/dir1 -o -path /usr/sam/file1 \) -prune -o -name “temp” -print


5、使用user和nouser选项

按文件属主查找文件,如在$HOME目录中查找文件属主为sam的文件,可以用:

$ find ~ -user sam -print

在/etc目录下查找文件属主为uucp的文件:

$ find /etc -user uucp -print

为了查找属主帐户已经被删除的文件,可以使用-nouser选项。这样就能够找到那些属主在/etc/passwd文件中没有有效帐户的文件。在使用-nouser选项时,不必给出用户名; find命令能够为你完成相应的工作。

例如,希望在/home目录下查找所有的这类文件,可以用:

$ find /home -nouser -print


6、使用group和nogroup选项

就像user和nouser选项一样,针对文件所属于的用户组, find命令也具有同样的选项,为了在/apps目录下查找属于gem用户组的文件,可以用:

$ find /apps -group gem -print

要查找没有有效所属用户组的所有文件,可以使用nogroup选项。下面的find命令从文件系统的根目录处查找这样的文件

$ find / -nogroup-print


7、按照更改时间或访问时间等查找文件

如果希望按照更改时间来查找文件,可以使用mtime,atime或ctime选项。如果系统突然没有可用空间了,很有可能某一个文件的长度在此期间增长迅速,这时就可以用mtime选项来查找这样的文件。

用减号-来限定更改时间在距今n日以内的文件,而用加号+来限定更改时间在距今n日以前的文件。

希望在系统根目录下查找更改时间在5日以内的文件,可以用:

$ find / -mtime -5 -print

为了在/var/adm目录下查找更改时间在3日以前的文件,可以用:

$ find /var/adm -mtime +3 -print


8、查找比某个文件新或旧的文件

如果希望查找更改时间比某个文件新但比另一个文件旧的所有文件,可以使用-newer选项。它的一般形式为:

newest_file_name ! oldest_file_name

其中,!是逻辑非符号。

查找更改时间比文件sam新但比文件temp旧的文件:

例:有两个文件

-rw-r–r– 1 sam adm 0 10月 31 01:07 fiel
-rw-rw-rw- 1 sam adm 34890 10月 31 00:57 httpd1.conf
-rwxrwxr-x 2 sam adm 0 10月 31 01:01 httpd.conf
drw-rw-rw- 2 gem group 4096 10月 26 19:48 sam
-rw-rw-rw- 1 root root 2792 10月 31 20:19 temp
# find -newer httpd1.conf ! -newer temp -ls
1077669 0 -rwxrwxr-x 2 sam adm 0 10月 31 01:01 ./httpd.conf
1077671 4 -rw-rw-rw- 1 root root 2792 10月 31 20:19 ./temp
1077673 0 -rw-r–r– 1 sam adm 0 10月 31 01:07 ./fiel
查找更改时间在比temp文件新的文件:

$ find . -newer temp -print


9、使用type选项
在/etc目录下查找所有的目录,可以用:

$ find /etc -type d -print

在当前目录下查找除目录以外的所有类型的文件,可以用:

$ find . ! -type d -print

在/etc目录下查找所有的符号链接文件,可以用

$ find /etc -type l -print


10、使用size选项

可以按照文件长度来查找文件,这里所指的文件长度既可以用块(block)来计量,也可以用字节来计量。以字节计量文件长度的表达形式为N c;以块计量文件长度只用数字表示即可。

在按照文件长度查找文件时,一般使用这种以字节表示的文件长度,在查看文件系统的大小,因为这时使用块来计量更容易转换。
在当前目录下查找文件长度大于1 M字节的文件:

$ find . -size +1000000c -print

在/home/apache目录下查找文件长度恰好为100字节的文件:

$ find /home/apache -size 100c -print

在当前目录下查找长度超过10块的文件(一块等于512字节):

$ find . -size +10 -print


11、使用depth选项

在使用find命令时,可能希望先匹配所有的文件,再在子目录中查找。使用depth选项就可以使find命令这样做。这样做的一个原因就是,当在使用find命令向磁带上备份文件系统时,希望首先备份所有的文件,其次再备份子目录中的文件。

在下面的例子中, find命令从文件系统的根目录开始,查找一个名为CON.FILE的文件。

它将首先匹配所有的文件然后再进入子目录中查找。

$ find / -name “CON.FILE” -depth -print


12、使用mount选项

在当前的文件系统中查找文件(不进入其他文件系统),可以使用find命令的mount选项。

从当前目录开始查找位于本文件系统中文件名以XC结尾的文件:

$ find . -name “*.XC” -mount -print

五、关于本文

本文是find 命令的详细说明,可贵的是针对参数举了很多的实例,大量的例证,让初学者更为容易理解;本文是zhy2111314兄贴在论坛中;我对本文进行了再次整理,为方便大家阅读; ── 北南南北

六、相关文档

2007-11-19

software wars

Filed under: 思想情感, 技术相关 — admin @ 11:59 pm

软件的战争,此消彼长.

2007-11-18

网络暴力?!

Filed under: 思想情感, 生活娱乐 — admin @ 11:42 pm

这个词我似乎在上个铜须门事件所注意到的,也是近几年来,网络上对于网友抒发情感时,专家的定性。这次的3377事件也有人指责网友行为是网络暴力。于是我在想,网友对于第三者插足事件为什么这么兴奋?个人认为可能是如下:

1.网友大多为20左右的年轻人。年轻人总是血气方刚。总会不乏正义感。想什么说什么。

2.现实中网友并不是执法者,也并没有机会作为“法官”来判罚一件事情或一个人。

3. 网友只坚持自己的好恶,自己的是非判断则是评论这件事情或者这个人的准绳。是道德而非法律。

那什么是网络暴力呢?鉴于”专家“的看法,就是坚持了自己的道德底限而非法律的网友们的行为。这些行为攻击了他人,暴露了别人的隐私。他(她)们的行为和语言使得触犯道德地线的人们,感觉到现实的压力了。

这种压力使得那些犯众怒,冲破了道德底限,去不背负法律制裁的人一个很好的因果报应。这个报应使得他们逍遥法律之外,却逍遥不了道德的谴责之外。然而,当网友不用”人肉搜索“揭开他(她)的隐私时,这种道德的谴责却大大折扣。也许正式网络暴力,使得这种谴责更具有力量。

3377事件中既然现实对33和77都没有任何的惩罚。网络暴力则是一个迟到的惩罚。种业因,则得业果。然也。

就知道笑

Filed under: 思想情感, 生活娱乐, 运动健康 — admin @ 1:50 am

 去饭店吃饭,有个哥儿们中途去厕所,回来后很神秘的告诉我们:”这家酒店的生意太好了,连厕所里都摆着两桌!” 
    大伙正奇怪的时候,一伙人冲了过来,揪起那哥儿们就要打。我们当然不干了,问他们:他又没惹着你们,你们打他干什么? 
    ”打他干什么?我们吃饭吃的好好的,可这家伙跑到我们包房里撒了泡尿就走。”


经典笑话:一毛钱的爱

“你有多爱我?”

“一毛钱之多。”

“只有这么一点么?”

“一毛钱不就是‘十分’吗?”

她:“因为别人都不同情你,我才做你的妻子。”

他:“你总算成功了。现在每个人都因此同情我。”

   两个朋友领到工资决定去喝酒。 
    其中一人有些担心:“我的妻子很厉害,很可能不让我进家门。” 
    “我喝醉了回家,先在门外把衣服脱光,再按门铃。当妻子打开门,我赶紧把衣服扔进屋里。她看到我一丝不挂,立刻让我进家门。”
    第二天,两人相遇。 
    “喂,昨天你妻子怎么对待你?”
    “咳,别提了!”我走到门口,脱光衣服,门开了,我把衣服扔出手,这时听见门里传来声音:“请留意,现在关门。下一站是人民广场。”

2007-11-16

如果你的感情没了,工作丢了,钱包被偷了,你该如何安慰自己?

Filed under: 未分类 — admin @ 4:06 pm

如果你的感情没了,工作丢了,钱包被偷了,你该如何安慰自己?事实,有很多人都在面临着形形色色的问题.这些问题自从你从受”保护”的学校出来后,都会遇到.

我们不奢望遇到这些事情都高高兴兴去面对,至少心情应该克制自己,让自己不在受这些事情的影响,徒增负面情绪.情绪的失落,不仅仅让自己免疫下降,更是自己的生活浑浑噩噩,工作一塌糊涂.祸不单行的道理,就是在这种负面情绪”盛行”时,产生的.

如果遇到这样的事情,要坚信,这只是暂时.陷入祸不单行的生活旋涡,我们更应该去仔细思考,摆脱恶魔之手,对你的不洁之触.生活就这样,你快乐会聚集,痛苦也一样.

当人陷入这痛苦的深渊时,记得不要一个人承担.人说”快乐越分越多,痛苦越分越少”.这个时候的不应该与内心的孤独的灵魂对话,一旦沾染上它,便越陷越深.

什么时候结束,什么时候问题解决了,心情便会自己的好起来,看到的太阳才是快乐的颜色.否则人是无法摆脱这痛苦的阴影.

也许经历过后,便成熟了,成长需要代价.代价越大,成熟越早.代价越多,成熟越快.人只有经历了,才会知道如何去控制.一如水性,游过,才会懂得控制.

生活根本不平淡,因为有很多的决择.每天都如此.别让一时的颜色,罩住了你整个人生旅途的色彩.

把现实中的问题,做为困难来解决它.实现上,每个人都有那份战胜困难的心情.但并不是一定每个人都会把生活的麻烦,不快上升为困难来解决.

总是把自己的困难看成最大的,以至于影响的太阳的色彩.但有一个故事是这样说的.”一个小女孩因为没有鞋穿而哭,直到她看到一个没脚的人”.难道真得要遇到比自己更加不幸的人,才会心理平衡吗?

生活总在快乐的波峰,与痛苦的波谷的中徘徊,任何都不可逃脱.只是长大了,快乐如此之少,才使得我们相互要祝福快乐.

你快乐吗?你痛苦了吗?那只是你生活节奏的一部分,是你感知社会,人生的必经的旅途.体验吧!

2007-11-14

早十到晚十

Filed under: 未分类 — admin @ 1:27 pm

工作,早十到晚十.也可能早十一到晚十一.

2007-11-12

不含中文的正则

Filed under: 技术相关 — admin @ 9:40 pm

没找到相关的.我给写成这样.不知道对否,不对,结果应该是对的.

$str = “你是谁”;

if(preg_match(”/^[^”.chr(0xa1).”-”.chr(0xff).”]+$/”, $str)){

echo “yes”;

} else{

echo “no”;

}

2007-11-10

文件乱码-vim设置也需要清楚意思

Filed under: 未分类 — admin @ 3:36 pm

日前,同事在用vim编辑PHP程序时,出现编码的问题.
我们的程序是通过一个安装程序安装到目标目录的.目标目录是UTF-8的编码.但发送总会时不时出现乱码.
最后确定为是vim配置文件 .vimrc有问题.有这样一行代码:
set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1

fileencodings(fenc):Vim在打开文件时会根据fileencodings选项来识别文件编码,fileencodings可以同时设置多个编码,Vim会根据设置的顺序来猜测所打开文件的编码。

这使得每次保存vim对内容按着指定的顺序进行编码.总会在保存文件内容时出”[已转换]”的字样.

解决方法:去掉则正常.看来不是所有的网上东西都拿来”借鉴”,否则出问题也不知道出什么样问题了.

Newer Posts »

Powered by WordPress