Last active
December 12, 2021 21:37
-
-
Save cdncat/27dab61ca2ecc9b00afb901cbfa8d8eb to your computer and use it in GitHub Desktop.
migrating dot files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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