发现这样找图片最方便

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

发现这样找图片最方便

#1

帖子 eexpress » 2013-06-17 23:41

代码: 全选

● locate fs-directory.svg|xargs eog
忏悔过去的错误。
● 鸣学
头像
bzhao
帖子: 250
注册时间: 2008-07-05 2:15
系统: XUbuntu

Re: 发现这样找图片最方便

#2

帖子 bzhao » 2013-06-19 10:46

我帮你改善一下
locate -0 fs-directory.svg|xargs -0 eog
(0 是 zero)
这样可以支持有空格的文件名
Bill Z
stat -c %a filename
\_.\{-}
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 发现这样找图片最方便

#3

帖子 eexpress » 2013-06-19 11:03

bzhao, 不错。还没注意到这。
以前是自己写一个function做的。
● 鸣学
头像
youzhiyili
帖子: 2422
注册时间: 2012-03-22 20:42
系统: ubuntu22.04

Re: 发现这样找图片最方便

#4

帖子 youzhiyili » 2013-06-19 16:23

菜鸟路过,先收藏再说
@自由建客 @qy117121 @枫叶饭团 @cikekid @YeLee @jtshs256 @eexpress @ljj_jjl2008 @zhw2101024 @TeliuTe @月下叹逍遥 @leeaman @懒蜗牛Gentoo @灰色小狼 @photor @adagio @JiangHui @phoenixlzx @oneleaf
头像
lilydjwg
论坛版主
帖子: 4249
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: 发现这样找图片最方便

#5

帖子 lilydjwg » 2013-06-20 11:06

我做了个 wrapper: https://github.com/lilydjwg/myhaskells/ ... ylocate.hs

还有替代用的 shell 版:
[bash]
[[ -n $commands[l] ]] || alias l='locate'
[[ -n $commands[lre] ]] || alias lre='locate -b --regex'
[[ -n $commands[lrew] ]] || alias lrew='locate --regex'
[/bash]
回复