find . -type f -print -exec cat {} \; | grep some string
上面的命令不打印文件路径。
我正在使用:Ubuntu, bash 4。
我正在尝试HPCC在基于 RHEL 的机器上安装。
我有一个.rpm文件并要安装这个 rpm,我使用以下命令:
sudo rpm -Uvh hpccsystems-platform_community-4.0.0-9.el6.x86_64.rpm
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
error: Failed dependencies:
boost-regex is needed by hpccsystems-platform-community-4.0.09.x86_64
expect is needed by hpccsystems-platform-community-4.0.09.x86_64
gcc-c++ is needed by hpccsystems-platform-community-4.0.09.x86_64
libapr-1.so.0()(64bit) is needed by hpccsystems-platform-community-4.0.09.x86_64
libaprutil-1.so.0()(64bit) is needed by hpccsystems-platform-community-4.0.09.x86_64
libarchive is needed by hpccsystems-platform-community-4.0.09.x86_64
liblber-2.4.so.2()(64bit) is needed by hpccsystems-platform-community-4.0.09.x86_64
libldap_r-2.4.so.2()(64bit) is needed by hpccsystems-platform-community-4.0.09.x86_64
libssl.so.10()(64bit) is needed by hpccsystems-platform-community-4.0.09.x86_64
4.0.09.x86_64
Run Code Online (Sandbox Code Playgroud)
请注意,这是我第一次使用 RHEL。我使用过 Ubuntu,在 Ubuntu 中,使用apt-get install获取软件及其依赖项的命令来安装软件更容易。
如何安装它rpm并自动安装它的所有依赖项?
我最近正在研究使用tail -f来监视一些文本文件,例如:tail -f /var/sometext.
但是,当我进行一些测试时,它似乎不起作用。我所做的是我创建了一个新文件并运行:tail -f /home/name/text然后,我在 vim 中打开了日志并进行了一些编辑,保存了它,似乎 tail 没有“看到”更改。
奇怪的是,跑步echo "hello" >> /home/name/text似乎工作正常(尾巴看到了变化)。我在某处读到这与保存文件时创建的文件描述符和新 inode 有关。
有人可以为我解释一下吗?我不太明白这实际上是如何工作的,但我知道文件描述符是什么。
我有以下问题:
我只需要将一些文件夹从google-drivePC同步到其中一台:
但是如果我在根目录中创建任何文件(确切地说是文件,而不是文件夹),google-drive它们将在这台 PC 上同步,则会出现问题:

有没有办法防止这种行为?
在设置和互联网中搜索没有得到任何有用的结果。
我只找到了这个论坛,但刚刚报告了相同的行为。
我知道,我可以将所有文件保存在文件夹中,并且不会弄乱驱动器的根目录,但是这种同步设置的行为至少不明显。
我承认这个问题以前在这里被问过:
就像将Zip 压缩到单独的文件中一样,询问的人没有指定他使用的操作系统,也没有收到任何答复。
我需要将一个巨大的目录分成多个不相互依赖的 .zip 文件。所以,而不是:
file1.zip
file2.z01
file3.z02我想要以下一组文件:
file1.zip
file2.zip
file3.zip
基本上这是我的问题。我在 OS X 上,所以 shell 脚本或 AppleScript 将是最简单的方法。
另外,这里有一个人提出了同样的问题 - 只有他想创建一个 .tar 存档:如何为一组文件创建单独的存档
答案是正确的,但会产生 tar 文件:
for file in `ls *`; do tar -czvf $file.tar.gz $file ; done
Run Code Online (Sandbox Code Playgroud)
PS:最后一部分仅适用于那些适合键盘大师的人:
我还尝试在 Keyboard Maestro 中执行此操作,我有一个“for each”操作设置,用于确定文件路径,然后触发 shell 脚本。输出是正确的,如果我将它粘贴到终端中,宏就可以工作(例如zip
/Users/me/Desktop/test /Users/me/Desktop/test.txt)。
但是,当我将两个变量传递给 Keyboard Maestro 中的 shell 脚本时,将无法正常工作:
zip "$KMVAR_zipPath" "$KMVAR_sourcePath"
linux ×2
applescript ×1
bash ×1
find ×1
google-drive ×1
google-sync ×1
inode ×1
installation ×1
macos ×1
rhel-6 ×1
rpm ×1
shell ×1
sync ×1
tail ×1
terminal ×1
zip ×1