<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1987902058055782772</id><updated>2012-01-07T14:07:50.136-05:00</updated><category term='mail'/><category term='file system copy'/><category term='tcpdump'/><category term='logs'/><category term='arp'/><category term='rm'/><category term='permission'/><category term='passwd'/><category term='sar'/><category term='sed'/><category term='rpm'/><category term='troubleshooting'/><category term='uid'/><category term='find'/><category term='ldap'/><category term='copy'/><category term='shell'/><category term='tee'/><category term='grep'/><category term='veritas'/><category term='timestamp'/><category term='mkfs'/><category term='immutable bit'/><category term='solaris'/><category term='wget'/><category term='ksh'/><category term='ufs'/><category term='math'/><category term='pkginfo'/><category term='netstat'/><category term='/dev/null'/><category term='line wrap'/><category term='vi'/><category term='NULL'/><category term='paste'/><category term='security'/><category term='setuid'/><category term='boot hanging'/><category term='linux kickstart'/><category term='cd'/><category term='aix'/><category term='df'/><category term='tcp states'/><category term='memory'/><category term='bash'/><category term='disk usage'/><category term='networking'/><category term='root'/><category term='tar'/><category term='inode'/><category term='telnet script'/><category term='echo'/><category term='move files between systems'/><category term='TMOUT'/><category term='swap'/><category term='stdout'/><category term='udev'/><category term='pkgchk'/><category term='timeout'/><category term='man pages'/><category term='ls'/><category term='snoop'/><category term='keepalive'/><title type='text'>Stupid UNIX/Linux Tricks</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-1823800947635712299</id><published>2011-12-20T06:47:00.003-05:00</published><updated>2011-12-20T06:54:11.704-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='logs'/><category scheme='http://www.blogger.com/atom/ns#' term='/dev/null'/><title type='text'>A log file is filling up my file system!</title><content type='html'>Application log files that grow uncontrollably can cause problems, like filling up whatever file system they're located on.&lt;br /&gt;&lt;br /&gt;The best way to handle this is to stop the application so you can remove the offending logs, or compress them, then restart the application.  But in a production environment you may not be able to stop the application whenever you want.&lt;br /&gt;&lt;br /&gt;So, desperate times call for desperate measures.  Whack that log file without affecting the application's ability to write to it.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cat /dev/null &gt; /var/app/logfile&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;...and the app will keep on ticking while you breathe a sigh of relief and set up logrotate!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-1823800947635712299?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/1823800947635712299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=1823800947635712299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1823800947635712299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1823800947635712299'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2011/12/log-file-is-filling-up-my-file-system.html' title='A log file is filling up my file system!'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-154611344560205576</id><published>2011-10-09T00:11:00.005-04:00</published><updated>2011-10-09T00:28:01.730-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='copy'/><category scheme='http://www.blogger.com/atom/ns#' term='paste'/><category scheme='http://www.blogger.com/atom/ns#' term='line wrap'/><title type='text'>Copy 'n' Paste: DON'T</title><content type='html'>Just happened again today: instead of copying a new config file for some app, you copy 'n' paste from the terminal window on one side of your screen, to your vi or emacs session in another terminal window.&lt;br /&gt;&lt;br /&gt;So you end up with something that &lt;span style="font-style: italic;"&gt;looks &lt;/span&gt;okay, but if there are any long lines in the file, they will be broken up after the paste.&lt;br /&gt;&lt;br /&gt;Don't believe me?  Copy 'n' paste something like a grub.conf or another file with a long command line from one window to another.  That long line will be chopped up by carriage returns.  In the case of grub.conf your system will probably not even boot.&lt;br /&gt;&lt;br /&gt;Copy:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        kernel /vmlinuz-2.6.32-131.0.15.el6.i686 ro root=/dev/mapper/vg_haydn-lv_root rd_LVM_LV=vg_haydn/lv_root rd_LVM_LV=vg_haydn/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Paste:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        kernel /vmlinuz-2.6.32-131.0.15.el6.i686 ro root=/dev/mapper/vg_hay &lt;br /&gt;dn-lv_root rd_LVM_LV=vg_haydn/lv_root rd_LVM_LV=vg_haydn/lv_swap rd_NO_LUKS &lt;br /&gt;rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=p &lt;br /&gt;c KEYTABLE=us crashkernel=auto rhgb quiet&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How do you find such offending files if you are trying to troubleshoot?  Open the file in vi and look for telltale spaces at the beginning or end of lines that should be continuous.  When moving your vi cursor up and down through the file, the cursor should JUMP over wrapped lines.&lt;br /&gt;&lt;br /&gt;Don't be lazy.  Use the right commands to make and edit config files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-154611344560205576?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/154611344560205576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=154611344560205576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/154611344560205576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/154611344560205576'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2011/10/copy-n-paste-dont.html' title='Copy &apos;n&apos; Paste: DON&apos;T'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-3000213576394876322</id><published>2011-07-24T19:09:00.003-04:00</published><updated>2011-07-24T19:19:05.962-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ldap'/><category scheme='http://www.blogger.com/atom/ns#' term='udev'/><category scheme='http://www.blogger.com/atom/ns#' term='boot hanging'/><title type='text'>Linux boot hanging</title><content type='html'>Some versions of linux have a strange issue upon boot, and a simple Google on "boot hanging udev" will show you that there are many possible reasons.&lt;br /&gt;&lt;br /&gt;Let me add one more reason to the pile.&lt;br /&gt;&lt;br /&gt;On some versions of Red Hat Enterprise Linux 4, if your system is configured to authenticate users to an LDAP directory of some sort, your issue could be that the system is trying to connect to LDAP before seeking its own hardware!  By the time of RHEL 4 update 8 this issue was fixed.&lt;br /&gt;&lt;br /&gt;The solution is to boot the system off the DVD to linux rescue mode, allow the system to mount the installation on /mnt/sysimage and to edit /mnt/sysimage/etc/nsswitch.conf and remove all references to LDAP in this file.&lt;br /&gt;&lt;br /&gt;On the next reboot you should blow right by udev and watch your system start up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-3000213576394876322?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/3000213576394876322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=3000213576394876322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/3000213576394876322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/3000213576394876322'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2011/07/linux-boot-hanging.html' title='Linux boot hanging'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4039144741802653837</id><published>2010-06-17T19:26:00.004-04:00</published><updated>2010-06-17T19:33:11.275-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NULL'/><category scheme='http://www.blogger.com/atom/ns#' term='sed'/><title type='text'>Deleting NULL characters</title><content type='html'>If you ever need to process files from a mainframe, it's likely you will come across a file with lots of NULL characters (ASCII 0).&lt;br /&gt;&lt;br /&gt;These characters appear in vi or other editors like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;^@^@^@^@^@^@^@^@^@^@^@&lt;/pre&gt;&lt;br /&gt;Ugh.&lt;br /&gt;&lt;br /&gt;You can use your old friend sed(1) to get rid of them, but you have to match the pattern of the NULL character.  And how do you pass that to sed?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sed -e 's/\o00//g' infile &gt; outfile&lt;/pre&gt;&lt;br /&gt;That pattern says match octal number 00 and replace it with nothing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4039144741802653837?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4039144741802653837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4039144741802653837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4039144741802653837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4039144741802653837'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2010/06/deleting-null-characters.html' title='Deleting NULL characters'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-7422790432857936853</id><published>2010-03-26T07:49:00.003-04:00</published><updated>2010-03-26T08:13:14.077-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TMOUT'/><category scheme='http://www.blogger.com/atom/ns#' term='timeout'/><category scheme='http://www.blogger.com/atom/ns#' term='keepalive'/><title type='text'>TCP keepalive vs $TMOUT</title><content type='html'>When a TCP connection times out, it can be annoying at best...and kill applications that depend on the TCP pipe staying up when inactive.&lt;br /&gt;&lt;br /&gt;If your shell disconnects after a while, re-log in then enter&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ env | grep TMOUT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If TMOUT is set to non-zero, the session will be disconnected after the number of seconds that TMOUT is set to.  If this is an issue, increase TMOUT or set it to zero.&lt;br /&gt;&lt;br /&gt;But sometimes you don't have this control over timeouts...idle TCP connections may be configured to drop at the router or firewall level.  If you don't have control over those devices, it may be necessary to configure TCP keepalive.&lt;br /&gt;&lt;br /&gt;This syntax is for Linux, your OS will be different.  Add lines to /etc/sysctl.conf:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;net.ipv4.tcp_keepalive_time = 600&lt;br /&gt;net.ipv4.tcp_keepalive_intvl = 60&lt;br /&gt;net.ipv4.tcp_keepalive_probes = 20&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then type in&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sysctl -p&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to get the new values to take effect.  The 600 means that keepalive will kick in when the connection has been idle for 10 minutes (600 seconds).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-7422790432857936853?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/7422790432857936853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=7422790432857936853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/7422790432857936853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/7422790432857936853'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2010/03/tcp-keepalive-vs-tmout.html' title='TCP keepalive vs $TMOUT'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-6178249680706566365</id><published>2009-04-18T14:10:00.003-04:00</published><updated>2009-04-18T14:24:21.176-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sed'/><category scheme='http://www.blogger.com/atom/ns#' term='aix'/><title type='text'>AIX and its "stanza" structure</title><content type='html'>Most *nix systems arrange their system data in delimited rows of text files.  Pretty simple, eh?  Grep for the data you are searching on, then awk out the field you want.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;root:x:0:0:root:/root:/bin/bash&lt;br /&gt;bin:x:1:1:bin:/bin:/sbin/nologin&lt;br /&gt;daemon:x:2:2:daemon:/sbin:/sbin/nologin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Not so AIX.  This OS favors the "stanza" structure, in which data is presented in this form:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;root:&lt;br /&gt;        password = XXXXXXXXXXXXX&lt;br /&gt;        lastupdate = 1239276751&lt;br /&gt;        flags = &lt;br /&gt; &lt;br /&gt;joeuser:&lt;br /&gt;        password = XXXXXXXXXXXXX&lt;br /&gt;        lastupdate = 1239044995&lt;br /&gt;        flags =       &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ah well, to each their own right?  So how do you quickly parse data out of an AIX file?  I use this method...probably not the best but it works.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sed -n '/joeuser/,/:/p' /etc/security/passwd&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will return the stanza for joeuser up to and including the next user name below him (:), which you can then grep for whatever field you want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-6178249680706566365?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/6178249680706566365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=6178249680706566365' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6178249680706566365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6178249680706566365'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2009/04/aix-and-its-stanza-structure.html' title='AIX and its &quot;stanza&quot; structure'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-1046370221919494591</id><published>2009-03-06T17:18:00.009-05:00</published><updated>2009-03-06T17:30:17.391-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='permission'/><category scheme='http://www.blogger.com/atom/ns#' term='root'/><title type='text'>"I'm root, and you're not!"</title><content type='html'>We once came across a very unusual problem: root could log in to this system, get a shell, do anything that root normally does.  Non-root users however couldn't log in, those that were logged in could not run any commands including the basics, &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cd&lt;/code&gt;, nothing.  Only shell built-ins such as &lt;code&gt;echo&lt;/code&gt; worked, and only if you were already logged in.&lt;br /&gt;&lt;br /&gt;Our support contact finally told us to look at permissions for the root of the file system:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;root@mahler:/# ls -ld /&lt;br /&gt;drwx------ 21 root root 4096 2009-01-22 19:27 /&lt;br /&gt;root@mahler:/# &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A big "WTF!" Clearly, someone fat fingered a &lt;code&gt;chmod&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;By now you have guessed the solution:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# chmod 755 /&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-1046370221919494591?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/1046370221919494591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=1046370221919494591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1046370221919494591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1046370221919494591'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2009/03/im-root-and-youre-not.html' title='&quot;I&apos;m root, and you&apos;re not!&quot;'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4062566648519908324</id><published>2008-12-15T12:29:00.004-05:00</published><updated>2009-01-09T19:33:31.269-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Repetitive tasks 101</title><content type='html'>It happens all the time, but recently I was helping with some troubleshooting.  The request was for me to issue a telnet command from our UNIX system so that the network people could see the packets and figure out where they were being dropped.&lt;br /&gt;&lt;br /&gt;After about the 20th time, I was getting tired of hitting [up-arrow, enter].  So I entered a script at the command line of this system:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# while :&lt;br /&gt;&gt; do&lt;br /&gt;&gt; telnet 192.168.1.50 &amp;&lt;br /&gt;&gt; sleep 10&lt;br /&gt;&gt; pkill telnet&lt;br /&gt;&gt; done&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I advised them that the system would repeat the telnet request every ten seconds, kill it, and launch a new one.  Repeatedly.  For as long as it took.&lt;br /&gt;&lt;br /&gt;Then I went and got coffee.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4062566648519908324?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4062566648519908324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4062566648519908324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4062566648519908324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4062566648519908324'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/12/repetetive-tasks-101.html' title='Repetitive tasks 101'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4126463054190314379</id><published>2008-10-22T18:54:00.004-04:00</published><updated>2008-10-22T19:05:33.394-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='arp'/><category scheme='http://www.blogger.com/atom/ns#' term='solaris'/><title type='text'>Whew...very strange ARP problem on Solaris 10</title><content type='html'>File this one under "Current Events"!&lt;br /&gt;&lt;br /&gt;If you are running Solaris 10 update 4 or higher, you may notice Ethernet addresses in Address Resolution Protocol (ARP) cache that do not match the actual address.  Here's a good discussion of what's happening.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forums.sun.com/thread.jspa?threadID=5327921&amp;amp;start=0"&gt;http://forums.sun.com/thread.jspa?threadID=5327921&amp;amp;start=0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problem is that dual-homed Windows boxes with Broadcom NICs on the same subnet are hosing the ARP table on your Solaris system.  Sun says its drivers are not the problem, and they adhere closely to the RFC 826.  Regardless, it is a headache for system administrators.&lt;br /&gt;&lt;br /&gt;The correct solution is to patch the Windows boxes.  But there may be other workarounds, too.  Check the comments section of this post in the weeks ahead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4126463054190314379?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4126463054190314379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4126463054190314379' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4126463054190314379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4126463054190314379'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/10/whewvery-strange-arp-problem-on-solaris.html' title='Whew...very strange ARP problem on Solaris 10'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-3411871892073415074</id><published>2008-09-21T22:35:00.004-04:00</published><updated>2008-09-21T22:45:14.988-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux kickstart'/><title type='text'>Kickstarting Linux installs</title><content type='html'>If you're not familiar with kickstart, it's a way of passing all or some of the parameters to all those questions they ask you at install, greatly speeding up the install process.&lt;br /&gt;&lt;br /&gt;We used to do kickstart installs with floppy drives.  Simple enough, you write a ks.cfg file to an ext[2-3] formatted floppy disk, boot off your install CD and enter at the boot: prompt:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;boot: linux ks=floppy&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Lo and behold, servers started showing up without floppy drives, negating the kickstart advantage.&lt;br /&gt;&lt;br /&gt;That is until we finally found out how to use a USB thumb drive to accomplish the same thing.  Drop the ks.cfg in the root directory of the thumb drive and enter:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;boot: linux ks=hd:sda1:/ks.cfg&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's assuming sda1 is your USB device.  It could be something different.  For instance if you have two internal (logical) raid devices, the device will probably sdc1, and so forth.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-3411871892073415074?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/3411871892073415074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=3411871892073415074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/3411871892073415074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/3411871892073415074'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/09/kickstarting-linux-installs.html' title='Kickstarting Linux installs'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-5635620770293749269</id><published>2008-08-29T07:42:00.007-04:00</published><updated>2008-08-29T07:56:01.647-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swap'/><title type='text'>The system is running out of swap space, and I have to add more NOW!</title><content type='html'>Here's how to add swap on the fly. Find a disk partition on your system with enough space to hold a swapfile...let's say in this example, 700 Mb. Then cd to that directory.&lt;br /&gt;&lt;br /&gt;Let's start with Solaris which is just a couple of commands:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;# mkfile 700m ./swapfile&lt;br /&gt;# swap -a ./swapfile&lt;br /&gt;# swap -l&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Instant relief! Now let's tackle Linux which is just a little more involved.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# dd if=/dev/zero of=swapfile bs=1024 count=655350&lt;br /&gt;655350+0 records in&lt;br /&gt;655350+0 records out&lt;br /&gt;# mkswap ./swapfile&lt;br /&gt;Setting up swapspace version 1, size = 671072 kB&lt;br /&gt;# swapon ./swapfile&lt;br /&gt;# free&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It's important to note that this additional space will not be mounted as swap on the next reboot unless you add the appropriate commands to the system's startup scripts. But these commands WILL get you through a period of heavy virtual memory usage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-5635620770293749269?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/5635620770293749269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=5635620770293749269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5635620770293749269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5635620770293749269'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/08/system-is-running-out-of-swap-space-and.html' title='The system is running out of swap space, and I have to add more NOW!'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-5044724572575824877</id><published>2008-08-19T16:34:00.006-04:00</published><updated>2008-08-19T19:54:50.674-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wget'/><title type='text'>I have to grab every file from a web site!</title><content type='html'>I hope you're not going to sit there at your browser and click away till you get every file.  Find yourself a *nix system with the widely-available &lt;a href="http://linux.die.net/man/1/wget"&gt;wget&lt;/a&gt; command installed, change to a directory with a lot of space, and make it easy on yourself!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ wget --mirror http://www.mysite.com&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The --mirror option will follow all links to other files on this site.&lt;br /&gt;&lt;br /&gt;You may be in a situation where you need to grab all the numerically-named files in one directory, say from file1.html to file3000.html, even if they are not linked.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ /bin/bash&lt;br /&gt;$ for i in $(seq 1 3000)&lt;br /&gt;&gt; do&lt;br /&gt;&gt; wget http://www.mysite.com/numberfiles/file$i.html&lt;br /&gt;&gt; done&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-5044724572575824877?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/5044724572575824877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=5044724572575824877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5044724572575824877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5044724572575824877'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/08/i-have-to-grab-every-file-from-web-site.html' title='I have to grab every file from a web site!'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2323731665448014451</id><published>2008-08-11T10:54:00.005-04:00</published><updated>2008-08-19T19:56:03.529-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ksh'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><category scheme='http://www.blogger.com/atom/ns#' term='math'/><title type='text'>Simple integer math in modern shells</title><content type='html'>If you're accustomed to doing simple math functions in Bourne shell, you probably recall the need for the clumsy expr command, like this:&lt;br /&gt;&lt;pre&gt;AVERAGE=`expr $MYCOUNT / 365`&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That kind of fractured syntax, with the spaces having to be in the right place, is what makes shell math too complex when compared to higher-level languages like Perl.&lt;br /&gt;&lt;br /&gt;But if, like 90% of admins these days, you are using a more advanced shell like Korn or Bash, you can make your math life a lot simpler and more intuitive.  Just use the double parentheses operator.&lt;br /&gt;&lt;pre&gt;((AVERAGE=$MYCOUNT/365))&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;No spaces are needed (they're optional) and it's easier to read and analyze, especially when you are doing a large number of calculations inside a script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2323731665448014451?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2323731665448014451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2323731665448014451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2323731665448014451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2323731665448014451'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/08/simple-integer-math-in-modern-shells.html' title='Simple integer math in modern shells'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2011543188402632399</id><published>2008-08-07T19:43:00.012-04:00</published><updated>2008-08-07T21:04:10.770-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='setuid'/><title type='text'>I want to setuid root on my shell script.</title><content type='html'>No, you don't.  Trust me, you really really don't want to do this.  It's a security hole a mile wide.&lt;br /&gt;&lt;br /&gt;Now having said that, some shells do have options that allow the observance of the setuid bit.  Most shells do not have that option.&lt;br /&gt;&lt;br /&gt;But if you absolutely must run something setuid root, I would much rather you wrap the commands of your shell in a small C program, using the system() call for instance, compile it, and then setuid on that compiled binary.&lt;br /&gt;&lt;br /&gt;&lt;pre CLASS="PROGRAMLISTING"&gt;&lt;br /&gt;#include&amp;#60;stdio.h&amp;#62;&lt;br /&gt;&lt;br /&gt;main(int h)&lt;br /&gt;{&lt;br /&gt;        return (system("/run/whatever/here"));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Save this file with a .c extension, then compile this with gcc:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;gcc myprog.c&lt;/code&gt;&lt;br /&gt;&lt;code&gt;mv a.out mynewexe&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;...then setuid on the compiled executable, &lt;code&gt;mynewexe&lt;/code&gt;.  If you must.  Be careful.  &lt;span style="font-weight:bold;"&gt;By the way, you ever heard of sudo?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2011543188402632399?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2011543188402632399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2011543188402632399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2011543188402632399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2011543188402632399'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/08/i-want-to-setuid-root-on-my-shell.html' title='I want to setuid root on my shell script.'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-1093667167656028707</id><published>2008-08-05T13:27:00.013-04:00</published><updated>2008-08-05T19:47:46.539-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='df'/><category scheme='http://www.blogger.com/atom/ns#' term='inode'/><category scheme='http://www.blogger.com/atom/ns#' term='ufs'/><title type='text'>I can't create a file and df shows plenty of space!</title><content type='html'>This file system has probably run out of inodes. You can check this by:&lt;br /&gt;&lt;br /&gt;Linux and AIX: &lt;code&gt;df -i&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Sun: &lt;code&gt;df -F ufs -o i&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Ten bucks says all your inodes are in a subdirectory named mail. Once you find the offending subdirectory, even this may not work:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;rm *&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;because you may exceed the number of arguments rm can handle. You can put out the fire by whacking the oldest 500:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;ls -t | tail -500  | xargs rm&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then use a similar strategy to clean up the rest of the files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-1093667167656028707?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/1093667167656028707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=1093667167656028707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1093667167656028707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1093667167656028707'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/08/i-cant-create-file-and-df-shows-plenty.html' title='I can&apos;t create a file and df shows plenty of space!'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-1376349099200947222</id><published>2008-08-03T21:16:00.009-04:00</published><updated>2008-08-04T19:17:48.574-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='passwd'/><title type='text'>Automate Linux password changes</title><content type='html'>We all know, or should know, that &lt;a href="http://expect.nist.gov/"&gt;"expect", Don Libes' tool to automate interactive programs&lt;/a&gt;, is the right tool to automate password changes across disparate platforms.&lt;br /&gt;&lt;br /&gt;But did you know that some versions of the Linux passwd(1) command have an option to accept new passwords from stdin?  There are cases where this would really come in handy, for instance when creating a bunch of new accounts.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for f in user1 user2 user3 ... usern&lt;br /&gt;do&lt;br /&gt;/usr/sbin/useradd $f&lt;br /&gt;echo "newpassword" | /usr/bin/passwd --stdin $f&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Check the man page of passwd(1) on your system to ensure the --stdin option is available to you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-1376349099200947222?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/1376349099200947222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=1376349099200947222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1376349099200947222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1376349099200947222'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/08/linux-passwords.html' title='Automate Linux password changes'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-1622872062204919664</id><published>2008-07-31T10:09:00.004-04:00</published><updated>2008-07-31T10:33:25.451-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcp states'/><category scheme='http://www.blogger.com/atom/ns#' term='netstat'/><title type='text'>What do all those TCP states mean in netstat?</title><content type='html'>You see them in UPPER CASE when doing a netstat -a command.  The state of your TCP connections is very useful in determining what is going on network-wise on your system.&lt;br /&gt;&lt;br /&gt;LISTEN&lt;br /&gt;Means the socket is listening for connections (duh).  Look to the left for the port/protocol that's listening.&lt;br /&gt;&lt;br /&gt;ESTABLISHED&lt;br /&gt;Indicates an active, communicating session (double duh).&lt;br /&gt;&lt;br /&gt;TIME_WAIT&lt;br /&gt;Session is done.  You may sometimes see these accumulate but they'll eventually time out.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is the majority of what you'll see when you do netstat -a.  But the next group are very transitory and normally should only last a millisecond or two.  If you see these persistently, you can be sure there's some problem with the communications partner, or a firewall, or something else at the logical layer.&lt;br /&gt;&lt;br /&gt;CLOSE_WAIT&lt;br /&gt;The connection is closed but waiting for an official close that may or may not come.&lt;br /&gt;&lt;br /&gt;SYN_SENT, SYN_RECEIVED&lt;br /&gt;The connection is just starting up with the three-way TCP handshake and you've caught it right in the middle...what are the chances?&lt;br /&gt;&lt;br /&gt;FIN_WAIT, CLOSING, LAST_ACK, FIN_WAIT_2&lt;br /&gt;Same thing but the connection is closing.  These happen momentarily and something is wrong if you see them consistently.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-1622872062204919664?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/1622872062204919664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=1622872062204919664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1622872062204919664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1622872062204919664'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/07/what-do-all-those-tcp-states-mean-in.html' title='What do all those TCP states mean in netstat?'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4652594607024627203</id><published>2008-07-22T10:36:00.010-04:00</published><updated>2008-07-24T19:12:19.247-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><category scheme='http://www.blogger.com/atom/ns#' term='netstat'/><title type='text'>Network Troubleshooting 101</title><content type='html'>When troubleshooting, use IP addresses instead of names.  Name resolution should be tackled last.&lt;br /&gt;&lt;br /&gt;Start with question one and work your way down the list in order.  Answer "no"  and you can stop right there because that's your problem.&lt;br /&gt;&lt;br /&gt;1. Does your network interface have a link up?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;     Look for a green LED on the NIC&lt;/li&gt;&lt;li&gt;     Linux: ethtool eth0 (you should see link ready)&lt;/li&gt;&lt;li&gt;     Solaris: ndd /dev/bge0 link_status (may be different, man ndd)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;2. Can the NIC see other systems on the network?&lt;br /&gt;&lt;pre&gt;# arp -a&lt;/pre&gt;&lt;br /&gt;(issue this command repeatedly because arp cache expires and refreshes frequently)&lt;br /&gt;&lt;br /&gt;If so, are the IP addresses that appear on the same subnet?&lt;br /&gt;&lt;br /&gt;Alternatively, &lt;a href="http://stupidunixlinuxtricks.blogspot.com/2008/03/snoop-and-tcpdump.html"&gt;use tcpdump or snoop&lt;/a&gt; to examine the traffic on the interface.  Make sure you're connected to the right subnet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Can you ping anything else on this subnet?&lt;br /&gt;&lt;pre&gt;# ping 10.123.44.2&lt;/pre&gt; (or a known active IP address on the subnet)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Can you ping the default gateway?  Find the default gateway with &lt;pre&gt;netstat -rn&lt;/pre&gt;&lt;br /&gt;Solaris output looks like this:&lt;br /&gt;&lt;pre&gt;Routing Table: IPv4&lt;br /&gt;Destination           Gateway           Flags  Ref     Use     Interface&lt;br /&gt;-------------------- -------------------- ----- ----- ---------- ---------&lt;br /&gt;default              10.123.40.1          UG        1        410&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Linux looks like this:&lt;br /&gt;&lt;pre&gt;Destination     Gateway         Genmask         Flags   MSS Window  irtt&lt;br /&gt;Iface&lt;br /&gt;0.0.0.0         10.123.14.1     0.0.0.0         UG        0 0          0 eth0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If this line does not appear in your netstat -rn, you have to add a default route (man route) to communicate outside of your subnet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Can you traceroute to your destination system?&lt;br /&gt;&lt;pre&gt;# traceroute 10.123.40.85&lt;br /&gt;traceroute to beethoven (10.123.40.85), 30 hops max, 38 byte packets&lt;br /&gt;1  chopin (10.123.14.3)  0.300 ms  0.302 ms  0.228 ms&lt;br /&gt;2  mahler (10.123.248.115)  0.361 ms  0.317 ms  0.239 ms&lt;br /&gt;3  shostakovich (10.123.248.83)  0.360 ms  0.313 ms  0.228 ms&lt;br /&gt;4  beethoven (10.123.40.85)  0.358 ms  0.292 ms  0.239 ms&lt;br /&gt;#&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Is the destination system listening on the expected port? (see /etc/services for port number)&lt;br /&gt;&lt;br /&gt;For instance, is the system accepting mail? (port 25)&lt;br /&gt;&lt;pre&gt;# telnet 10.123.40.85 25&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you get a response with an escape character, the port is open.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you pass all these steps, your issue is probably name resolution.  Check /etc/hosts, /etc/nsswitch.conf, /etc/resolv.conf, nslookup, etc. to make sure your names are resolving as they should.  Hard-code them in /etc/hosts to fix the issue immediately.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4652594607024627203?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4652594607024627203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4652594607024627203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4652594607024627203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4652594607024627203'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/07/network-troubleshooting-101.html' title='Network Troubleshooting 101'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-992849114031067921</id><published>2008-07-17T20:58:00.005-04:00</published><updated>2008-07-18T06:10:01.385-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mkfs'/><category scheme='http://www.blogger.com/atom/ns#' term='veritas'/><title type='text'>Sun won't tell you, BUT...</title><content type='html'>Many people use Veritas Volume Manager to manage storage on big Solaris systems.  You can use Veritas to expand the size of Veritas volumes, but you also have to expand the ufs file system that's on top of the device.&lt;br /&gt;&lt;br /&gt;You might wonder how Veritas' GUI can expand Solaris ufs file systems, online, without losing data, when Sun support will tell you it's not possible.  Well, you just have to know the "undocumented" -M option to mkfs to make it happen.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# /usr/lib/fs/ufs/mkfs -F ufs -M [mountpoint] [vx rdsk device] [volsize from vxprint]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Be careful.  If you forget the -M option, you will end up with a brand-new, EMPTY file system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-992849114031067921?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/992849114031067921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=992849114031067921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/992849114031067921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/992849114031067921'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/07/sun-wont-tell-you-but.html' title='Sun won&apos;t tell you, BUT...'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-3175180871564398888</id><published>2008-07-08T11:56:00.002-04:00</published><updated>2008-07-08T12:00:37.178-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stdout'/><category scheme='http://www.blogger.com/atom/ns#' term='tee'/><title type='text'>Watching your output and saving it, too</title><content type='html'>Often we want to allow the output of our script or process to scroll by on the screen, and save it at the same time.  Output does not have to be either/or when you make use of tee:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ /usr/local/bin/myscript.sh | tee /tmp/outputfile&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;...lets you have your cake and eat it, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-3175180871564398888?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/3175180871564398888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=3175180871564398888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/3175180871564398888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/3175180871564398888'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/07/watching-your-output-and-saving-it-too.html' title='Watching your output and saving it, too'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4286181606554784069</id><published>2008-06-30T14:07:00.008-04:00</published><updated>2008-06-30T15:07:00.915-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='echo'/><category scheme='http://www.blogger.com/atom/ns#' term='ls'/><title type='text'>How can I display a file list when the "ls" command is broken?</title><content type='html'>If your system is in such a bad shape that you have no ls(1) command or it doesn't work, fear not.  You can still crudely display directory contents by using &lt;b&gt;echo&lt;/b&gt; which is a shell built-in and not an executable:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ echo *&lt;br /&gt;bin boot dev etc home initrd lib lost+found mnt opt proc root sbin sys tmp usr var&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can also still use &lt;b&gt;cd&lt;/b&gt; to navigate, since that is also a shell built-in.  Good luck in recovering your system!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4286181606554784069?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4286181606554784069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4286181606554784069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4286181606554784069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4286181606554784069'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/06/how-can-i-display-file-list-when-ls.html' title='How can I display a file list when the &quot;ls&quot; command is broken?'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-353208919217044305</id><published>2008-06-14T18:32:00.005-04:00</published><updated>2008-06-14T18:39:12.863-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='timestamp'/><category scheme='http://www.blogger.com/atom/ns#' term='find'/><title type='text'>What file was I just editing?</title><content type='html'>Yeah, older users get that brain cramp every now and then.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ ls -lt | head&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;...shows the most recently changed files in the directory.&lt;br /&gt;&lt;br /&gt;Not even sure what subdirectory it was?  Man!  You are getting senile.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ find . -mtime -1 -print&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-353208919217044305?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/353208919217044305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=353208919217044305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/353208919217044305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/353208919217044305'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/06/what-file-was-i-just-editing.html' title='What file was I just editing?'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-5098816290898182660</id><published>2008-06-11T18:52:00.004-04:00</published><updated>2008-06-11T18:59:30.933-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cd'/><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><title type='text'>Toggle between two directories</title><content type='html'>I had forgotten about this one until a couple weeks ago.&lt;br /&gt;&lt;br /&gt;Most modern shells offer &lt;pre&gt;cd -&lt;/pre&gt;...a command that will take you back to your previous directory.  Often times you'll need to toggle, for example, between a data directory and that application's log directory.  cd - will take you back and forth between two directories all day.&lt;br&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;chopin [/export/home/hwk] $ cd /var/tmp&lt;br /&gt;chopin [/var/tmp] $ cd -&lt;br /&gt;/export/home/hwk&lt;br /&gt;chopin [/export/home/hwk] $ cd -&lt;br /&gt;/var/tmp&lt;br /&gt;chopin [/var/tmp] $ cd -&lt;br /&gt;/export/home/hwk&lt;br /&gt;chopin [/export/home/hwk] $ &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-5098816290898182660?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/5098816290898182660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=5098816290898182660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5098816290898182660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5098816290898182660'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/06/toggle-between-two-directories.html' title='Toggle between two directories'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-6354087480603133441</id><published>2008-05-26T21:50:00.004-04:00</published><updated>2008-05-28T22:09:28.112-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uid'/><title type='text'>I need to change a user's UID number</title><content type='html'>The first part is straightforward.  Let's say joeuser's previous UID is 701, and now you need that UID freed up.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/usr/sbin/usermod -u 12345 joeuser&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you have to change all joeuser's files to the new UID.  Remember that ufs and ext* file systems store all ownerships with the UID, not the userid string.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/usr/bin/find / -user 701 -print | xargs -t chown joeuser&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will find all files with the ownership UID of 701 and reset to joeuser's new UID.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-6354087480603133441?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/6354087480603133441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=6354087480603133441' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6354087480603133441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6354087480603133441'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/05/i-need-to-change-users-uid-number.html' title='I need to change a user&apos;s UID number'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-461297630787388449</id><published>2008-05-14T20:54:00.002-04:00</published><updated>2008-05-14T20:57:23.440-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tar'/><title type='text'>Excluding directories in Solaris tar</title><content type='html'>Very fussy syntax here, so be careful.&lt;br /&gt;&lt;br /&gt;Create a file like /opt/tar-exclude, containing&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;./somedir/tempfiles/&lt;br /&gt;./somedir/junk/&lt;br /&gt;&lt;br /&gt;cd /somedir&lt;br /&gt;tar cvXf /opt/tar-exclude backup.tar .&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-461297630787388449?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/461297630787388449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=461297630787388449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/461297630787388449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/461297630787388449'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/05/excluding-directories-in-solaris-tar.html' title='Excluding directories in Solaris tar'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-6014976851048024139</id><published>2008-05-10T10:42:00.003-04:00</published><updated>2008-05-10T10:46:04.250-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rm'/><category scheme='http://www.blogger.com/atom/ns#' term='find'/><title type='text'>Remove all files older than some-number-of-days</title><content type='html'>Be careful with this...make sure you don't run it on an operating system directory!&lt;br /&gt;&lt;br /&gt;Remove all regular files from /app/logs older than 10 days:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# find /app/logs -type f -mtime +10 -exec rm {} \;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-6014976851048024139?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/6014976851048024139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=6014976851048024139' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6014976851048024139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6014976851048024139'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/05/remove-all-files-older-than-some-number.html' title='Remove all files older than some-number-of-days'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-6128279208738634779</id><published>2008-05-02T08:51:00.009-04:00</published><updated>2008-05-02T09:24:35.719-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='disk usage'/><title type='text'>Who's hogging all the space on this file system?</title><content type='html'>You get this one all the time!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# cd /home&lt;br /&gt;# du -sk *                         ### disk usage command&lt;br /&gt;132685  kathy&lt;br /&gt;52721   tom&lt;br /&gt;9       dick&lt;br /&gt;96242   steve&lt;br /&gt;7482    rose&lt;br /&gt;567     barney&lt;br /&gt;# cd kathy&lt;br /&gt;# ls -l | sort -rn +4 | head -5    ### lists, sorts, and shows the top five&lt;br /&gt;-rw-r--r--  1 kathy staff    2494013 Apr 25 08:55 errpt.myserver&lt;br /&gt;-rw-------  1 kathy staff    1256156 Apr 25 09:45 fifthl.sna.Z&lt;br /&gt;-rw-r--r--  1 kathy staff     805888 Apr 27 10:08 network.pci.txt&lt;br /&gt;-rw-r--r--  1 kathy staff     566070 Dec 14 2006  myinst.log&lt;br /&gt;-rw-r--r--  1 kathy staff     533504 Apr 27 10:08 adobeinstructions&lt;br /&gt;# &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Have your user clean up after him or herself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-6128279208738634779?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/6128279208738634779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=6128279208738634779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6128279208738634779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/6128279208738634779'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/05/whos-hogging-all-space-on-this-file.html' title='Who&apos;s hogging all the space on this file system?'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-5856953388102057218</id><published>2008-04-22T20:28:00.001-04:00</published><updated>2008-04-22T20:30:34.603-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='find'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>I need to find all world-writable files on the system</title><content type='html'>This is one you get all the time from auditors...&lt;br /&gt;&lt;br /&gt;&lt;code&gt;find / -perm +o=w -print&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I know, you don't really need the &lt;code&gt;-print&lt;/code&gt; but old habits...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-5856953388102057218?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/5856953388102057218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=5856953388102057218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5856953388102057218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5856953388102057218'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/04/i-need-to-find-all-world-writable-files.html' title='I need to find all world-writable files on the system'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4947972464829099471</id><published>2008-04-07T08:12:00.000-04:00</published><updated>2008-04-08T21:59:44.960-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='memory'/><title type='text'>Diagnosing memory issues in Linux</title><content type='html'>Ever try to support a high-profile database on Linux?  Believe me it's got a lot of challenges.  Frequently you will need detailed information on how memory is being used.&lt;br /&gt;&lt;br /&gt;Try this tip: send memory information to logger every ten minutes to find patterns in how memory is being used.  This gives more detail than sar.  Just make sure your /var is not in danger of filling up!  Here's the cron entry.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;*/10 * * * * cat /proc/meminfo  /usr/bin/logger -p user.info -t "/proc/meminfo: "&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4947972464829099471?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4947972464829099471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4947972464829099471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4947972464829099471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4947972464829099471'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/04/diagnosing-memory-issues-in-linux.html' title='Diagnosing memory issues in Linux'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2331430446439328442</id><published>2008-04-02T11:31:00.000-04:00</published><updated>2008-04-02T11:43:20.041-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sar'/><title type='text'>sar is your friend!</title><content type='html'>The System Activity Reporter (sar) is one of your best tools for performance monitoring, and generally works the same across all versions of *nix.  Set up properly, sar collects data continuously from the system and saves it in /var/log/sa or /var/adm/sa.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;sar -q     ### run queue size&lt;br /&gt;sar -u     ### processor usage&lt;br /&gt;sar -d     ### disk busy-ness&lt;br /&gt;sar -r     ### virtual memory usage&lt;br /&gt;sar -v     ### report on inode and file tables&lt;br /&gt;sar -A     ### dump everything, long display  &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Check for options specific to your OS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2331430446439328442?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2331430446439328442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2331430446439328442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2331430446439328442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2331430446439328442'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/04/sar-is-your-friend.html' title='sar is your friend!'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4241344676716228646</id><published>2008-03-24T17:15:00.000-04:00</published><updated>2008-03-24T17:34:19.541-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rpm'/><title type='text'>Red Hat package commands (rpm)</title><content type='html'>&lt;pre&gt;&lt;br /&gt;rpm -ql httpd             ## Lists all files in installed package&lt;br /&gt;rpm -qi squid             ## On what host was the package built and what's its size?&lt;br /&gt;rpm -qpl somepackage.rpm  ## Lists all files in UNinstalled rpm file&lt;br /&gt;rpm -ivh somepackage.rpm  ## install verbose and with hash marks&lt;br /&gt;rpm -U                    ## upgrade (NOT FOR KERNEL)&lt;br /&gt;rpm -e httpd              ## delete (erase) this package&lt;br /&gt;rpm -F                    ## Freshen package (does not overwrite)&lt;br /&gt;rpm -qa                   ## List all packages.  Grep for desired string&lt;br /&gt;rpm -V                    ## Verify package is installed correctly&lt;br /&gt;rpm -qf /etc/imrc         ## What package does this file come from?&lt;br /&gt;rpm -qa | grep gnome      ## what packages have "gnome" in their name?&lt;br /&gt;rpm -ivh --replacepkgs    ## Force a reinstall of this package&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4241344676716228646?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4241344676716228646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4241344676716228646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4241344676716228646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4241344676716228646'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/red-hat-package-commands-rpm.html' title='Red Hat package commands (rpm)'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-1369640450210984682</id><published>2008-03-24T17:07:00.000-04:00</published><updated>2008-03-24T17:35:07.043-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pkgchk'/><category scheme='http://www.blogger.com/atom/ns#' term='pkginfo'/><title type='text'>Solaris package commands</title><content type='html'>Linux's turn next.&lt;br /&gt;&lt;br /&gt;Find out what package contains a command (passwd in this example):&lt;br /&gt;&lt;code&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;grep passwd /var/sadm/install/contents&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Another way:&lt;br /&gt;&lt;code&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;pkgchk -l -p /usr/bin/admintool&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To see all the files in a package:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pkgchk -v SUNWadmap&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;See what version of a package is installed:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pkginfo -l SUNWvxvm&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-1369640450210984682?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/1369640450210984682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=1369640450210984682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1369640450210984682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/1369640450210984682'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/solaris-package-commands.html' title='Solaris package commands'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2456586003546272352</id><published>2008-03-22T14:53:00.001-04:00</published><updated>2008-03-22T14:59:39.674-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><title type='text'>Oy, I meant to run that command with a &amp; at the end, to get my prompt back</title><content type='html'>You can get your shell command line back anytime.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[ctrl]-z              ### Temporarily halts the current job&lt;br /&gt;bg                    ### Throws the job in the background and gives you your prompt&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In case you should want to return control back to your running job:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;fg&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2456586003546272352?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2456586003546272352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2456586003546272352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2456586003546272352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2456586003546272352'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/oy-i-meant-to-run-that-command-with-at.html' title='Oy, I meant to run that command with a &amp; at the end, to get my prompt back'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2444463037334572282</id><published>2008-03-22T14:32:00.000-04:00</published><updated>2008-03-22T14:57:53.875-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rm'/><title type='text'>How do I remove a file that begins with a - ?</title><content type='html'>The confusion is because rm thinks anything following the - is an option to it.  Fortunately the solution is elegant and simple.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/usr/bin/rm ./-filename&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2444463037334572282?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2444463037334572282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2444463037334572282' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2444463037334572282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2444463037334572282'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/how-do-i-remove-file-that-begins-with.html' title='How do I remove a file that begins with a - ?'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-7904868778430866467</id><published>2008-03-22T14:26:00.000-04:00</published><updated>2008-03-22T14:45:54.697-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='find'/><category scheme='http://www.blogger.com/atom/ns#' term='grep'/><title type='text'>I need to search for a string in every file in a directory, recursively</title><content type='html'>Piece of cake, but this comes up all the time.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;find . -type f -print | xargs grep searchstring&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-7904868778430866467?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/7904868778430866467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=7904868778430866467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/7904868778430866467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/7904868778430866467'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/i-need-to-search-for-string-in-every.html' title='I need to search for a string in every file in a directory, recursively'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-602569111618323558</id><published>2008-03-22T14:14:00.000-04:00</published><updated>2008-03-22T14:51:29.112-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tar'/><title type='text'>Be careful of Solaris' tar command!</title><content type='html'>When creating a tar file in Solaris, NEVER use a leading slash in the target:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;tar cvf mytarfile.tar /etc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;...because when you untar it on your destination, regardless of the present directory, it will overwrite everything in /etc!  What a way to spoil your day.  Always, always use relative path targets for Solaris' tar.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cd /etc&lt;br /&gt;tar cvf mytarfile.tar .&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Get in the habit of always displaying the tar file's contents first:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;tar tvf mytarfile.tar&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;...and never unpack it if it begins with a slash!&lt;br /&gt;&lt;br /&gt;If you have such a tar file, what do you do now?&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/usr/bin/cp /usr/sbin/static/tar /tmp&lt;br /&gt;/usr/bin/dd if=file.tar | /usr/bin/chroot /tmp ./tar xf -&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;...and your output will be safely unpacked in /tmp.  Yes, you have to be &lt;span style="font-weight: bold;"&gt;that &lt;/span&gt;anal about it.&lt;br /&gt;&lt;br /&gt;Fortunately, this is not a problem with GNU tar in Linux and other OS's; the path is always relative.  But you could still muck up things if you are in / when you unpack!&lt;br /&gt;&lt;br /&gt;Be careful out there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-602569111618323558?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/602569111618323558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=602569111618323558' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/602569111618323558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/602569111618323558'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/be-careful-of-solaris-tar-command.html' title='Be careful of Solaris&apos; tar command!'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4092071847943632833</id><published>2008-03-20T09:22:00.000-04:00</published><updated>2008-03-20T09:27:48.321-04:00</updated><title type='text'>Quick action on multiple servers</title><content type='html'>I use this one at least five times per day.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ for f in system1 system2 ... systemn&lt;br /&gt;&gt; do&lt;br /&gt;&gt; ssh -t $f somecommand&lt;br /&gt;&gt; done&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;It's a great, simple way to perform the same actions on many systems.  If you have all your systems listed in a file, it's even simpler:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ for f in `cat systemlist`&lt;br /&gt;&gt; do&lt;br /&gt;&gt; ssh -t $f somecommand&lt;br /&gt;&gt; done&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;By the way, the -t option to ssh is appropriate for any command that needs a tty.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4092071847943632833?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4092071847943632833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4092071847943632833' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4092071847943632833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4092071847943632833'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/quick-action-on-multiple-servers.html' title='Quick action on multiple servers'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2971536194624430147</id><published>2008-03-20T08:43:00.001-04:00</published><updated>2008-03-20T08:49:43.828-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='immutable bit'/><title type='text'>Immutable bit - mungeproof files</title><content type='html'>When you can't take the chance of a file getting accidentally munged, and if your system supports it, use the immutable bit.  Not even root can delete a file with the immutable bit set, unless he clears the bit first (making accidental removal highly unlikely).&lt;br /&gt;&lt;br /&gt;Set the immutable bit on a file:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# chattr +i /etc/myfile&lt;br /&gt;# rm -f /etc/myfile&lt;br /&gt;rm: cannot remove `/etc/myfile': Operation not permitted&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This form allow you to only append to a file:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# chattr +a /etc/myfile&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2971536194624430147?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2971536194624430147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2971536194624430147' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2971536194624430147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2971536194624430147'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/immutable-bit-mungeproof-files.html' title='Immutable bit - mungeproof files'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-2152121994130615296</id><published>2008-03-20T08:23:00.000-04:00</published><updated>2008-03-20T08:40:30.738-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snoop'/><category scheme='http://www.blogger.com/atom/ns#' term='tcpdump'/><title type='text'>Snoop and tcpdump</title><content type='html'>Snoop and tcpdump are great commands to see if you are getting packets from where you expect.  Most of the time to troubleshoot connections you just need this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;snoop -v -d qfe0 -x0 host 192.168.1.87&lt;br /&gt;tcpdump -i en0 host 192.168.1.87&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Exclude the host you're connected from:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;snoop -x0 -d hme0 not host 192.168.1.20&lt;br /&gt;tcpdump -i eth0 not host 192.168.1.20&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;View only LDAP connections (for instance):&lt;br /&gt;&lt;code&gt;&lt;br /&gt;snoop -x0 port 389&lt;br /&gt;tcpdump port 389&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-2152121994130615296?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/2152121994130615296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=2152121994130615296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2152121994130615296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/2152121994130615296'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/snoop-and-tcpdump.html' title='Snoop and tcpdump'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-5685956059729862592</id><published>2008-03-19T13:32:00.000-04:00</published><updated>2008-03-19T15:14:45.253-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file system copy'/><title type='text'>High-performance file system copy</title><content type='html'>From one file system to another on a UNIX system, this is the most efficient file system copy utility. Assume your destination disk is mounted on /dest/dir:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ cd /orig/dir&lt;br /&gt;$ find . -depth -print | cpio -pdm /dest/dir&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-5685956059729862592?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/5685956059729862592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=5685956059729862592' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5685956059729862592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5685956059729862592'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/high-performance-file-system-copy.html' title='High-performance file system copy'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-5646524157353436636</id><published>2008-03-19T13:10:00.000-04:00</published><updated>2008-03-19T13:27:55.175-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mail'/><title type='text'>Sending a mail message at the command line</title><content type='html'>If you know your mail host's name, you can test to make sure it's working correctly right from the command line.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ telnet mailhost 25&lt;br /&gt;helo mylocalhostname&lt;br /&gt;mail from: helmy&lt;br /&gt;rcpt to: recipient@gmail.com&lt;br /&gt;data&lt;br /&gt;Hello World [freeform message body]&lt;br /&gt;.&lt;br /&gt;quit&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-5646524157353436636?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/5646524157353436636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=5646524157353436636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5646524157353436636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/5646524157353436636'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/sending-mail-message-at-command-line.html' title='Sending a mail message at the command line'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-8609791056314475064</id><published>2008-03-19T13:00:00.001-04:00</published><updated>2008-03-19T13:15:33.120-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='telnet script'/><title type='text'>Telnet script</title><content type='html'>I know, you're supposed to use expect to tackle things like this, but for quick and dirty sh, bash, or ksh scripting:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;(echo "user"; sleep 3; echo "password"; sleep 3; echo "somecommand"; sleep 3; echo "exit") | telnet host&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Three seconds should be enough time to get the prompts back from the remote shell. If you need more time, increase it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-8609791056314475064?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/8609791056314475064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=8609791056314475064' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/8609791056314475064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/8609791056314475064'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/telnet-script.html' title='Telnet script'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-7168853889710628409</id><published>2008-03-19T12:52:00.000-04:00</published><updated>2008-03-19T12:58:32.557-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vi'/><title type='text'>Show non-printable characters in vi</title><content type='html'>You just KNOW there's a stray tab or other character in this file, right?  So how can you display these characters in vi?  Glad you asked.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[ESC] to get into command mode&lt;br /&gt;:set list&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Look through the file.  Tabs will be ^I, DOS-style end-of-lines will be ^M, etc.&lt;br /&gt;&lt;br /&gt;To go back:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[ESC] to get into command mode&lt;br /&gt;:set nolist&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-7168853889710628409?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/7168853889710628409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=7168853889710628409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/7168853889710628409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/7168853889710628409'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/show-non-printable-characters-in-vi.html' title='Show non-printable characters in vi'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-279706611540755247</id><published>2008-03-19T12:49:00.001-04:00</published><updated>2008-03-19T12:57:25.384-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='man pages'/><title type='text'>Convert a man page to plain text</title><content type='html'>You need the contents of that man page for pkill in a plain ASCII text format?  No problem.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ man pkill | col -bf &gt; pkill.txt&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-279706611540755247?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/279706611540755247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=279706611540755247' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/279706611540755247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/279706611540755247'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/convert-man-page-to-plain-text.html' title='Convert a man page to plain text'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1987902058055782772.post-4169752182765441019</id><published>2008-03-19T12:40:00.001-04:00</published><updated>2008-03-19T13:15:05.139-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='move files between systems'/><title type='text'>Moving stuff between systems - SECURELY</title><content type='html'>One of my favorites. Sends a tar stream over a secure shell pipe. Assumes of course that you have ssh configured and installed properly.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ cd /source/directory&lt;br /&gt;$ tar zcf - . | ssh remotehost "cd /destination/directory; tar zpxvf - "&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Will unpack the tar stream in /destination/directory on remotehost.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1987902058055782772-4169752182765441019?l=stupidunixlinuxtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stupidunixlinuxtricks.blogspot.com/feeds/4169752182765441019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1987902058055782772&amp;postID=4169752182765441019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4169752182765441019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1987902058055782772/posts/default/4169752182765441019'/><link rel='alternate' type='text/html' href='http://stupidunixlinuxtricks.blogspot.com/2008/03/moving-stuff-between-systems-securely.html' title='Moving stuff between systems - SECURELY'/><author><name>Helmuth W. Kump</name><uri>http://www.blogger.com/profile/12115938388893546235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/-SGHQh34Gd84/TZt-E6qyVfI/AAAAAAAAA9U/GUdlCk6v1Cg/s220/hwk.jpg'/></author><thr:total>0</thr:total></entry></feed>
