查找由给定命令修改的文件

这帮助我多次尝试查找执行命令后创建的日志文件或tmp文件。真正让人睁目大笑的是,一个给定的过程究竟有多活跃。玩--anewer,-cnewer和-newerXY
.

0

linux命令:touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/file /tmp/file -newer /path find ; $EXECUTECOMMAND ; /tmp/file touch touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/filerootopen.com
linux命令:touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/file /tmp/file -newer /path find ; $EXECUTECOMMAND ; /tmp/file touch touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/filerootopen.com
tuil 2018-05-03 09:43:48
输出
linux命令:touch 详解
替代方案1 查找由给定命令修改的文件

跟踪程序的系统调用。有关更多信息,请参阅http://linuxhelp.blogspot.com/2006/05/strace-very-powerful-troubleshooting.html。.

linux命令:strace <name of the program> program> the of <name strace strace <name of the program>rootopen.com
linux命令:strace <name of the program> program> the of <name strace strace <name of the program>rootopen.com
.
输出

评论

相关推荐

...更改修改时间和访问时间。另外:touch -r [file1] [file2]#make file2时间戳匹配file1

linux命令:touch -acm yyyymmddhhMM.ss [file] [file] yyyymmddhhMM.ss -acm touch touch -acm yyyymmddhhMM.ss [file]rootopen.com
linux命令:touch -acm yyyymmddhhMM.ss [file] [file] yyyymmddhhMM.ss -acm touch touch -acm yyyymmddhhMM.ss [file]rootopen.com
.

linux命令:touch /forcefsk /forcefsk touch touch /forcefskrootopen.com
linux命令:touch /forcefsk /forcefsk touch touch /forcefskrootopen.com
.

linux命令:touch <filename> <filename> touch touch <filename>rootopen.com
linux命令:touch <filename> <filename> touch touch <filename>rootopen.com
.

linux命令:touch balls balls touch touch ballsrootopen.com
linux命令:touch balls balls touch touch ballsrootopen.com
.

