In the ab initio molecular orbital software "Gamess" etc., mysterious temporary files such as "~ .dat" and "~ .F05" are generated in any folder and will not disappear even if the calculation in Gamess is completed. (Of course, it does not disappear even if the error ends.) So, I adopted the "alias" command as a command that can delete all of them at once.
Simply put, the alias command allows you to register your favorite commands and operations in the terminal using your favorite character string, and execute those commands from any directory.
Let's set it.
Suppose a temporary Gamess file is generated in the following location: Let's use "Qiita" as the user name
/home/Qiita/gamess/tmp
I want to unconditionally delete the files generated in this folder when I type a certain command. Here, if you type the character string "delete" in the terminal, set to delete all the files in the above folder.
alias
alias delete='rm -rf /home/Qiita/gamess/tmp/*'
#alias (1) = '(2)'
(1) ・ ・ ・ Character string to be registered (2) ・ ・ ・ Command to be executed when (1) is input In the above example, the rm command is associated with the character string delete, but of course you can use another command. I thought that this alias could be used for operations where commands are not continuous.
Also, the above alias command will be unregistered when you log out, so I think it's a good idea to register it in ~ / .bashrc.
Thank you for reading.
Recommended Posts