0

I was following the Dotfiles exercises in the CLE MIT Missing Semester course and I messed up. I created a dotfiles directory and moved all the dotfiles in my home folder to that directory, then I ran the following code from dotfiles:

for filename in dotfiles
do 
ln -s $filename dotfiles/$filename
end

Basically, I symlinked everything in the wrong direction. Now all those dotfiles in my home directory are useless, and all the dotfiles in the dotfiles directory are pointless because they don't actually point to anything. Is there any solution to this problem that doesn't involve deleting all my dotfiles and reinstalling everything? I'm using macOS Monterey.

I tried using the unlink command but that just deletes the files. I'm looking for a solution where I can keep all my dotfiles and just remove the symlinks.

nba
  • 3
  • 3
  • The posted code will just create a single symlink `dotfiles/dotfiles` that points at itself. So just remove that (one) symlink, and do whatever it was you intended to do. – Chris Dodd Jan 10 '23 at 11:05
  • @ChrisDodd I should have made it clear that “dotfiles” in the posted code is just pseudo code for a list of all the dotfiles generated with a command like “find . -name “\..*””, not literally the word dotfiles. – nba Jan 10 '23 at 19:29

0 Answers0