Time related commands


cal # calendar generating utility.

  • cal # calendar for current month

  • cal 1994 | less # calendar for whole year of 1994, Output longer than one screen so less allows user to view all

  • cal 5 1890

  • cal may 1890 # calendar for May 1890

    Other options allow for:

  • Julian or Gregorian calendar
  • Include the previous and following month or months around target month.
  • Set 1st day of the week to be Monday.


    time # runs a command and its options and reports time it took.

    Default output :

    Output sent to standard error. Use the -o options or 2> redirection to capture time's output separately.

    bash has built-in version that takes no options.
    Run whereis time to find path to external command.
    To run the standard time command, use the full path.

  • /usr/bin/time -v -o timed ps -ef # sends time information to file timed. Output of ps -ef will appear on terminal.

    # Contents of timed file
    
      Command being timed: "ps -ef"
      User time (seconds): 0.00
      System time (seconds): 0.00
      Percent of CPU this job got: 85%
      Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.01
      Average shared text size (kbytes): 0
      Average unshared data size (kbytes): 0
      Average stack size (kbytes): 0
      Average total size (kbytes): 0
      Maximum resident set size (kbytes): 2556
      Average resident set size (kbytes): 0
      Major (requiring I/O) page faults: 0
      Minor (reclaiming a frame) page faults: 152
      Voluntary context switches: 1
      Involuntary context switches: 240
      Swaps: 0
      File system inputs: 0
      File system outputs: 0
      Socket messages sent: 0
      Socket messages received: 0
      Signals delivered: 0
      Page size (bytes): 4096
      Exit status: 0
    


    date - display the date. Some options :