How do you run a script on login in *nix?

From wikipedia Bash When Bash starts, it executes the commands in a variety of different scripts. When Bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads … Read more

Creating temporary files in bash

The mktemp(1) man page explains it fairly well: Traditionally, many shell scripts take the name of the program with the pid as a suffix and use that as a temporary file name. This kind of naming scheme is predictable and the race condition it creates is easy for an attacker to win. A safer, though … Read more

How to create a link to a directory on linux [closed]

Symbolic or soft link (files or directories, more flexible and self documenting) # Source Link ln -s /home/jake/doc/test/2000/something /home/jake/xxx Hard link (files only, less flexible and not self documenting) # Source Link ln /home/jake/doc/test/2000/something /home/jake/xxx More information: man ln /home/jake/xxx is like a new directory. To avoid “is not a directory: No such file or … Read more