Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a command as soon as I save a specific text file. I know how to do it when the file closes, but I am looking for the code to execute as soon as I hit Ctrl+S.

Thanks in advance..

share|improve this question
What editor do you use? – Radu Rădeanu Sep 12 '13 at 21:23

You can do this using tools from the inotify-tools package, available in the archives or using other libraries such as pyinotify.

share|improve this answer
Would you elaborate? – TAAPSogeking Sep 13 '13 at 21:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.