bash 1

Linux bash shell allows you to define the TMOUT environment variable. Set TMOUT to automatically log users out after a period of inactivity. The value is defined in seconds. For example:

# set a 5 min timeout policy for bash shell
readonly TMOUT
export TMOUT

To disable auto-logout, just set the TMOUT to zero or unset it as follows:
$ export TMOUT=0

kill process in one line
kill -9 `ps -fea | grep processname | grep -v grep | awk ‘{print $2}’`

Deleting difficult filenames
ls -il
find . -inum 12345 | xargs rm

Argument list too long
ls | xargs rm

Find and Grep
Find all files with given name (you can use Bash expansion if you’d like), and Grep for a phrase:
find . -name -exec grep “phrase” {} \;
To display the filename that contained a match, use -print:
find . -name -exec grep “phrase” {} \; -print
Or, use Grep options to print the filename and line number for each match:
find . -name -exec grep -Hn “phrase” {} \;
The string `{}` is replaced by the current filename being processed everywhere it occurs in the arguments to the command. See the

How to Clear Memory Cache on Linux
sudo sh -c “sync; echo 3 > /proc/sys/vm/drop_caches”
– See more at: