Tag Archives: Shell

Clear Bash Command History File

For security reasons, you may want to clear out your bash command-line history file periodically. Use the following commands to delete / truncate your bash command history record. The following articles were used for inspiration and reference: Learn Bash: Remove … Continue reading

Posted in Linux | Tagged , , | Leave a comment

Delete Old Log Files with Linux Shell

One of the most needed system administration tasks can be surprisingly difficult to do well. Old log files should be deleted or cleaned up to keep the number of files and disk space used manageable. Here is an example using … Continue reading

Posted in Linux, System Administration | Tagged , , , , | Leave a comment

Linux Shell Date Format for Log File Names

Linux shell users need a quick way to include the date and time in log file names. Ideally the format should not include any space or colon characters. A format that I like to use is YYYY-MM-DD_HHMMSS and if the … Continue reading

Posted in Linux | Tagged , , , , , , , | Leave a comment

Bash Shell Output Redirection

The Bash shell is one of the best parts of the user environment on a Linux system. An essential shell function is the ability to run a command and redirect the output to a file. Programmers will be familiar with … Continue reading

Posted in Linux | Tagged , , , , | Leave a comment