16 Sep 2011

Backticking command combo - Or how to not have to type long names

So, your instructions say to edit config.xml while setting up a program in Ubuntu/Debian Linux. You realize you don’t have a clue where it’s at… sudo apt-get install locate && sudo updatedb Then once it indexes your files, type a quick locate config.xml to find it. At this point you realize it’s buried in many sub folders of subfolders, but you need to edit it with your favorite editor (vim, nano, emacs..) If it’s the only result from the locate command, type vimlocate config.xml``.  This uses command interpolation to substitute the answer of the locate request :). There should be a snappy way also to chop the results (if more than one appears)…but I’m out of time!