我正在运行 Ubuntu 10.04 服务器,并且对用户/组有一些非常反直觉的体验。例如:
sudo touch test_file # create empty file
sudo groupadd test # create 'test' group
sudo chown root:test test_file # change group of file to 'test'
sudo chmod g+rwx test_file # give write permissions to group
sudo usermod -a -G test {my-user} # add my user to 'test' group
touch test_file # touch the file as my current user
Run Code Online (Sandbox Code Playgroud)
最后一行产生权限错误。
我已经确保我的用户是“测试”组的一部分(groups {my-user}证实了这一点)。test_file 的组也肯定设置为'test',并且设置了组权限。
为什么我的用户不能写入文件测试文件?
有时我会做一个命令,比如
unzip tons_of_files.zip
Run Code Online (Sandbox Code Playgroud)
我会忘记把 -d 指向一个子目录。这会导致当前文件夹充满大量与现有文件混合的文件。
删除所有这些新文件和/或将它们移动到新目录的最佳方法是什么?我想避免手动检查目录并确定文件是存档的一部分还是已经存在。
我正在使用 Ubuntu,并正在寻找一个好的编辑器来编辑 > 4GB 的文件。我只需要将内容放在文件的末尾和开头。我想我可以用类似的东西
cat "text to add" >> huge_file
Run Code Online (Sandbox Code Playgroud)
附加到文件。那是该走的路吗?前置呢?一般来说,如果我想在中间的某个地方进行编辑,最好的路线是什么?
我尝试过 VIM,但失败得很惨。我认为 emacs 和 nano 会更糟。那里还有什么?我假设要实现我正在寻找的目标,编辑器必须为此专门设计,而不是将文件的全部内容保留在内存中。
linux ×3
bash ×1
permissions ×1
security ×1
shell ×1
text-editing ×1
text-editors ×1
ubuntu ×1
zip ×1