{"id":56,"date":"2008-08-03T17:06:15","date_gmt":"2008-08-03T15:06:15","guid":{"rendered":"http:\/\/bohrium.homelinux.org\/wordpress\/?p=56"},"modified":"2011-05-27T17:37:09","modified_gmt":"2011-05-27T15:37:09","slug":"some-useful-linux-commands","status":"publish","type":"post","link":"https:\/\/blog.louic.nl\/?p=56","title":{"rendered":"Useful things in (gentoo) linux"},"content":{"rendered":"<p>This is just a collection of some commands and tricks that I keep forgetting<\/p>\n<ul>\n<li>Search and replace in multiple files, using perl\n<pre lang=\"bash\">perl -p -i -e 's\/search\/replace\/g *.txt<\/pre>\n<\/li>\n<li>Change the color of a (gentoo) bash prompt\n<pre lang=\"bash\">export PS1=\"<p style='text-align:center;'><span class='MathJax_Preview'>\\[\\]<\/span><script type='math\/tex;  mode=display'><\/script><\/p>\\u@\\h<p style='text-align:center;'><span class='MathJax_Preview'>\\[\\]<\/span><script type='math\/tex;  mode=display'><\/script><\/p> \\w \\<span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script> \"<\/pre>\n<\/li>\n<li>Operations on multiple files using bash (in this example: something interesting is done with every tex file in the current directory)\n<pre lang=\"bash\">for f in *.tex\r\ndo\r\n  echo \"doing something interesting to file $f\"\r\ndone<\/pre>\n<\/li>\n<li>Redirect both standard error and stdout to \/dev\/null\n<pre lang=\"bash\">2>&1 >\/dev\/null<\/pre>\n<\/li>\n<li>Syntax highlighting in openoffice (for presentations, for example)<br \/>\nAthough it seems a bit inefficient, this is the way to do it:<\/p>\n<ul>\n<li>open the file in kate and export it as html<\/li>\n<li>open the file in a web-browser and copy the text<\/li>\n<li>paste the text in an openoffice writer document<\/li>\n<li>save the file als .odt or export it as .rtf for use in impress<\/li>\n<\/ul>\n<\/li>\n<li>Change the display of the \"top\" command, and save it for next time<\/li>\n<ul>\n<li>change the settings, for example like this: start top, press i, 1, d 1<\/li>\n<li>press W to save the current settings to ~\/.toprc<\/li>\n<\/ul>\n<li>to use an end-of-line character to a vim search query: ctrl-V ctrl-M<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is just a collection of some commands and tricks that I keep forgetting Search and replace in multiple files, using perl perl -p -i -e 's\/search\/replace\/g *.txt Change the color of a (gentoo) bash prompt export PS1=\"<code class='tex2jax_ignore'>\\[\\]<\/code>\\u@\\h<code class='tex2jax_ignore'>\\[\\]<\/code> \\w \\<span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script> &hellip; <a href=\"https:\/\/blog.louic.nl\/?p=56\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[35,34],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts\/56"}],"collection":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56"}],"version-history":[{"count":20,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":568,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions\/568"}],"wp:attachment":[{"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.louic.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}