sudo chown -R $USER ~$USER
Comes up with:
Folder does not exist
but typing in:
sudo chown -R $USER ~/Users/administrator
Administrators-iMac-49:~ administrator$ id -u $USER
501
Administrators-iMac-49:~ administrator$ ls -Al
total 64
-rw------- 1 administrator staff 3 5 Jul 2012 .CFUserTextEncoding
-rw-r--r--@ 1 administrator staff 12292 10 Jul 2012 .DS_Store
drwxr-xr-x 4 administrator staff 136 6 Jul 2012 .adobe
-rw------- 1 administrator staff 3357 12 Jul 2012 .bash_history
-rwxrwxrwx@ 1 administrator staff 30 6 Jul 2012 .fgufohsrc
-rw-r--r--@ 1 administrator staff 17 6 Jul 2012 .sewtzsfn
drwxr-xr-x 2 administrator staff 68 6 Jul 2012 Applications
drwx------+ 5 administrator staff 170 15 Oct 15:40 Desktop
drwx------+ 7 administrator staff 238 9 Jul 2012 Documents
drwx------+ 6 administrator staff 204 10 Jul 2012 Downloads
drwx------+ 39 administrator staff 1326 9 Jul 2012 Library
drwx------+ 3 administrator staff 102 5 Jul 2012 Movies
drwx------+ 4 administrator staff 136 9 Jul 2012 Music
drwx------+ 5 administrator staff 170 6 Jul 2012 Pictures
drwxr-xr-x+ 5 administrator staff 170 5 Jul 2012 Public
lrwxr-xr-x 1 administrator staff 63 12 Jul 2012 Send Registration -> /Users/administrator/Library/Assistants/Send Registration.setup
Administrators-iMac-49:~ administrator$ sudo chown -R $USER ~
Password:
Administrators-iMac-49:~ administrator$ ls -Al
total 64
-rw------- 1 administrator staff 3 5 Jul 2012 .CFUserTextEncoding
-rw-r--r--@ 1 administrator staff 12292 10 Jul 2012 .DS_Store
drwxr-xr-x 4 administrator staff 136 6 Jul 2012 .adobe
-rw------- 1 administrator staff 3357 12 Jul 2012 .bash_history
-rwxrwxrwx@ 1 administrator staff 30 6 Jul 2012 .fgufohsrc
-rw-r--r--@ 1 administrator staff 17 6 Jul 2012 .sewtzsfn
drwxr-xr-x 2 administrator staff 68 6 Jul 2012 Applications
drwx------+ 5 administrator staff 170 15 Oct 15:40 Desktop
drwx------+ 7 administrator staff 238 9 Jul 2012 Documents
drwx------+ 6 administrator staff 204 10 Jul 2012 Downloads
drwx------@ 39 administrator staff 1326 9 Jul 2012 Library
drwx------+ 3 administrator staff 102 5 Jul 2012 Movies
drwx------+ 4 administrator staff 136 9 Jul 2012 Music
drwx------+ 5 administrator staff 170 6 Jul 2012 Pictures
drwxr-xr-x+ 5 administrator staff 170 5 Jul 2012 Public
lrwxr-xr-x 1 administrator staff 63 12 Jul 2012 Send Registration -> /Users/administrator/Library/Assistants/Send Registration.setup
fixes the problem. Logging out and back in again randomly recreates the problem. It's as though there are two administrators with different UID's and it's random which one it logs in with. There is the possibility that there is a networked account. Next I shall switch off networked accounts and log in.
Just used the ls command which lists the UID instead of username:
ls -n
total 8
drwxr-xr-x 2 1414341556 20 68 6 Jul 2012 Applications
drwx------+ 5 1414341556 20 170 15 Oct 15:40 Desktop
drwx------+ 7 1414341556 20 238 9 Jul 2012 Documents
drwx------+ 6 1414341556 20 204 10 Jul 2012 Downloads
drwx------+ 39 1414341556 20 1326 9 Jul 2012 Library
drwx------+ 3 1414341556 20 102 5 Jul 2012 Movies
drwx------+ 4 1414341556 20 136 9 Jul 2012 Music
drwx------+ 5 1414341556 20 170 6 Jul 2012 Pictures
drwxr-xr-x+ 5 1414341556 20 170 5 Jul 2012 Public
lrwxr-xr-x 1 1414341556 20 63 12 Jul 2012 Send Registration -> /Users/administrator/Library/Assistants/Send Registration.setup
Administrators-iMac-75:~ administrator$
Sorted, it simply thinks that there is an administrator account with UID 1414341556
Administrators-iMac-75:~ administrator$ id -u $USER
501
Administrators-iMac-75:~ administrator$
I have now run the command:
chown -R 501 /Users/administrator
I have yet to find a re-occurrence.
------------------- march 2014
well, I found a re-occurrence. I ended up renaming the administrator account to:
administratorb
Cheers