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
Advertisement
Answer
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.txtUsing absolute path –
chmod /directory1/file1.txt