使用命令行,我知道我可以使用以下命令加密目录:
zip -er Directory.zip /path/to/directory
Run Code Online (Sandbox Code Playgroud)
但是,这不会加密文件名本身。如果有人跑:
unzip Directory.zip
Run Code Online (Sandbox Code Playgroud)
并反复输入错误的密码,解压缩命令将遍历所有包含的文件名,直到输入正确的密码。示例输出:
unzip Directory.zip
Archive: Directory.zip
creating: Directory/
[Directory.zip] Directory/sensitive-file-name-1 password:
password incorrect--reenter:
password incorrect--reenter:
skipping: Directory/sensitive-file-name-1 incorrect password
[Directory.zip] Directory/sensitive-file-name-2 password:
password incorrect--reenter:
password incorrect--reenter:
skipping: Directory/sensitive-file-name-2 incorrect password
[Directory.zip] Directory/sensitive-file-name-3 password:
password incorrect--reenter:
password incorrect--reenter:
skipping: Directory/sensitive-file-name-3 incorrect password
Run Code Online (Sandbox Code Playgroud)
等等。
使用命令行,有没有办法用加密压缩目录,同时加密或隐藏文件名本身?
谢谢你。
假设有一个包含 300 个数据文件的目录。我想随机选择 200 个这些文件并将它们移动到另一个目录中。有没有办法在 Unix/Linux 下做到这一点?
我的当前目录深埋在我的主目录中的多个子文件夹层中。如果我想在基于gui 的文件浏览器中打开这个目录,我必须在一个文件夹后双击文件夹才能到达它。这是非常耗时的。另一方面,只需很少的击键和多次点击选项卡按钮,就可以很容易地通过终端访问它。
我想知道是否有办法将终端中的当前目录打开到文件浏览器中。执行此操作的命令是什么?
作为参考,我有一个 ubuntu 系统,但我想知道在各种 linux 发行版中的命令是什么。
我有两个驱动器具有相同的文件,但目录结构完全不同。
有没有办法“移动”目标端的所有文件,使它们与源端的结构相匹配?也许用脚本?
例如,驱动器 A 具有:
/foo/bar/123.txt
/foo/bar/234.txt
/foo/bar/dir/567.txt
Run Code Online (Sandbox Code Playgroud)
而驱动器 B 具有:
/some/other/path/123.txt
/bar/doo2/wow/234.txt
/bar/doo/567.txt
Run Code Online (Sandbox Code Playgroud)
有问题的文件很大(800GB),所以我不想重新复制它们;我只想通过创建必要的目录和移动文件来同步结构。
我正在考虑一个递归脚本,它会在目标上找到每个源文件,然后将其移动到匹配的目录,如有必要,创建它。但是——这超出了我的能力!
这里给出了另一个优雅的解决方案:https : //superuser.com/questions/237387/any-way-to-sync-directory-structure-when-the-files-are-already-on-both-sides/238086
我以前从未遇到过这个问题,但由于某种原因,我无法将文件夹重命名为packages/.
这是结构:
root
- packages_old/
- packages
Run Code Online (Sandbox Code Playgroud)
当我尝试使用 Thunar 重命名文件夹时,我收到一条错误消息,指出该文件已存在。同mv:
blender iso $ mv packages_old/ packages/
mv: accessing `packages/': Not a directory
Run Code Online (Sandbox Code Playgroud)
为什么我无法重命名我的文件和文件夹以具有相同的名称:
root
- packages/
- packages
Run Code Online (Sandbox Code Playgroud)
我发誓我以前做过这件事。
在 Bash 中,假设我访问一个目录,然后访问另一个目录。我想将文件从第一个目录复制到第二个目录,但没有指定它们的长路径名。是否可以?
我的临时解决方案是/tmp用作临时位置来存储文件的副本。cp myfile /tmp当我在第一个目录中时,然后cp /tmp/myfile .当我在第二个目录中时。但我可能会检查该文件是否会覆盖/tmp.
是否有类似于剪贴板的东西用于复制和粘贴文件?
我想密码保护或加密一个目录及其中的所有文件(对于它下面的整个目录树)。我不想打扰整个主目录,我想要一个包含一些文件和文件夹的特定目录。我希望能够加密目录或使用密码解密它。命令行最好用。我不想创建一个新文件作为加密版本,然后删除以前的非加密版本。
我打开了一个目录vim some/dir。我可以在树中导航,但是一旦我打开一个文件,我想知道如何关闭文件视图以返回到目录列表以导航到另一个文件。:wq没有选择,因为它会关闭整个 vim 会话。我想有一个 for 模式,但我不知道它叫什么,也不知道我如何启动它。
如何关闭文件到文件导航视图?
我想要rsync递归文件夹,但希望子文件夹仅包含到一定深度。
例如,我想要 1、2、3 或 4 个这样的子文件夹的深度:
source/
??? subfolder 1
? ??? subsubfolder
? ? ??? subsubsubfolder
? ? ? ??? wanted with depth 4.txt
? ? ??? wanted with depth 3.txt
? ??? wanted with depth 2.txt
??? subfolder 2
? ??? wanted with depth 2.txt
??? wanted with depth 1.txt
Run Code Online (Sandbox Code Playgroud) directory ×10
command-line ×5
filenames ×3
shell ×3
encryption ×2
files ×2
filesystems ×2
bash ×1
file-manager ×1
file-opening ×1
gui ×1
linux ×1
open-files ×1
password ×1
recursive ×1
rename ×1
rsync ×1
vim ×1
zip ×1