If you peer over a longtime UNIX user’s shoulder while he or she works, you might be mesmerized by the strange chant being murmured at the command line, isn’t it !. One thing is sure , the more you work with UNIX, the more likely you are to create scripts. A script saves the time and energy required to retype complex and long sequences of commands, preventing mistakes, too. I have also prepared a bunch of scripts to simplify my day to day job.
- Alerting when my filesystem usage surpasses a defined limit.
- Counting particular directories on a virtual server. It’s great for preventing diskusage problems.
- Checking the expiration date of the certs being used on the server.
- Monitoring my log files on the server , they can be troublesome , if they are not cleaned periodically.
- Extract any archive ( grepping the extension and running case statement a/q )
- Preventing my Mac to sleep while downloading chuck of data ( used caffeinate ).
- Force stop and clean Docker containers.
- Deleting screenshots from my desktop.
- Checking the file with 777 permission , they can be dangerous though.
- I use cron to schedule these tasks to run on a periodic basis and sends the results to me on the mail .
What’s your favourite script ;) I hope you like it!