LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-02-2016, 06:50 AM   #1
ankit.singhal85
LQ Newbie
 
Registered: Aug 2016
Posts: 1

Rep: Reputation: Disabled
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?
 
Old 08-02-2016, 07:53 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Xubuntu, Manjaro
Posts: 748
Blog Entries: 3

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Quote:
Originally Posted by ankit.singhal85 View Post
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
 
Old 08-03-2016, 03:30 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
https://en.wikipedia.org/wiki/Recursion#Recursive_humor
 
Old 08-03-2016, 09:53 AM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,663
Blog Entries: 10

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
Originally Posted by ankit.singhal85 View Post
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.
 
2 members found this post helpful.
Old 08-03-2016, 10:01 AM   #5
dhrn
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Rep: Reputation: Disabled
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 .
 
Old 08-03-2016, 12:20 PM   #6
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,022

Rep: Reputation: 203Reputation: 203Reputation: 203
A very dangerous command...
 
Old 08-04-2016, 04:27 PM   #7
MadeInGermany
Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 255

Rep: Reputation: 101Reputation: 101
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 {} +
 
Old 08-04-2016, 08:24 PM   #8
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,307

Rep: Reputation: 566Reputation: 566Reputation: 566Reputation: 566Reputation: 566Reputation: 566
Quote:
Originally Posted by chrism01 View Post
Sorry can you give me that link again?,
 
Old 08-04-2016, 08:40 PM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,120

Rep: Reputation: 190Reputation: 190
Post

Quote:
Originally Posted by ankit.singhal85 View Post
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

Last edited by JJJCR; 08-04-2016 at 08:42 PM. Reason: ediy
 
Old 08-05-2016, 03:22 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
@Keith Hedger: I refer you to my previous ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Recursive chmod not working as it should scriptkiddy Linux - Newbie 9 03-10-2016 03:27 AM
chmod recursive on files on dlublink Linux - Newbie 6 03-02-2005 09:45 AM
recursive yet selective chmod bluefire Linux - General 6 10-22-2004 07:25 PM
chmod.....recursive help stateq2 Linux - General 3 03-28-2004 08:28 PM
Messed up recursive with chmod Cyth Linux - General 4 01-03-2003 01:16 PM


All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration