Tag Archives: Bash

bash Group Specific PATH for RHEL 7.x

Users on a RHEL 7.x / CentOS 7.x system may desire to have all members of a specific group receive an altered $PATH environment variable to run 3rd party programs without modifying the user-specific PATH settings. This can be accomplished … Continue reading

Posted in Linux | Tagged , , | Leave a comment

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

Clear Current Command in Bash

If you’re on the Bash command-line and you want to clear the current command, try the following: CTRL+U to clear to the left up-to the cursor, and CTRL+K to klear to the right after the cursor (misspelling intended). More of … 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