This script is for switching the visibility of a directory by renaming it.
E.g. toggle my_folder
will rename my_folder
to .my_folder
and back with another call.
Put the script file in /usr/bin
and give it execution rights.
sudo cp toggle /usr/bin/toggle
sudo chmod a+rx /usr/bin/toggle
Now you can toggle directories via toggle DIRNAME
.