Chmod only files or only directory

Advertisement

claudioerba
Guest

Chmod only files or only directory

Hello to all, i'm tryng to chmod only files or only directory, i run the followoing commands:

chmod 777 -d "!"

chmod 777 -f "!"

and i need it recursively,. the system disply me errors, what is the right instruction?
Regards
Claudio

Reply with quote

Advertisement

Guest

Re: Chmod only files or only directory

martin wrote:

What error?

Hello Martin,
System say

Command 'chmod 777 -d "doceboCore/addons/calendar/README"'
failed with return code 1 and error message
chmod: invalid option -- d
Try `chmod --help' for more information..

seems that -d and -f options are not supported, does exist an alternative way for chmod recursively only files and only directories?

Regards
Claudio

Reply with quote

martin
Site Admin
martin avatar

Re: Chmod only files or only directory

First of all, this is not about WinSCP. It is a remote server (or rather shell) that evaluates your commands. Moreover I never header about -d option for chmod. What it should do?

Reply with quote

claudioerba
Guest

-d means "do operation only to directory" -f "do operation only to files", but seems that the information that i found on some webpage (that i can't retrieve) is not correct.

Any idea to perform the same operation in another way?
Claudio

Reply with quote

Advertisement

martin
Site Admin
martin avatar

claudioerba wrote:

Any idea to perform the same operation in another way?
Still I'm really not sure what you want to do. Please try to explain it in words, not in commands.

Reply with quote

Rene
Guest

Think she wanted to do what's my problem now.

I automaticaly upload files from a Windows-folder to a Unix-folder because the files are updated in Windows and than ditributed with an Unix-HTTP-Server.
And sometimes i backup those files and burn them on CD.
Now i want to restore the Data and restore them to the Unix machine which could be problematic cause data on CD is read-only.
This means i must set all folders to 755 and oll files to 644.
And to be sure, i want to include this command in my upload-files-script.

Any idea how to do this?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,430
Location:
Prague, Czechia

Rene wrote:

I automaticaly upload files from a Windows-folder to a Unix-folder because the files are updated in Windows and than ditributed with an Unix-HTTP-Server.
And sometimes i backup those files and burn them on CD.
Now i want to restore the Data and restore them to the Unix machine which could be problematic cause data on CD is read-only.
This means i must set all folders to 755 and oll files to 644.
And to be sure, i want to include this command in my upload-files-script.

Any idea how to do this?
Wouldn't it help if you disable Preserve read-only option?

Reply with quote

www.satindersingh.com
Guest

Here is the solution

find . -type d -perm 777 -exec chmod 755 {} \; (for changing the directory permission)

find . -type f -perm 777 -exec chmod 644 {} \; (for changing the file permission)

Reply with quote

Advertisement

You can post new topics in this forum