I have set of temp files created in my folder with .bak extensions. How can I make them hide by default in Ubuntu?
I tried adding a .hidden file with *.bak as entry in the file, but that is not working. Any help is very appreciated...
I have set of temp files created in my folder with .bak extensions. How can I make them hide by default in Ubuntu?
I tried adding a .hidden file with *.bak as entry in the file, but that is not working. Any help is very appreciated...
The .hidden file does not support wildcards; you have to put the actual filenames there, which of course will vary per project. To make this process more convenient, I came up with a Bash alias that can be used to dynamically create the .hidden file with the names of the LaTeX intermediate files present in the current folder:
alias hidetex='ls *?(aux|bbl|blg|brf|lof|log|lot|out|toc) -1 > .hidden'
I added this line to the ~/.bash_aliases file, so now I can just cd to the folder with files I want to hide, and type hidetex.
This is intended to be executed at specific folders, but you could make it more generic (e.g. for .bak files) and change it to perform the task recursively, adding a .hidden file to each subfolder of a given root folder, but that's a little more complicated.
You could create a file called .hidden in your home directory. In this file you can put the names of all the files that you would like to be hidden, one per line.
If you place a full stop (or period) at the beginning of the name of the file it should hide it, for example:
.helloworld.txt
To view your now hidden file, click "view" on Nautilus then check "Show Hidden Files".
If you and the program don't care about the name of the file, try this command:
for annoyingbak in *.bak; do mv "$annoyingbak" ."$annoyingbak"; done
Then run it whenever you're annoyed by the .baks. It moves every file named bla.bak to .bla.bak.
If you have to do it very often, add this to the end of your .bashrc:
function deannoy {
for annoyingbak in *.bak; do
mv "$annoyingbak" ."$annoyingbak"
done
}
Then you can just type deannoy in your Dropbox folder and they're gone.