Skip to content

Instantly share code, notes, and snippets.

@cdncat
Last active December 12, 2021 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdncat/27dab61ca2ecc9b00afb901cbfa8d8eb to your computer and use it in GitHub Desktop.
Save cdncat/27dab61ca2ecc9b00afb901cbfa8d8eb to your computer and use it in GitHub Desktop.
migrating dot files
# in root directory
cd ~
# list all files starting with `.`
ls -d \.*
for FILE in \.*;
do
if [ $FILE != "." ] && [ $FILE != ".." ]; then
echo "moving file/directory: $FILE"
read -p "Do you want to copy this file? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
cp -R $FILE /Migration-folder
fi
else
echo "not moving $FILE"
fi
echo "================================="
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment