Tag: shell

  • touch to update a file timestamp

    Touch is mainly known for creating files. Touch main purpose is actually to update the file’s timestamp. From the man:

    The touch utility sets the modification and access times of files. If any file does not exist, it is created with default permissions.

  • Reuse last argument from previous command

    If you need to reuse the reuse the last argument from the previous command this is for you:

    touch config.js
    vi !$
    
    Last command is equivalent to
    vi config.js
    
    Bonus: echo $? will display the exit code of therevious command !! will re-execute the previous command, sudo !!

  • Calendar in shell

    I love calendars and shell has a way to display the calendar for the current month

    $ cal
    
    shell cal output