How to hide files and folders in Ubuntu without the dot
Written by a romantic on September 30, 2018
The easiest way to hide (i.e. make “invisible”) files and folders in Linux-based systems is to just add a dot (‘.’) in front of their names. For example to hide the file my_file.txt
:
mv my_file.txt .my_file.txt
See more info about this approach on StackOverflow. However, in certain occasions it may be preferable not to rename the file or folder, for example not to change any prexisting path. In this cases, a file can be hidden from Nautilus (Ubuntu’s default file explorer) by adding its name to ~/.hidden
. For example:
echo my_file.txt >> ~/.hidden
Make sure to use >>
and not >
otherwise you’ll over-write the content of ~/.hidden
.