I want to hide some files because they just add clutter to my home folder. I have a folder in there that is called "bin" and is for running startup scripts. I want to have this folder and I'm not sure if adding a . before it will make the scripts not start.
4 Answers
If you add a .
, you are changing the name of your ~/bin
so it will no longer be in the path. Scripts may or may not work depending on how you call them, and since it isn't in your path anymore, you cannot just type scriptname.sh
and expect it to work. You can do it if you change your path to include /home/myusername/.bin
Add (or edit) this to ~/.bashrc
if [ -d $HOME/.bin ]; then
PATH=$PATH:$HOME/.bin
fi
As a convention, filenames beginning with a dot are hidden in many, but not all, contexts. This is done exactly for the same purpose you want - to hide away clutter that isn't intended to be normally viewed or edited by users.
However, adding a dot to the start of a filename (or directory) changes the filename. It's not like Windows where the filesystem has a built-in "hidden" flag; on Linux adding the dot is actually modifying the filename. Any existing links you had to that filename, or directory, will be broken. If you refer to the directory in a configuration script somewhere, that script will need to be modified. If an application is hard-coded to refer to that directory, it won't find it. If the directory is in your PATH, the new directory won't be unless you add it in again.
create a text files, write bin inside it, and name it .hidden
your bin file path wont change but it is hidden in file manager