[英]how do i access files in directory from another directory (linux)
im trying to change permissions on a txt file founded in directory X While im in the directory Y我试图更改在目录 X 中创建的 txt 文件的权限,而我在目录 Y 中
kosay_sabbah@DESKTOP-87R0T4M:~/Kosay/grp2$ chmod 777 3.txt
chmod: cannot access '3.txt': No such file or directory
You should use absolute or relative file path.您应该使用绝对或相对文件路径。 For example you have file1.txt
in directory /directory1/
- absolute file path is /directory1/file1.txt
.例如,您在目录/directory1/
中有file1.txt
- 绝对文件路径是/directory1/file1.txt
。 If your current path is /directory2/
, you can run chmod
for file1.txt in two ways:如果您当前的路径是/directory2/
,您可以通过两种方式为 file1.txt 运行chmod
:
Using relative path - chmod../directory1/file1.txt
使用相对路径 - chmod../directory1/file1.txt
Using absolute path - chmod /directory1/file1.txt
使用绝对路径 - chmod /directory1/file1.txt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.