title: How can I easily log some specific command line commands into a file?
body: <p>I often perform configuration changes using single line commands on Mac OS, Linux or even Windows and I want to easily log them in a file, so I can replay if I have to reconfigure the machine again.</p>
  
  <p>Please not that I want to do these only for some commands, so the shell history is of not use.</p>
  
  <p>Ideally I would like to be able to use some kind of shell extension that logs some of the commands.</p>
  
  <p>As you know if you start your bash command with a space, this command is not logged into the history. </p>
  
  <p>What if I can have another prefix that would do the opposite? Is there something there that can be used for this? A solution for bash would be more than enough and if there is an already existing solution it would much better than me writing a new one.</p>