LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-13-2006, 09:56 PM   #1
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Rep: Reputation: 15
Unhappy chmod -R username / ? (Doh!)


I just accidentally typed "chmod -R username /" into a shell prompt. (i meant to type "chmod -R username .") I hit CTRL+C pretty quickly...

i realize that the filesystem is enormous and complex, and that the permissions can cause problems... what do i do now? is there a log of which files were affected?

thanks in advance,
dbc
 
Old 07-13-2006, 10:06 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
Do you mean chown? chmod with a username AFAIK doesn't do anything.

Regards,

Alunduil
 
Old 07-13-2006, 10:13 PM   #3
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 15
sorry, it was indeed chown. i was typing rather frantically there hoping that i havent screwed anything up...

it was "# chown -R meta4 /" (copied that from the term window)

dbc
 
Old 07-13-2006, 10:43 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
The following will tell you which files were affected, ignoring the files under /home (there may be other locations where files can be legitimately owned by meta4, such as /proc or /var). You should run this as root (or using sudo) so that you can check the entire file system:
Code:
find / -user meta4 | grep -v '/home'

Last edited by gilead; 07-13-2006 at 10:44 PM.
 
Old 07-13-2006, 10:44 PM   #5
bushidozen
Member
 
Registered: Oct 2004
Posts: 215

Rep: Reputation: 30
You can try:
Code:
find / -group meta4 > myfiles.txt
This will find all files owned by meta4 and store them in myfiles.txt. Then you can just look through the file to see if any files should not belong to that group.
 
Old 07-13-2006, 11:43 PM   #6
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
Once you have your list satisfactory you can run this script to change them back:

Code:
for file in $(cat myfiles.txt); do chown user:group ${file}; done
I'm assuming they will have absolute paths in the output file. If they don't then it will be a bit more challenging.

Regards,

Alunduil
 
Old 07-13-2006, 11:53 PM   #7
bushidozen
Member
 
Registered: Oct 2004
Posts: 215

Rep: Reputation: 30
Yeah, the file will have absolute paths.
 
  


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
debootstap (returned a value of 1) DOH!! boyd98 Debian 5 05-15-2005 02:38 PM
slmodem (smartlink) doh!! equinox Mandriva 1 10-19-2004 07:41 PM
Doh! Accidently killed su jeffChuck Linux - Newbie 1 07-29-2004 02:53 PM
DOH!! stupid question yasq Linux - Newbie 4 02-23-2004 12:58 AM
DOH! no lilo and no mbr! chad Linux - General 2 08-29-2002 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:39 AM.

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
Open Source Consulting | Domain Registration