[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Printing the date just before execution of commands in bash



Roberto C. Sanchez wrote:
If it is always the same commands, then consider setting them to use the
time command as an alias.

For example, if you always want to know how long a dd took, then use
something like `alias dd='/usr/bin/time /usr/bin/dd'`.

Of course, you will need to use dd and not /usr/bin/dd to get the
benefit.  Additionally, if you set your alias like this: `alias
dd='/usr/bin/time dd'`, then it will recurse and bad things will happen.
Trust me on this :-)

I once did `alias mutt='LANG= mutt'` and when I executed it, I had to
reboot the machine to get it to quit.
Wow.  Good to know!
Regards,

-Roberto


Actually I run a few video conversion scripts from time to time and if I time the conversions regularly, I can have an idea as to how long future conversions will take (so I can know how long I can leave the computer and do other stuff). That alias suggestion is excellent so I'll probably employ something like that for the scripts I run. Really appreciate it.

--
Sincerely
Jose Alburquerque



Reply to: