Ask HN: Share your best terminal tricks - zabana
======
PeterHK
Stuck in a broken remote session?

    
    
      <enter>
      ~.<enter>
    

want to use different command on last argument?

    
    
      less /path/to/some.file
      vim !$
    

piping and sudo

    
    
      sudo sh -c "my command | jq > meh.txt"

------
KishanB
To clear only the contents of a file (my most used and most favourite one esp
with application logs)

cat /dev/null > any_file.txt

------
Ecco
Ctrl-D = EoF = Closes the term / tmux

