cli

By Druss , 17 July, 2014

Earlier today, I wanted to recover some files that I'd added to version control (for safe keeping). However, I did not want to retain the pesky .svn files that plague every directory in the tree (unlike the wonderful git). GOOG directed me to solutions that all rely on Linux tools to do the trick. The following does work admirably:

find . -type d -name '.svn' -print -exec rm -rf {} \;

Tags Old

Tags

By Druss , 2 May, 2013

In Linux, replacing all instances of a string with another string is easy thanks to sed. A simple example is as follows:

To replace the string foo with the string bar in all .txt files:

sed 's#foo#bar#g' *.txt

This will replace the strings. However, it won't actually save the changes and will instead output the modified text to the screen. To retain the changes or, in other words, to perform the replacements in place within the file, use the -i switch:

Tags Old
By Druss , 22 November, 2012

I ran into this issue a couple of days ago and cannot recall the exact error message. However, the problem was effectively that aptitude could not install the new kernel update because my partition had apparently run out of space. An interrupted update to Klipper is one thing and the Linux kernel a whole 'nother kettle of fishies. Thinking that I simply needed to free up some space on my partition, I checked the current status via df. I surprisingly had 30% of free space still left lying about (my /home is mounted on a different partition). So what ...

By Druss , 19 October, 2012

Since I keep forgetting this shortcut, here it is for posterity. Activating GNU Screen's scrollback feature can be done by pressing CTRL + a + [. This is especially handy when you are using Screen from within PuTTY.

While a number of sites provide additional Vim-esque shortcuts to navigate within the buffer, I've been able to get by fine with just the navigational arrow keys on my keyboard.

Tags Old

All times are UTC. All content licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.