Solved

To add file permission to only files recursively?

Posted on 2013-01-24
2
214 Views
Last Modified: 2013-01-27
Hello,

I need to add certain permissions to all files in a directory and all its sub directories, but only to the files and NOT the directories (directories should be excluded).


Thank you in advance
0
Comment
Question by:starhu
2 Comments
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 38813825
find /start/dir -type f |xargs echo chmod [certain permissions]

Please replace [certain permissions] with your desired additional permissions, e.g. add write permissions for group with: "g+w".

echo is for a dry run. Remove it to apply the actual changes.
0
 
LVL 3

Accepted Solution

by:
dextermain earned 250 total points
ID: 38817900
find /dir -type f -exec chmod [pemissions] {} \;

This is the command straight up, the above command will work too and is a safety precaution to do an echo for a dry run.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now