![]() I don't use Terminal a lot, but I find that I sometimes need to remember a command I ran in the past which is no longer in my history.Īlso, this is similar to something I do with texts I write. ![]() I then set Terminal.app to run at startup the following command: ~/Desktop/logger.shHere's the script: #!/bin/bash# logger.sh# Log everything you do in Terminal.#* Formatted date & time string.FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"`#* Archive the previous file/bin/cp -f ~/Desktop/Terminal.log#* Begin a new one/usr/bin/script ~/Desktop/Terminal.log[ kirkmc adds: This is a good idea. I like to keep my history so instead I wrote this small script that archives previous sessions by renaming the file with a date/time string. You could create a simple log of your session using the following: /usr/bin/script ~/Desktop/Terminal.logThis will log everything you do and append it to the log file. You can choose here to run a command at startup. ![]() It makes it much easier to undo your mistakes when you know what those mistakes were. I use Terminal everyday, and I find it a good idea to log everything I you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |