Topic "Chmod only files or only directory"

Author Message
claudioerba

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
What error?
_________________
Martin Prikryl
Guest




prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
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?
_________________
Martin Prikryl
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
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.
_________________
Martin Prikryl
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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
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?
_________________
Martin Prikryl
www.satindersingh.com

Guest


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)
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License