我试图对文件夹进行一些跟踪,并希望使用文件中的 find -name 过滤器。因此,我准备了一个名为 filter_files 的文件,其中包含过滤器,例如:
cat filter_files:
-name "a.txt" -o -name "b.txt"
Run Code Online (Sandbox Code Playgroud)
我尝试运行 find 命令并添加上述过滤器,但它什么也不返回,如果我写入文件的内容并将其粘贴到 find 命令中,它就会成功。
我的 bash 文件中的相关行是:
local filter=$(cat $filter_files)
find_files=$(find "$path" -type f \( $filter \) )
Run Code Online (Sandbox Code Playgroud)
你能向我解释一下我是否可以做我想做的事吗?如果是的话,我怎样才能让它发挥作用?
我按照本指南在我的服务器上将 debian 10 更新到 11: https: //phoenixnap.com/kb/upgrade-debian-10-to-11
在步骤 6 中:
sudo apt full-upgrade -y
Run Code Online (Sandbox Code Playgroud)
我看到一个带有基于文本的 (G)UI 的屏幕,上面写着类似的内容(我是凭记忆引用的):
[...]将安装一些证书[...]
选择您信任的人:
还有一个复选框列表,其中包含 Mozilla 等名称,最后还有一个“确定”按钮。
所以,我打算检查所有复选框。由于我只能使用键盘,因此我使用箭头键将文本光标移动到第一个复选框,然后按 Enter 键以选择该复选框。
因为设计这个 (G)UI 的人显然是个天才,所以按 Enter 会导致提交表单(没有选中任何复选框,或者可能是第一个),而不是选中我的光标所在的复选框。
所以现在,我想,没有一个证书是“可信的”(希望它们仍然会被“安装”,至少是这么说的),无论这意味着什么。
我的问题是:
我最近在我的系统上安装了阿拉伯语,从那时起 apt 有时用阿拉伯语做事,有时用英语做事
\nuser@pop-os:~$ sudo apt update && sudo apt upgrade\nHit:1 https://dl.winehq.org/wine-builds/ubuntu focal InRelease \nHit:2 http://packages.microsoft.com/repos/code stable InRelease \nHit:3 http://apt.pop-os.org/proprietary jammy InRelease \nHit:4 http://apt.pop-os.org/release jammy InRelease\nHit:5 http://apt.pop-os.org/ubuntu jammy InRelease\nHit:6 http://apt.pop-os.org/ubuntu jammy-security InRelease\nHit:7 http://apt.pop-os.org/ubuntu jammy-updates InRelease\nHit:8 http://apt.pop-os.org/ubuntu jammy-backports InRelease\n\xd9\x82\xd8\xb1\xd8\xa7\xd8\xa1\xd8\xa9 \xd9\x82\xd9\x88\xd8\xa7\xd8\xa6\xd9\x85 \xd8\xa7\xd9\x84\xd8\xad\xd8\xb2\xd9\x85... \xd8\xaa\xd9\x85\xd9\x91% \nBuilding dependency tree... \xd8\xaa\xd9\x85\xd9\x91%\nReading state information... \xd8\xaa\xd9\x85\xd9\x91 \nAll packages are up to date.\n\xd9\x82\xd8\xb1\xd8\xa7\xd8\xa1\xd8\xa9 \xd9\x82\xd9\x88\xd8\xa7\xd8\xa6\xd9\x85 \xd8\xa7\xd9\x84\xd8\xad\xd8\xb2\xd9\x85... \xd8\xaa\xd9\x85\xd9\x910%\nBuilding dependency tree... \xd8\xaa\xd9\x85\xd9\x91% \nReading state information... \xd8\xaa\xd9\x85\xd9\x91 \n\xd8\xad\xd8\xb3\xd8\xa7\xd8\xa8 \xd8\xa7\xd9\x84\xd8\xaa\xd8\xb1\xd9\x82\xd9\x8a\xd8\xa9... \xd8\xaa\xd9\x85\xd9\x91%\nGet more security updates through Ubuntu Pro with 'esm-apps' enabled:\n vlc-plugin-qt libvlc5 libimage-magick-perl …Run Code Online (Sandbox Code Playgroud) 我喜欢nano并且经常使用它。一个相关的应用程序是rnano.
从rnano手册中:
DESCRIPTION\n rnano runs the nano editor in restricted mode. This allows editing\n only the specified file or files, and doesn't allow the user access to\n the filesystem nor to a command shell.\n\n In restricted mode, nano will:\n\n \xe2\x80\xa2 not allow suspending;\n\n \xe2\x80\xa2 not allow saving the current buffer under a different name;\n\n \xe2\x80\xa2 not allow inserting another file or opening a new buffer;\n\n \xe2\x80\xa2 not allow appending or prepending to …Run Code Online (Sandbox Code Playgroud) bash shell 中确定用于编译当前运行的内核的 GCC 版本的可靠方法是什么?我需要它的形式,major.minor.patch以便我可以将它与输出中第一行的最后一个标记进行比较gcc --version。
我一直在/proc/version使用以下内容进行解析:
awk '{print $8}' /proc/version | tr -d ','
Run Code Online (Sandbox Code Playgroud)
但是,我正在查找的版本字符串并不总是出现在/proc/version. 有更稳健的方法吗?一个仅适用于 Ubuntu 的强大解决方案就足够了,如果更困难的话,无需使其独立于发行版。
拥有一个点文件和一个相邻的不带点的同名文件是一种不好的做法吗?
背景:我们已经创建了一个 $HOME/.ourapp 目录,在其中存储各种配置文件、日志文件等,但我们正在讨论将用户添加、创建和修改的文件放置在哪里,无论是从应用程序外部还是从应用程序外部在其中使用各种工具。将它们放在 $HOME/ourapp 中似乎是最自然的,但这可能是不好的做法或令人困惑。
某些 .deb 二进制文件是否需要相互安装和删除?\n如果是这样,您如何解决这个问题?
\n我观察到,我想在离线 PC 上安装 Kodi,但我无法为需要 kodi-bin 的 kodi-x11 安装 .deb,反之亦然,尝试其他 .deb。
\n我必须把电脑带到有互联网的地方并使用软件包安装程序,我选择了 Kodi-bin 或 kodi-x11,我注意到软件包管理器同时安装了 kodi-x11 或 kodi-bin。
\n如果我尝试卸载一个,它会说它可以\xe2\x80\x99t,因为另一个的依赖问题。如果我愿意,我可以同时卸载/安装两者吗?
\n谢谢
\n在 macOS 上使用 zmv,我想用下划线 (_) 替换文件名中的双引号 (")。但是,我无法让 zshexpn 正确隔离 ". 我应该使用一些神奇的 zsh/zmv/zshexpn 选项吗?
% zmv -n '(**/)(*)' '$1${(S)2//"/_}'
zmv: syntax error in replacement
% zmv -n '(**/)(*)' '$1${(S)2//\"/_}'
zmv: syntax error in replacement`
% zmv -n '(**/)(*)' '$1${(Sp)2//\"/_}'
zmv: syntax error in replacement
Run Code Online (Sandbox Code Playgroud)
(这是更大的替换非法字符活动的一部分。我希望使用一个 zmv 表达式来完成整个事情。)
感谢您的任何帮助。
要对同一个输入文件进行多次传递,这个简单的情况可以正常工作:
$ awk 'p==1{print $1}; p==2{print $2}; p==3{print $3}' p=1 infile p=2 infile p=3 infile
Run Code Online (Sandbox Code Playgroud)
但这个改变失败了吗?
$ awk 'p==1{/Jan/ {print $1}}; p==2{print $2}; p==3{print $3}' p=1 infile p=2 infile p=3 infile
Run Code Online (Sandbox Code Playgroud)
我不想使用这样的术语:
p==1 && /Jan/ {print $1}
Run Code Online (Sandbox Code Playgroud)
因为我想保持(原始)代码的可读结构。
如何在每个括号内使用条件术语?
例子:
$ cat infile
James Exeter 48
Alex Leeds 22
Jan London 35
Run Code Online (Sandbox Code Playgroud)
期望的结果:
Jan
Exeter
Leeds
London
48
22
35
Run Code Online (Sandbox Code Playgroud)