<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://wiki.marandcustomsolutions.com/rdf'>
    <s:Snip rdf:about='http://wiki.marandcustomsolutions.com/rdf#Linux/Commands'
         s:name='Linux/Commands'
         s:cUser='mpecher'
         s:oUser=''
         s:mUser='mpecher'>
        <s:content>1 bash programming intro&#xD;&#xA;http://www.faqs.org/docs/Linux-HOWTO/Bash-Prog-Intro-HOWTO.html&#xD;&#xA;&#xD;&#xA;1 ssh\\&#xD;&#xA;to ssh into another box with a non-standard port&#xD;&#xA;{code}&#xD;&#xA;ssh &lt;server&gt; -p &lt;port&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Zip\\&#xD;&#xA;to zip all of a directory in linux&#xD;&#xA;{code}&#xD;&#xA;zip -r &lt;file_name&gt;.zip &lt;dir_to_zip&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Tar\\&#xD;&#xA;to tar the contents of a directory (creating the tar):&#xD;&#xA;{code}&#xD;&#xA;tar -cvf &lt;file_name&gt;.tar &lt;dir_to_zip&gt;&#xD;&#xA;{code}&#xD;&#xA;to add to an existing tar&#xD;&#xA;{code}&#xD;&#xA;tar -rvf &lt;file_name&gt;.tar &lt;dir_to_zip&gt;&#xD;&#xA;{code}&#xD;&#xA;to list the contents of a tar&#xD;&#xA;{code}&#xD;&#xA;tar -v --list --file=/&#xD;&#xA;{code}&#xD;&#xA;to extract the file&#xD;&#xA;{code}&#xD;&#xA;tar -xvf &#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;to zip the file&#xD;&#xA;{code}&#xD;&#xA;gzip &lt;file_name&gt;.tar&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Date/Time see [Linux/Commands/Date,Time,TimeZones] for full info.&#xD;&#xA;To set the date time (to Jan 13 2006, 9:51am) __Note AMERICAN DATE FORMAT__&#xD;&#xA;{code}&#xD;&#xA; date -s &quot;01/13/2006 09:51:00&quot;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Secure Copy: scp&#xD;&#xA;To copy a file from one box to another&#xD;&#xA;{code}&#xD;&#xA;scp  -P 7272 &lt;local file&gt; user@host:&lt;remote location&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Who&apos;s using the system, from where etc&#xD;&#xA;{code}&#xD;&#xA;w - show who is logged on and what they are doing&#xD;&#xA;{code}&#xD;&#xA;{code}&#xD;&#xA;users  -  print the user names of users currently logged in to the current host&#xD;&#xA;{code}&#xD;&#xA;{code}&#xD;&#xA; last - show listing of last logged in users&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Links&#xD;&#xA;To delete a symbolic link:&#xD;&#xA;{code}&#xD;&#xA;rm link_name&#xD;&#xA;{code}&#xD;&#xA;ie. Delete it as a regular file (make sure there is not / after it (if the link is a directory).&#xD;&#xA;&#xD;&#xA;1 Finding text&#xD;&#xA;The following command will find all css files containing &quot;background.gif&quot;. Customise as required.&#xD;&#xA;{code}&#xD;&#xA;find . -name &quot;*.css&quot; -exec grep -H background.gif {} \&quot;;&quot;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Deleting files&#xD;&#xA;first to verify we&apos;re not deleting sensitive files.&#xD;&#xA;{code}&#xD;&#xA; find . -name .DS_Store&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;The following command will use find to delete all found files (.svn files)&#xD;&#xA;{code}&#xD;&#xA;find . -name \*.svn -exec rm -rf {} \;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Usually &#xD;&#xA;{code}&#xD;&#xA;rm -rf &lt;fileOrDir&gt; &#xD;&#xA;{code}&#xD;&#xA;will do on most *nix, but not on the Mac ;(&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;1 chkconfig&#xD;&#xA;For checking and setting the run levels on a box&#xD;&#xA;&#xD;&#xA;1 Global profiles&#xD;&#xA;__Application Environment Setup Using /etc/profile.d/*_&#xD;&#xA;&#xD;&#xA;When a user logs in, environment variables are set from various places.  That includes /etc/profile (for all users).&#xD;&#xA;&#xD;&#xA;Then all the files in the /etc/profile.d directory.&#xD;&#xA;&#xD;&#xA;Then ~/.bash_profile, then ~/.bashrc.&#xD;&#xA;&#xD;&#xA;/etc/profile.d/ is a good place to put your application specific setups.  For example, I always use SSH for CVS (cf. RSH).  So I use:&#xD;&#xA;{code}&#xD;&#xA;echo &quot;export CVS_RSH=ssh&quot; &gt;&gt; /etc/profile.d/cvs.sh&#xD;&#xA;chmod +x /etc/profile.d/cvs.sh&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Port forwarding (eg. access mysql through ssh)&#xD;&#xA;Use the following command to allow connection from a local mysql client to connect to a remote mysql server on 3306 through ssh. (i.e. port 3306 is not open to outside world)&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA; ssh -p 7272 -L 9906:localhost:3306 mpecher@marandcustomsolutions.com&#xD;&#xA;{code}&#xD;&#xA;then local client points to: port 9906, and ip 127.0.0.1&#xD;&#xA;&#xD;&#xA;1 lstail&#xD;&#xA;This bit of bash will do an ls 100 times&#xD;&#xA;{code}&#xD;&#xA;for i in $(seq 1 100); do ls -alp; sleep 0.25; done&#xD;&#xA;{code}</s:content>
        <s:mTime>2009-04-28 09:22:04.0</s:mTime>
        <s:cTime>2005-12-12 11:36:32.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#Linux'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Linux/Commands/Date,Time,TimeZones'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Linux/Understanding memory usage'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Version Control Systems/ClearCase/ConfigSpec'/>
                <rdf:li rdf:resource='#Siteminder'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Entity Relationship Diagram'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Appfuse/Tips/Branding'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Portal/themes'/>
                <rdf:li rdf:resource='#putty'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#bidz/tomcat'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/WebSEAL/WebSEAL Junctions'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Hibernate/Mapping'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Linux/CentOS'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#bidz/tomcat/prod-server.xml'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Entity+Relationship+Diagram/'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/Versions'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Linux/Understanding+memory+usage'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#bidz/vsftp'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Manually Deleting a Windows Service'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Portal'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Trailer Wiring'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#snipsnap-index/Networking'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#snipsnap-index/WHEN_ALL_ELSE_FAILS'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Appfuse/Tips/ThemeColor'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Linux/Commands/'/>
                <rdf:li rdf:resource='#bidz'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Version Control Systems/ClearCase/Branch'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/Java &amp; J2EE/Websphere/WebSEAL'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>

