LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   meaning of recursive in chmod command (https://www.linuxquestions.org/questions/linux-newbie-8/meaning-of-recursive-in-chmod-command-4175586076/)

ankit.singhal85 08-02-2016 05:50 AM

meaning of recursive in chmod command
 
what it the difference in between
chmod 777 * and, chmod -R 777 *
what does the recursive -R means here?

HMW 08-02-2016 06:53 AM

Quote:

Originally Posted by ankit.singhal85 (Post 5584583)
what it the difference in between
chmod 777 * and, chmod -R 777 *
what does the recursive -R means here?

Umm... I know that man pages sometimes can be hard to understand, but in this case it's right there in plain English:
Code:

      -R, --recursive
              change files and directories recursively

Recursion means that is changes all the files and directories in the current directory and all directories/files below.

Best regards,
HMW

chrism01 08-03-2016 02:30 AM

https://en.wikipedia.org/wiki/Recursion#Recursive_humor :)

Habitual 08-03-2016 08:53 AM

Quote:

Originally Posted by ankit.singhal85 (Post 5584583)
chmod 777 * and, chmod -R 777 *

and it NEVER "fixed" anything. (apache permission denied errors,etc...)

It is my opinion that the question raises red flags.
Its use is immediately suspect.

Just my opinion.

dhrn 08-03-2016 09:01 AM

Chmod -R 777 directory/File

777-Giving Full permissions as READ , WRITE and EXECUTE to all users .
-R means recursive addition of permission to each file/directory which is mentioned .

JeremyBoden 08-03-2016 11:20 AM

A very dangerous command...:study:

MadeInGermany 08-04-2016 03:27 PM

Dangerous also because chmod dereferences symbolic links.
Instead of
Code:

chmod -R 777 *
use
Code:

find * \( -type f -o -type d \) -exec chmod ugo+rwx {} +
And to remove the world-write permissions
Code:

find * \( -type f -o -type d \) -exec chmod o-w {} +

Keith Hedger 08-04-2016 07:24 PM

Quote:

Originally Posted by chrism01 (Post 5585080)

Sorry can you give me that link again?,:)

JJJCR 08-04-2016 07:40 PM

Quote:

Originally Posted by ankit.singhal85 (Post 5584583)
what it the difference in between
chmod 777 * and, chmod -R 777 *
what does the recursive -R means here?

Quote:

Definition of recursion
1
: return 1
2
: the determination of a succession of elements (as numbers or functions) by operation on one or more preceding elements according to a rule or formula involving a finite number of steps
3
: a computer programming technique involving the use of a procedure, subroutine, function, or algorithm that calls itself one or more times until a specified condition is met at which time the rest of each repetition is processed from the last one called to the first — compare iteration
http://www.merriam-webster.com/dictionary/recursion

Go to Google play, check out this app. https://play.google.com/store/apps/d...obileKit&hl=en

chrism01 08-05-2016 02:22 AM

@Keith Hedger: I refer you to my previous ... ;)


All times are GMT -5. The time now is 02:33 PM.