<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>a.muse: One-liners</title>
    <link>http://www.jessirae.com/blog/articles/2007/01/06/one-liners</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>One-liners</title>
      <description>&lt;p&gt;and Frequently used commands I can&amp;#8217;t seem to remember the exact syntax of.  Nothin&amp;#8217; fancy.
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Linux&lt;/strong&gt;
&lt;br /&gt;
&lt;code&gt;find . -name \*.* | xargs grep search_string&lt;/code&gt;&lt;/p&gt;


&lt;ul&gt;&lt;em&gt;navigate to folder you would like to search, enter this command with the search string you would like to find and this command lists all files containing that string&lt;/em&gt;&lt;/ul&gt;

&lt;code&gt;ps x -Ho pid,args&lt;/code&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;em&gt;lists all of the processes running&lt;/em&gt;&lt;/ul&gt;

&lt;code&gt;find / -name gcc&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;em&gt;finds all folders named gcc&lt;/em&gt;&lt;/ul&gt;

&lt;code&gt;
sed '/$/,/' /home/Desktop/jessirae &amp;gt; /home/Desktop/jessirae2
&lt;/code&gt;
&lt;ul&gt;&lt;em&gt;places a comma at the end of each line&lt;/em&gt;&lt;/ul&gt;
&lt;code&gt;
paste -sd '\0' - /home/Desktop/jessirae2 &amp;gt; /home/Desktop/jessirae3
&lt;/code&gt;
&lt;ul&gt;&lt;em&gt;The &lt;span class="caps"&gt;NEWLINE&lt;/span&gt; character of every line except the last line in each input file will be replaced with a separator&lt;/em&gt;&lt;/ul&gt;

	&lt;p&gt;&lt;strong&gt;Ruby&lt;/strong&gt;&lt;/p&gt;


&lt;code&gt;"&amp;lt;a href=\"http://www.oldurl.com\"&amp;gt;JessiRae.com&amp;lt;/a&amp;gt;".

gsub(/(http?:\/{2})\S+\.(\w+)(\S+)/,"http://www.jessirae.com/blog/")
&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;em&gt;global substitution replaces all instances of some expression in a string with some other string or performs some function on that string&lt;/em&gt;&lt;/ul&gt;

&lt;code&gt;
require 'open-uri'
....
open(url) {

      |page| page_content = page.read()

      page_content

    }

&lt;/code&gt;
&lt;ul&gt;&lt;em&gt;returns html from specified webpage&lt;/em&gt;&lt;/ul&gt;
</description>
      <pubDate>Sat, 06 Jan 2007 22:18:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:36d60141-af63-4c88-b93e-16687b804244</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2007/01/06/one-liners</link>
      <category>technology</category>
      <category>ruby &amp; rails</category>
      <category>gsub</category>
      <category>sed</category>
      <category>find</category>
      <category>paste</category>
      <category>string</category>
      <category>ruby</category>
      <category>commands</category>
      <category>linux</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/7430</trackback:ping>
    </item>
  </channel>
</rss>