linux命令:touch /tmp/$$;for N in `seq -w 0 7777|grep -v [89]`; do chmod $N /tmp/$$; P=`ls -l /tmp/$$ | awk '{print $1}'`; echo $N $P; done;rm /tmp/$$ /tmp/$$ done;rm $P; $N echo $1}'`; '{print awk | /tmp/$$ -l P=`ls /tmp/$$; $N chmod do [89]`; -v 7777|grep 0 -w `seq in N /tmp/$$;for touch touch /tmp/$$;for N in `seq -w 0 7777|grep -v [89]`; do chmod $N /tmp/$$; P=`ls -l /tmp/$$ | awk '{print $1}'`; echo $N $P; done;rm /tmp/$$rootopen.com
linux命令:touch /tmp/$$;for N in `seq -w 0 7777|grep -v [89]`; do chmod $N /tmp/$$; P=`ls -l /tmp/$$ | awk '{print $1}'`; echo $N $P; done;rm /tmp/$$ /tmp/$$ done;rm $P; $N echo $1}'`; '{print awk | /tmp/$$ -l P=`ls /tmp/$$; $N chmod do [89]`; -v 7777|grep 0 -w `seq in N /tmp/$$;for touch touch /tmp/$$;for N in `seq -w 0 7777|grep -v [89]`; do chmod $N /tmp/$$; P=`ls -l /tmp/$$ | awk '{print $1}'`; echo $N $P; done;rm /tmp/$$rootopen.com
.

有时我需要创建一个文件目录来操作,以测试我正在烹饪的一些命令行。最主要的是范围({1..N})扩展。

linux命令:touch {1..10}.txt {1..10}.txt touch touch {1..10}.txtrootopen.com
linux命令:touch {1..10}.txt {1..10}.txt touch touch {1..10}.txtrootopen.com
.

还有可选的消息:echo“no login for you”> / etc / nologin(这不会影响你当前的X会话 - 你已经登录了!)

linux命令:touch /etc/nologin /etc/nologin touch touch /etc/nologinrootopen.com
linux命令:touch /etc/nologin /etc/nologin touch touch /etc/nologinrootopen.com
.

-a用于访问时间,-m用于修改时间,-c不创建任何文件,-t时间戳

linux命令:touch -amct [[CC]YY]MMDDhhmm[.ss] FILE FILE [[CC]YY]MMDDhhmm[.ss] -amct touch touch -amct [[CC]YY]MMDDhhmm[.ss] FILErootopen.com
linux命令:touch -amct [[CC]YY]MMDDhhmm[.ss] FILE FILE [[CC]YY]MMDDhhmm[.ss] -amct touch touch -amct [[CC]YY]MMDDhhmm[.ss] FILErootopen.com
.

这使用Firefox的“命令行打印”插件(http://torisugari.googlepages.com/commandlineprint2)。这个插件也可以生成PNG。在* nix上,文件必须存在;因此触摸位在前面。此外,当“打印”这种方式(页边距,页眉,页脚等)时,Firefox似乎忽略了保存的用户偏好,所以我必须手工调整我的〜/ .mozilla / firefox / xxxxxxxx.default / prefs.js文件。是的,这是* prefs.js *不user.js - 显然,Firefox也忽略我的user.js文件...

linux命令:touch $2;firefox -print $1 -printmode PDF -printfile $2 $2 -printfile PDF -printmode $1 -print $2;firefox touch touch $2;firefox -print $1 -printmode PDF -printfile $2rootopen.com
linux命令:touch $2;firefox -print $1 -printmode PDF -printfile $2 $2 -printfile PDF -printmode $1 -print $2;firefox touch touch $2;firefox -print $1 -printmode PDF -printfile $2rootopen.com
.

这需要命令行打印扩展(详见#2861)。我用它来构成复杂的图像,使用CSS和格式化文本。对于某些事情来说,它比imagemagick要轻松得多。现在想象一下使用带有PHP和数据库的本地Web服务器来生成图像。哦,可能性...

linux命令:touch $2;firefox -print $1 -printmode PNG -printfile $2 $2 -printfile PNG -printmode $1 -print $2;firefox touch touch $2;firefox -print $1 -printmode PNG -printfile $2rootopen.com
linux命令:touch $2;firefox -print $1 -printmode PNG -printfile $2 $2 -printfile PNG -printmode $1 -print $2;firefox touch touch $2;firefox -print $1 -printmode PNG -printfile $2rootopen.com
.

$ FILE2的atime和mtime时间戳根据$ FILE1的不同而改变。如果$ FILE2不存在被创建。

linux命令:touch -r "$FILE1" "$FILE2" "$FILE2" "$FILE1" -r touch touch -r "$FILE1" "$FILE2"rootopen.com
linux命令:touch -r "$FILE1" "$FILE2" "$FILE2" "$FILE1" -r touch touch -r "$FILE1" "$FILE2"rootopen.com
.

触摸具有指定日期的虚拟文件,然后使用带有-ane的查找。

linux命令:touch -t "YYYYMMDDhhmm.ss" dummy ; find . -anewer dummy dummy -anewer . find ; dummy "YYYYMMDDhhmm.ss" -t touch touch -t "YYYYMMDDhhmm.ss" dummy ; find . -anewer dummyrootopen.com
linux命令:touch -t "YYYYMMDDhhmm.ss" dummy ; find . -anewer dummy dummy -anewer . find ; dummy "YYYYMMDDhhmm.ss" -t touch touch -t "YYYYMMDDhhmm.ss" dummy ; find . -anewer dummyrootopen.com
.

用实际日期作为文件名创建一个文件

linux命令:touch file-$(date +%Y%m%d) +%Y%m%d) file-$(date touch touch file-$(date +%Y%m%d)rootopen.com
linux命令:touch file-$(date +%Y%m%d) +%Y%m%d) file-$(date touch touch file-$(date +%Y%m%d)rootopen.com
.

这对于查找最近更新的文件非常有用。特别记录或监视安装期间添加的文件。

linux命令:touch -t "YYYYMMDDhhmm.ss" ~/.ts ; find . -newer ~/.ts ~/.ts -newer . find ; ~/.ts "YYYYMMDDhhmm.ss" -t touch touch -t "YYYYMMDDhhmm.ss" ~/.ts ; find . -newer ~/.tsrootopen.com
linux命令:touch -t "YYYYMMDDhhmm.ss" ~/.ts ; find . -newer ~/.ts ~/.ts -newer . find ; ~/.ts "YYYYMMDDhhmm.ss" -t touch touch -t "YYYYMMDDhhmm.ss" ~/.ts ; find . -newer ~/.tsrootopen.com
.

linux命令:touch /path/to/file.txt /path/to/file.txt touch touch /path/to/file.txtrootopen.com
linux命令:touch /path/to/file.txt /path/to/file.txt touch touch /path/to/file.txtrootopen.com
.

linux命令:touch file file touch touch filerootopen.com
linux命令:touch file file touch touch filerootopen.com
.

这将在当前目录中创建一个名为'pk.pem'的文件,其中包含未加密的2048位RSA私钥和名为'cert.pem'的文件,其中包含由'pk.pem'签名的证书。私钥文件将具有模式600。!!注意! ==>这个命令将覆盖这两个文件(如果存在)。

linux命令:touch pk.pem && chmod 600 pk.pem && openssl genrsa -out pk.pem 2048 && openssl req -new -batch -key pk.pem | openssl x509 -req -days 365 -signkey pk.pem -out cert.pem cert.pem -out pk.pem -signkey 365 -days -req x509 openssl | pk.pem -key -batch -new req openssl && 2048 pk.pem -out genrsa openssl && pk.pem 600 chmod && pk.pem touch touch pk.pem && chmod 600 pk.pem && openssl genrsa -out pk.pem 2048 && openssl req -new -batch -key pk.pem | openssl x509 -req -days 365 -signkey pk.pem -out cert.pemrootopen.com
linux命令:touch pk.pem && chmod 600 pk.pem && openssl genrsa -out pk.pem 2048 && openssl req -new -batch -key pk.pem | openssl x509 -req -days 365 -signkey pk.pem -out cert.pem cert.pem -out pk.pem -signkey 365 -days -req x509 openssl | pk.pem -key -batch -new req openssl && 2048 pk.pem -out genrsa openssl && pk.pem 600 chmod && pk.pem touch touch pk.pem && chmod 600 pk.pem && openssl genrsa -out pk.pem 2048 && openssl req -new -batch -key pk.pem | openssl x509 -req -days 365 -signkey pk.pem -out cert.pemrootopen.com
.

linux命令:touch file{1,2,3,4,5}.sh file{1,2,3,4,5}.sh touch touch file{1,2,3,4,5}.shrootopen.com
linux命令:touch file{1,2,3,4,5}.sh file{1,2,3,4,5}.sh touch touch file{1,2,3,4,5}.shrootopen.com
.

上面的示例将递归地查找2010年创建/修改的当前目录中的文件。

linux命令:touch -t 201001010000 begin; touch -t 201012312359.59 end; find . -newer begin -a ! -newer end end -newer ! -a begin -newer . find end; 201012312359.59 -t touch begin; 201001010000 -t touch touch -t 201001010000 begin; touch -t 201012312359.59 end; find . -newer begin -a ! -newer endrootopen.com
linux命令:touch -t 201001010000 begin; touch -t 201012312359.59 end; find . -newer begin -a ! -newer end end -newer ! -a begin -newer . find end; 201012312359.59 -t touch begin; 201001010000 -t touch touch -t 201001010000 begin; touch -t 201012312359.59 end; find . -newer begin -a ! -newer endrootopen.com
.

更改文件时间戳

linux命令:touch -t [[CC]AA]MMJJhhmm[.ss] [[CC]AA]MMJJhhmm[.ss] -t touch touch -t [[CC]AA]MMJJhhmm[.ss]rootopen.com
linux命令:touch -t [[CC]AA]MMJJhhmm[.ss] [[CC]AA]MMJJhhmm[.ss] -t touch touch -t [[CC]AA]MMJJhhmm[.ss]rootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令