LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-23-2005, 03:45 AM   #1
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Script to change uid's


I have several distro's on my computer, in all but Fedora my user has uid 501 and gid 501.
Now I changed the gid & uid with usermod, but that command only changes under /home.dir.
I'm trying to fix this:
Code:
[root@killbill ~]# find /mnt/a3/tmp/ -gid 500 |chown peterh:peterh
Result: "too few arguments"
I tried various variants, although it should be pretty easy I can't get it to work.
Any ideas?
 
Old 03-23-2005, 03:51 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You don't need the pipe:

find /mnt/a3/tmp/ -gid 500 -exec chown <username> {} \;

This also makes sure that filenames with spaces (or other 'funny' characters) in them will be handled correctly.

Hope this helps.
 
Old 03-23-2005, 04:15 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
Ha! No pipe, that was the fix!
Thanks a lot, it worked fine!
 
  


Reply



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
archive file UID's after untarring nmolinos Linux - Software 2 04-13-2005 12:00 AM
Change batch script to shell script alan.belizario Programming 5 03-31-2005 12:41 AM
Change batch script to shell script alan.belizario Linux - Software 1 03-30-2005 01:49 AM
Winbind and Samba 3.0 -- duplicate UID's phil1076 Linux - General 4 12-16-2003 02:53 PM
UID's???? pk21 Linux - Security 3 08-23-2002 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:57 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
Open Source Consulting | Domain Registration