|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Emergency UNIX and Linux Support !! Help Me!! Post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Accidentally Changed File Ownership to Include a "Comment" [AIX]
Hi. I've had a little mishap. To cut a long story short, I've accidentally recursively ran chown on a directory (actually a bunch of 'em). Not a problem in itself, but I had a slight error in the code I used to get the list of directories and ended up with a comment in the file ownership. For example, I now have directories full of stuff like: Code:
$ ll php total 40 drwxr-xr-x 4 # Scott - staff 136 3 Oct 12:37 . drwxr-xr-x 14 root system 476 5 Oct 16:24 .. -rw------- 1 # Scott - staff 12288 3 Oct 12:39 .swp -rwxr--r-- 1 # Scott - staff 4817 3 Oct 10:14 test.php And I can't seem to find a way to change it back. Any help would be appreciated! Thanks. Last edited by Scott; 10-05-2012 at 10:41 AM.. Reason: update |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Was the # part of your command line?
Where are you the tree in on what you show us just above? ( root of any filesystem?) |
| Sponsored Links | ||
|
|
#4
|
||||
|
||||
|
Hi scott, do you remember whaat you typed? (hehe so I can corrupt my machine also...)
I cant recreate the situation so difficult to give any suggestion for now... |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
OK, the longer version ![]() A while ago I was asked to remove some users from a production system. Rather than removing them I commented them out in /etc/passwd i.e. Code:
# Scott - removed 16.09.12 - userX:*:12345:45678..... I also removed a symbolic link in /home to the actual home directory, and renamed the actual home directory to something else (i.e. /app/some/dir/prod/userX_DELETEME). This was handy because a few days later I was asked to put some of the users back! It's quite a few users so I thought I would write a script to do it recreate the link and rename the directories. I've generated code to grab the username from the /etc/password but somehow got "# Scott" instead, and for reasons unbeknown seem to have run chown -R on the directory using "# Scott" as the owner, instead of the username. I'm not quite sure why I ran chown but I have, and now I have a whole bunch of home directories which, when listed, show the owner as "#Scott -". ls -ln . |
| Sponsored Links | |
|
|
#7
|
||||
|
||||
|
Yes.
OMG. I have never seen this before. When I added the users back, I copied them and removed the comment. I just removed the commented line for one of them and it looks OK. How could I never have seen this before? ![]() ROFL. That was a waste of 20,000 bits! Thanks ![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk command to replace ";" with "|" and ""|" at diferent places in line of file | shis100 | Shell Programming and Scripting | 7 | 03-16-2011 08:59 AM |
| Mapping between "Pseudo name" and "Logical device ID" in powerpath with SVM changed.... | Reboot | Emergency UNIX and Linux Support !! Help Me!! | 1 | 11-17-2010 05:09 AM |
| Compare file names and select correct elements to include in "for each loop" | cgkmal | Shell Programming and Scripting | 2 | 11-04-2010 04:38 PM |
| perl file, one line code include "length, rindex, substr", slow | jimmy_y | Shell Programming and Scripting | 3 | 06-09-2010 09:44 AM |
|
|