chmod problem
I have to change the file permissions for a large amount of files (17 or so).
I can create a new directory and then move the files to this directory and then change all the files permissions within it. But I was trying something else: Code:
ls -m Then I run nano in the terminal. Search and replace (CTRL-\). I removed the commas by empty space. Then I tried to copy and paste the result after the command Code:
sudo chmod 664 I hope I have been clear enough. |
Why use the -m option and not the -C option?
Code:
sudo chmod 664 $(ls -C) |
Or you can use the -R option, for recursive, if you moved all of them in one place:
chmod 664 -R /path/to/directory man chmod: ... -R, --recursive change files and directories recursively (this will modify the permissions for all files and sub-directories in the path) ... This does the same thing: find /path/to/directory -type f -exec chmod 644 {} \; (this will modify the permissions for all files and sub-directories in the path) if you have your files in /home/user/test ... but have another directory there test2 and files inside, it will modify the permissions there as well. |
Yes, I do know about the possibility of moving all of the files in one place and then do the -R method.
But I don't want to make a submap. I don't want to move the files. I just wanted to change the file permissions of SOME of the files in a map. And ls -C doesn't allow you to select the files that you want. But I guess that I am doing difficult and that I just have to create a map and move the files that I want to change over there. Thank you for answering my question. |
Quote:
Code:
$ ls -l |
In one word: brilliant.
|
All times are GMT -5. The time now is 01:42 AM. |