I face many times this simple and repetitive task configuring the LAMP or some stuff in Ubuntu or Drupal:
I have to edit a config file (php.ini, httpd.conf, ... whatever) so quite frequently, if I don't remember the path by heart, I run these 2 commands:
locate php.ini
------- typing manually one of the paths that are shown in the list...
nano /etc/php5/apache2/php.ini
I'm sure this can be improved (without having to memorize the paths). Is there a better approach?
I like the way how this was solved with the command history
: you can execute one of the previous commands in history with !32
(for example). Is there a similar way with locate
or find
commands?