61
linuxxx
102d

Biggest terminal hack I've discovered till now which is so fucking obvious I can't believe I literally just started using it:

Executing the date command right before and after another command/series of commands to see how long shit takes.

$ date; command or commands; date

This is incredibly useful when rendering loads of data in screen sessions!

I actually feel rather retarded for only thinking of this now.

Comments
  • 14
    Why not just use time?
  • 20
    @epse Could also do that but with the current datasets, it can take days and this way I can keep track of the dates as well!
  • 7
    Nice trick. Arigatou gosaimasu.
  • 6
    @linuxxx ah yes for stuff that takes that long I get it
  • 20
    You can set your PS1 to include date and time, or just time, or the $SECONDS variable to always have that info in your prompt. Very useful in tmux/screen sessions or otherwise long-running unattended commands
  • 1
    @epse

    Dont have one
  • 2
    @BabushkaC-130 you don't have the time command on your system?
  • 4
    @epse I think its saying it doesn't have the time for it as an attempted joke..
  • 5
    In windows:
    date /T & time /T & npm i -D webpack webpack-cli & date /T & time /T
  • 2
    I do that all the time on my code logging.
  • 4
    @Pogromist

    On Windows
    $~#%!324asdasd#$%aasdfdff#$!$@dasdffasdfa#12$~$%&#% date; command; $~#%!324asdasd#$%aasdfdff#$!$@dasdffasdfa#12$~$%&#% date;

    I find windows very disturbing visually, and very annoying to the nervous system.
  • 2
    Need to remember this for when I'm back in the office
  • 1
    @andpeterson
    Now say with me 1000 times: I WILL USE DATE BETWEEN COMMANDS..

    *When you go to office: start doing job like always and forget the shit about it
  • 1
    @Coffe2Code
    Your reply is still a good reminder though XD
  • 0
    @netikras how do you handle invocation time with PS1? The timestamp is always when the last command ended. Or just mash enter to get a fresh timestamp? :D
  • 1
    @ojrask hit ENTER before running your command?
  • 0
    Why dont you have your scripts just give the elapsed time when finished?
Add Comment