im trying to change permissions on a txt file founded in directory X While im in the directory 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
. If your current path is /directory2/
, you can run chmod
for file1.txt in two ways:
Using relative path - chmod../directory1/file1.txt
Using absolute path - chmod /directory1/file1.txt
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.