Bash script auto-complete filename by file type/extension

Posted by & filed under Linux.

Suppose I wrote a bash script with usage script.sh filename.type. That is, the script takes in filenames as arguments. Bash’s tab completion works with all files. However, I’ve seen commands that will complete the filename even faster because it will select the file with the “right” extension. For example, pdflatex firstpart[Tab] would automatically select firtpart.whatever.is.next.tex…. Read more »

DirB, Directory Bookmarks for Bash

Posted by & filed under Linux.

I found out about DirB through this Linux Journal article. Pretty useful and user-friendly. Don’t know if I’ll remember to use it since I use Dired in Emacs for bookmarking directories. I just need to remember these commands: s — save a directory bookmark. g — go to a bookmark or named directory. p —… Read more »

Monitor disk usage and send email when disk is nearly full

Posted by & filed under Linux.

This site and this site describe some scripts to monitor disk usage of a computer based on the df command and email the ADMIN when disk usage reaches a certain percentage. The scripts can be ran periodically based on cron. These scripts did not work on my local NAS because I have one filesystem called… Read more »