Solved

To add file permission to only files recursively?

Posted on 2013-01-24
2
235 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Weird Samba Connectivity Issue... 7 40
How to find Linux Server's last patch date 9 49
installing docker on ubuntu 6 29
awk file 6 52
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

770 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