Last active
December 6, 2018 13:50
-
-
Save kaiwan/252888cfee0ba13408767e592177fcc7 to your computer and use it in GitHub Desktop.
Useful CLI stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------- | |
To get timestamp in a useful format: | |
date +%a_%d_%m_%Y_%H%M | |
Eg. o/p: | |
$ date +%a_%d_%m_%Y_%H%M | |
Thu_06_12_2018_0737 | |
$ | |
-------------------------------------------- | |
Shell scripting: | |
To have a cleanup function run on (ab)normal exit: | |
trap clean_on_exit EXIT | |
trap "exit 1" INT TERM # makes the EXIT trap effective even when killed | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- | |
-------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment