简体   繁体   English

如何查找没有“权限被拒绝”的带有“ gtk”的文件

[英]How find files with 'gtk' that aren't 'permission denied'

I'm trying to find files in linux with gtk in the name, but I'm getting a lot of garbage permission denied in my output. 我试图在Linux中以gtk为名称查找文件,但是我的输出中拒绝了很多垃圾许可 I'm trying to figure out how to trim the results, and was reading trim it and find it , but I'm having trouble putting the info from those posts together with finding the file and path to the file. 我试图弄清楚如何修剪结果,并正在阅读修剪找到它 ,但是在将这些帖子中的信息以及查找文件和文件路径时遇到了麻烦。

This is how I find the file, with permission denied in output: 这是我查找文件的方式,在输出中拒绝了权限:

find . -ipath '*gtk*' | grep gtk

I tried cleaning up permission denied, but it's not working (shows no files): 我尝试清除被拒绝的权限,但无法正常工作(未显示文件):

find / \! -readable -prune -o -name . -ipath '*gtk*' -ls | grep gtk

I tried this too, but it still shows permission denied in output: 我也尝试过,但是它仍然显示输出中拒绝了权限:

find . -ipath '*gtk*' -not -regex 'Permission' | grep gtk

Tried this too: 也尝试过这个:

find . -ipath '*gtk*' ! -readable ! -executable -prune -o -print | grep gtk (error with -o)

You can pipe stderr to a file so you don't have to see it: 您可以将stderr管道传输到文件,因此不必查看它:

find . 找 。 -ipath ' gtk ' | -ipath 'GTK' | grep gtk 2>error.log grep gtk 2> error.log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM