Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Share your best terminal tricks
2 points by zabana on Aug 12, 2017 | hide | past | favorite | 3 comments



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"


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


Ctrl-D = EoF = Closes the term / tmux




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: