Using octal method,type the exact command you would use to make test.txt have the following permissions dr-xr-x---
Asked
Active
Viewed 89 times
-4
-
That trap question assumes that you cannot have a directory named `test.txt`. That assumption is false. – Oct 05 '18 at 22:52
-
Linking/relating: https://unix.stackexchange.com/questions/183994/understanding-unix-permissions-and-file-types – Jeff Schaller Oct 05 '18 at 22:58
-
A directory named test.txt is OK, but d for a file is not possible. read man chmod – 炸鱼薯条德里克 Oct 05 '18 at 23:55
2 Answers
0
If test.txt is a text-file, you cannot do this. If it happens be be a directory:
chmod 550 test.txt
Thomas Dickey
- 75,040
- 9
- 171
- 268
0
Normally I skip orders that are not questions; but in this case here is exactly what you ordered, using the octal method to type out to a TTY the exact command that I would use.
$ printf '\151\156\163\164\141\154\154\040\055\144\040\055\155\040\060\065\065\060\040\164\145\163\164\056\164\170\164\012'
The point where you understand this by yourself, with no further explanation, is the point where Unix shell scripting is becoming second nature. ☺
JdeBP
- 66,967
- 12
- 159
- 343