Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove these dotfiles and revert the system #190

Closed
tabibzadeh opened this issue Mar 4, 2013 · 4 comments
Closed

How to remove these dotfiles and revert the system #190

tabibzadeh opened this issue Mar 4, 2013 · 4 comments

Comments

@tabibzadeh
Copy link

I wonder why there isn't even one discussion on how to remove these dotfiles completely.

I just want my whole system and setup to get back where it was!
Can you give me a hint?

Thanks.

@Tatsh
Copy link

Tatsh commented Mar 4, 2013

There's no straightforward way of doing that. One way is to reset your $HOME directory.

Boot into verbose mode, become root with sudo su (replace yourName with your user name). You may need to run bash once to get into Bash (default is sh).

# Make a backup
mv /Users/yourName /Users/yourNameBak
mkdir /Users/yourName

# Copy non-dot files over to new directory
find /Users/yourNameBak -maxdepth 1 ! -iname '.*' -exec cp -vfR {} /Users/yourName \;

# Delete property lists since these have app and OS X settings
find /Users/yourName/Library/Preferences -iname '*.plist' -exec rm -v {} \;

# Correct ownership (change group here if you don't want it to be _staff)
chown -R yourName:_staff /Users/yourName

# Permissions
find /Users/yourName -type f -exec chmod 0640 {} \;
find /Users/yourName -type d -exec chmod 0750 {} \;

# Copy SSH settings and set correct permissions
cp /Users/yourNameBak/.ssh /Users/yourName/.ssh
chmod 0700 /Users/yourName/.ssh
find /Users/yourName/.ssh -type f -exec chmod 0600 {} \;

Then reboot and log in and everything should be reset.

@patmoore
Copy link

use git to put the dot files under source control before make the changes!

@mathiasbynens
Copy link
Owner

@Tatsh is right. Also, for ~/.osx stuff, you could use defaults delete …. Next time you may want to use a backup/restore script like the one in #58.

Anyway, these are my dotfiles and you shouldn’t be blindly using them as-is. Instead, fork the repository, go through the files, and delete/change what you don’t need/want.

@saeed3e
Copy link

saeed3e commented Dec 16, 2018

@Tatsh @mathiasbynens this command is not working on my mac(high sierra, version:10.13.6)
find /Users/yourNameBak -maxdepth 1 ! -iname '.*' -exec cp -vfR {} /Users/yourName \;

getting error "not a directory"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants