Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I copied a whole directory from a vfat partition, and there are many files and directories in it. I want to change all the directories to 755, all the files to 644, how can I do it easily? chmod?
edit: opps looks like it took me 20 minutes to reply from when i clicked the reply button,
why are you guys giving such a convoluted example when it can just be done like i showed?
if the files are still residing on the vfat partition, then, in short you cant, vfat does not support file permissions like ext3 and the like do. you can remount the file system with different premission, but i dont think that is what you are asking for.
if you did indeed copy the vfat partition onto a linux partition then just go like so:
Code:
chmod 644 /path/to/your/files -R
(i think the -R (recursive) tag might be the trick you were looking for)
Last edited by poiuytrewq; 04-11-2005 at 08:26 PM.
Originally posted by poiuytrewq
edit: opps looks like it took me 20 minutes to reply from when i clicked the reply button,
why are you guys giving such a convoluted example when it can just be done like i showed?
Code:
chmod 644 /path/to/your/files -R
Because your non-convoluted example won't allow him
to change into directories afterwards?
Originally posted by shadkong Thank you Tinkster! It works now!
Can you tell me the meaning of this commend? I really have the interest to know it.
In brief ... :)
find is a very flexible tool to allow you locating
files by varied criteria and do a variety of things in
response ...
The default is to print the name of whatever matches
the criteria.
What we've done here is:
1.)
Search the directory under /path/to/your/files for anything
that is an ordinary file (type f), and change the permissions
to 664 (-exec chmod 644 {} \;)
-exec tells find to run a command against each found file.
It consists of three parts, that's the -exec, the {} and the \;
-exec is the start of the phrase (followed by the actual command),
{} is the placeholder for the files name, and \; terminates the
exec phrase ... you could, for instance, put other parameters
to your command behind the file-name ...
(e.g. -exec cp {} /tmp/results/. \; )
2.)
does the same thing, only for directories (type d)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.