我尝试使用sed '/\bpassword\b/d'和sed "/\<password\>/d"仅查找包含“密码”的行并删除它们,但它不起作用,该命令还找到诸如“密码!”之类的词。或“密码@”。
假设我有这些话:
password
password1
password2
password!
password@
password%
password*
Run Code Online (Sandbox Code Playgroud)
我只需要删除带有“密码”的行而不是其他行。目前这两个命令删除了 "password@" 、 "password%" 、 "password!" 还有“密码*”。
mkdir dregsfolder
find /home/tony/Desktop/unsorted_files/ -maxdepth 1 -not \( -type d -or -iname "*.jpg" -or -iname "*.gif" -or -iname "*.docx" \)xargs -0 --no-run-if-empty mv /home/tony/Desktop/dregsfolder
Run Code Online (Sandbox Code Playgroud)
当我运行该代码时;我被告知
find: paths must precede expression: )xargs
Run Code Online (Sandbox Code Playgroud)
我很困惑,因为我认为路径已经用/home/tony/Desktop/unsorted_files.
我更加困惑,因为在Unix & Linux Stack Exchange 上的这个问题中,我们有一个xargs将文件复制到名为 的目录的示例play:
find /tmp/ -ctime -1 -name "x*" | xargs -I '{}' mv '{}' ~/play/
Run Code Online (Sandbox Code Playgroud)
而这里,似乎是目标目录,即播放;已在xargs...之后指定
我想澄清与之相关的精确机制xargs和其中的细微差别,不仅要解析目录中的文件(如上一个问题中所述),而且还要解析它在 unix 世界中与参数相关的更广泛的使用.
当我使用 Firefox 57 时,python 崩溃并需要一段时间才能恢复。这是报告。
ProblemType: Crash
DistroRelease: Ubuntu 17.10
Package: apport-gtk 2.20.7-0ubuntu3.4
ProcVersionSignature: Ubuntu 4.13.0-16.19-generic 4.13.4
Uname: Linux 4.13.0-16-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.4
Architecture: amd64
CrashCounter: 1
CurrentDesktop: GNOME
Date: Tue Nov 21 11:23:58 2017
ExecutablePath: /usr/share/apport/apport-gtk
InstallationDate: Installed on 2017-09-20 (62 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
InterpreterPath: /usr/bin/python3.6
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/share/apport/apport-gtk
ProcEnviron:
LANGUAGE=en_IN:en
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_IN
SHELL=/bin/bash
Python3Details: /usr/bin/python3.6, Python 3.6.3, python3-minimal, 3.6.3-0ubuntu2
PythonArgs: ['/usr/share/apport/apport-gtk']
PythonDetails: /usr/bin/python2.7, Python 2.7.14, …Run Code Online (Sandbox Code Playgroud) 在 Windows 中,我可以看到在控制台上运行的服务器。我可以查看是否有错误或正在加载什么等等。但是在 Ubuntu 服务器中,我如何从终端看到服务器正在做什么?。
我正在运行一个.sh文件。我可以看到它正在运行,但我不知道它在做什么,或者是否有/曾经出现错误。
顺便说一句,我正在使用 xampp。
我在终端中用 .bashrc 做一些事情,每次打开终端后我就开始收到错误,它一直保持这种情况,直到我这样做Ctrl+C。
这正是我每次打开终端时看到的:
?\udcf7\udcca\udcd5\udcfewD\udcba\udcc4\udcf9\udc93\udcc3?%\udcae?l\udcb0l\udcd8~\udcb3?vF-Jwx: command not found
VimCrypt~01!X\udca0oudc8f\udca1\udc85\udcb4\udcf1c\udce8KA\udcad\udcd2\udce6
\udce4*^u\udc84+o\udcf8\udcb8r\udcc5\udcc6WK^?: command not found
O\udcfd\udcc5I\udccbNeC\udc84: command not found
bash: /home/faruksimsekli/.bashrc: line 3: syntax error near unexpected token `)'
bash: /home/faruksimsekli/.bashrc: line 3: `???????????7?V???o5?-1W???]?fHel?CO>z?U??j?-??A??B>??pR??P
??????)??????%???#s,?(5~L??fo:(??re???a?
0C+????[ML??r?d'
faruksimsekli@7:~$ \udca9\udcb4\udce1x\udca4\udc9d\udc92svcl\udc85v\udc85\udccbc\udcb6u\udc8d\udcf1\udcc4: command not found
Run Code Online (Sandbox Code Playgroud) WSL 中的日志目录在哪里?
好像没有这样的目录/var/log/。
我的目标是每天运行这个 *nix cron 命令:
0 0 * * * cat /dev/null > /var/mail/* /var/log/*
Run Code Online (Sandbox Code Playgroud) 刚刚从 Windows 完全切换到 Ubuntu,我很高兴。
我有个问题; 有一个名为 的文件夹/root。我想知道如何使用该ls命令找出与此文件夹关联的所有者和组,以及他们各自拥有哪些权限。
我有 Ubuntu 12.04.5 LTS。
在终端我执行:
/etc/profile
Run Code Online (Sandbox Code Playgroud)
因此返回权限被拒绝。
这让我感到惊讶,因为我运行了sudo -s命令并且我的命令提示符以root@...
这是什么原因?
是否有命令行工具可以删除whereis返回的所有内容(即使它们是目录),但即使使用部分名称也能工作(例如,如果我提供字符串,gmai它也会删除名为 的文件gmail)。
因此,递归地查看所有目录并删除名称中包含字符串的目录的内容。
例如,如果目录被mail/gmail/sentmail删除下面的所有内容gmail。
Ubuntu 16.04.3 LTS 上支持的 GCC 当前版本是 5.4 版本,最新的 GCC 版本已经是 7.0。那么我们可以期待在 Ubuntu 18.04 LTS 中出现更新版本的 GCC 吗?