<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EZ Linux Admin &#187; linux cheat sheet</title>
	<atom:link href="http://www.ezlinuxadmin.com/tag/linux-cheat-sheet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ezlinuxadmin.com</link>
	<description>Making Linux Easier</description>
	<lastBuildDate>Tue, 29 Jun 2010 19:37:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux cheat sheet</title>
		<link>http://www.ezlinuxadmin.com/2007/12/linux-cheat-sheet/</link>
		<comments>http://www.ezlinuxadmin.com/2007/12/linux-cheat-sheet/#comments</comments>
		<pubDate>Mon, 31 Dec 2007 20:12:07 +0000</pubDate>
		<dc:creator>EZ linux</dc:creator>
				<category><![CDATA[Cheat Sheets]]></category>
		<category><![CDATA[linux cheat sheet]]></category>

		<guid isPermaLink="false">http://ezlinuxadmin.com/?p=8</guid>
		<description><![CDATA[

Help on any Unix command. RTFM!


&#160;
man {command}
Type man ls to read the manual for the ls command.


&#160;
man {command} &#62; {filename}
Redirect help to a file to download.


&#160;
whatis {command}
Give short description of command. (Not on RAIN?)


&#160;
apropos {keyword}
Search for all Unix commands that match keyword, eg apropos            [...]]]></description>
			<content:encoded><![CDATA[<table border="0" width="100%">
<tr>
<td colspan="3"><font size="+1">Help on any Unix command. RTFM!</font></td>
</tr>
<tr>
<td width="50">&nbsp;</td>
<td width="260"><tt>man {command}</tt></td>
<td>Type <strong>man ls</strong> to read the manual for the <strong>ls</strong> command.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>man {command} &gt; {filename}</tt></td>
<td>Redirect help to a file to download.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>whatis {command}</tt></td>
<td>Give short description of command. (Not on RAIN?)</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>apropos {keyword}</tt></td>
<td>Search for all Unix commands that match keyword, eg <strong>apropos                  file</strong>. (Not on RAIN?)</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">List a directory</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls {path}</tt></td>
<td>It&#8217;s ok to combine attributes, eg <strong>ls -laF</strong> gets a long                  listing of all files with types.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls {path_1} {path_2}</tt></td>
<td>List both {path_1} and {path_2}.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls -l {path}</tt></td>
<td>Long listing, with date, size and permisions.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls -a {path}</tt></td>
<td>Show all files, including important .dot files that don&#8217;t otherwise                  show.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls -F {path}</tt></td>
<td>Show type of each file. &#8220;<strong>/</strong>&#8221; = directory, &#8220;<strong>*</strong>&#8221; =                  executable.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls -R {path}</tt></td>
<td>Recursive listing, with all subdirs.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls {path} &gt; {filename}</tt></td>
<td>Redirect directory to a file.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls {path} | more</tt></td>
<td>Show listing one screen at a time.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>dir {path}</tt></td>
<td>Useful alias for DOS people, or use with <strong>ncftp</strong>.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Change to directory</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cd {dirname}</tt></td>
<td>There must be a space between.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cd ~</tt></td>
<td>Go back to home directory, useful if you&#8217;re lost.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cd ..</tt></td>
<td>Go back one directory.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cdup</tt></td>
<td>Useful alias, like &#8220;cd ..&#8221;, or use with <strong>ncftp</strong>.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Make a new directory</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>mkdir {dirname}</tt></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Remove a directory</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>rmdir {dirname}</tt></td>
<td>Only works if {dirname} is empty.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>rm -r {dirname}</tt></td>
<td>Remove all files and subdirs. Careful!</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Print working directory</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>pwd</tt></td>
<td>Show where you are as full path. Useful if you&#8217;re lost or exploring.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Copy a file or directory</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cp {file1} {file2}</tt></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cp -r {dir1} {dir2}</tt></td>
<td>Recursive, copy directory and all subdirs.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cat {newfile} &gt;&gt; {oldfile}</tt></td>
<td>Append newfile to end of oldfile.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Move (or rename) a file</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>mv {oldfile} {newfile}</tt></td>
<td>Moving a file and renaming it are the same thing.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>mv {oldname} {newname}</tt></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Delete a file</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>rm {filespec}</tt></td>
<td><strong>?</strong> and <strong>*</strong> wildcards work like DOS should. &#8220;?&#8221; is                  any character; &#8220;*&#8221; is any string of characters.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ls {filespec}<br />
rm {filespec}</tt></td>
<td>Good strategy: first list a group to make sure it&#8217;s what&#8217;s you                  think&#8230;<br />
&#8230;then delete it all at once.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="2"><font size="+1">Download with zmodem</font></td>
<td>(Use <strong>sx</strong> with xmodem.)</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>sz [-a|b] {filename}</tt></td>
<td><strong>-a</strong> = ascii, <strong>-b</strong> = binary. Use binary for everything.                  (It&#8217;s the default?)</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>sz *.zip</tt></td>
<td>Handy after downloading with FTP. Go talk to your spouse while                  it does it&#8217;s stuff.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="2"><font size="+1">Upload with zmodem</font></td>
<td>(Use <strong>rx</strong> with xmodem.)</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>rz [-a|b] (filename}</tt></td>
<td>Give <strong>rz</strong> command in Unix, THEN start upload at home. Works                  fine with multiple files.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">View a text file</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>more {filename}</tt></td>
<td>View file one screen at a time.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>less {filename}</tt></td>
<td>Like <strong>more</strong>, with extra features.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cat {filename}</tt></td>
<td>View file, but it scrolls.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cat {filename} | more</tt></td>
<td>View file one screen at a time.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>page {filename}</tt></td>
<td>Very handy with <strong>ncftp</strong>.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>pico {filename}</tt></td>
<td>Use text editor and don&#8217;t save.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Edit a text file.</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>pico {filename}</tt></td>
<td>The same editor PINE uses, so you already know it. <strong>vi</strong>                  and <strong>emacs</strong> are also available.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Create a text file.</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>cat &gt; {filename}</tt></td>
<td>Enter your text (multiple lines with <strong>enter</strong> are ok) and                  press <strong>control-d</strong> to save.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>pico {filename}</tt></td>
<td>Create some text and save it.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Compare two files</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>diff {file1} {file2}</tt></td>
<td>Show the differences.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>sdiff {file1} {file2}</tt></td>
<td>Show files side by side.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Other text commands</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>grep '{pattern}' {file}</tt></td>
<td>Find regular expression in file.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>sort {file1} &gt; {file2}</tt></td>
<td>Sort file1 and save as file2.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>sort -o {file} {file}</tt></td>
<td>Replace file with sorted version.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>spell {file}</tt></td>
<td>Display misspelled words.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>wc {file}</tt></td>
<td>Count words in file.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Find files on system</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>find {filespec}</tt></td>
<td>Works with wildcards. Handy for snooping.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>find {filespec} &gt; {filename}</tt></td>
<td>Redirect find list to file. Can be big!</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Make an Alias</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>alias {name} '{command}'</tt></td>
<td>Put the command in &#8217;single quotes&#8217;. More useful in your <strong>.cshrc</strong>                  file.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Wildcards and Shortcuts</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>*</tt></td>
<td>Match any string of characters, eg <strong>page*</strong> gets page1,                  page10, and page.txt.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>?</tt></td>
<td>Match any single character, eg <strong>page?</strong> gets page1 and page2,                  but not page10.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>[...]</tt></td>
<td>Match any characters in a range, eg <strong>page[1-3]</strong> gets page1,                  page2, and page3.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>~</tt></td>
<td>Short for your home directory, eg <strong>cd ~</strong> will take you                  home, and <strong>rm -r ~</strong> will destroy it.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>.</tt></td>
<td>The current directory.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>..</tt></td>
<td>One directory up the tree, eg <strong>ls ..</strong>.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="2"><font size="+1">Pipes and Redirection</font></td>
<td>(You <strong>pipe</strong> a command to another command, and <strong>redirect</strong>                  it to a file.)</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>{command} &gt; {file}</tt></td>
<td>Redirect output to a file, eg <strong>ls &gt; list.txt</strong> writes                  directory to file.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>{command} &gt;&gt; {file}</tt></td>
<td>Append output to an existing file, eg <strong>cat update &gt;&gt;                  archive</strong> adds update to end of archive.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>{command} &lt; {file}</tt></td>
<td>Get input from a file, eg <strong>sort &lt; file.txt</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>{command} &lt; {file1} &gt; {file2}</tt></td>
<td>Get input from <tt>file1</tt>, and write to <tt>file2</tt>,                  eg <strong>sort &lt; old.txt &gt; new.txt</strong> sorts old.txt and saves                  as new.txt.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>{command} | {command}</tt></td>
<td>Pipe one command to another, eg <strong>ls | more</strong> gets directory                  and sends it to <strong>more</strong> to show it one page at a time.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Permissions, important and tricky!</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">Unix permissions concern who can <strong>read</strong> a file                  or directory, <strong>write</strong> to it, and <strong>execute</strong> it. Permissions                  are granted or withheld with a magic 3-digit number. The three                  digits correspond to the <strong>owner</strong> (you); the <strong>group</strong>                  (?); and the <strong>world</strong> (everyone else).Think of each digit as a sum:</p>
<table border="0" width="300">
<tr>
<td width="30">&nbsp;</td>
<td>execute permission</td>
<td>= 1</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>write permission</td>
<td>= 2</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>write and execute (1+2)</td>
<td>= 3</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>read permission</td>
<td>= 4</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>read and execute (4+1)</td>
<td>= 5</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>read and write (4+2)</td>
<td>= 6</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>read, write and execute (4+2+1)</td>
<td>= 7</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">Add the number value of the permissions you want to                  grant each group to make a three digit number, one digit each                  for the owner, the group, and the world. Here are some useful                  combinations. Try to figure them out!</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod 600 {filespec}</tt></td>
<td>You can read and write; the world can&#8217;t. Good for files.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod 700 {filespec}</tt></td>
<td>You can read, write, and execute; the world can&#8217;t. Good for                  scripts.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod 644 {filespec}</tt></td>
<td>You can read and write; the world can only read. Good for web                  pages.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod 755 {filespec}</tt></td>
<td>You can read, write, and execute; the world can read and execute.                  Good for programs you want to share, and your <tt>public_html</tt>                  directory.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Permissions, another way</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">You can also change file permissions with letters:</p>
<table border="0" width="400">
<tr>
<td width="30">&nbsp;</td>
<td><strong>u</strong> = user (yourself)</td>
<td><strong>g</strong> = group</td>
<td><strong>a</strong> = everyone</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td><strong>r</strong> = read</td>
<td><strong>w</strong> = write</td>
<td><strong>x</strong> = execute</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod u+rw {filespec}</tt></td>
<td>Give yourself read and write permission</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod u+x {filespec}</tt></td>
<td>Give yourself execute permission.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>chmod a+rw {filespec}</tt></td>
<td>Give read and write permission to everyone.</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">Applications I use</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>finger {userid}</tt></td>
<td>Find out what someone&#8217;s up to.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>gopher</tt></td>
<td>Gopher.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>irc</tt></td>
<td>IRC, but not available on RAIN.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>lynx</tt></td>
<td>Text-based Web browser, fast and lean.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ncftp</tt></td>
<td>Better FTP.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>pico {filename}</tt></td>
<td>Easy text editor, but limited. <strong>vi</strong> and <strong>emacs</strong> are                  available.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>pine</tt></td>
<td>Email.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>telnet {host}</tt></td>
<td>Start Telnet session to another host.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>tin</tt></td>
<td>Usenet.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>uudecode {filename}<br />
uuencode {filename}</tt></td>
<td>Do it on the server to reduce download size about 1/3.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>ytalk {userid}</tt></td>
<td>Chat with someone else online, eg <strong>ytalk mkummel</strong>. Please                  use <strong>w</strong> first so you don&#8217;t interrupt a big download!</td>
</tr>
<tr>
<td colspan="3">
<hr /></td>
</tr>
<tr>
<td colspan="3"><font size="+1">System info</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>date</tt></td>
<td>Show date and time.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>df</tt></td>
<td>Check system disk capacity.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>du</tt></td>
<td>Check your disk usage and show bytes in each directory.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>more /etc/motd</tt></td>
<td>Read message of the day, &#8220;motd&#8221; is a useful alias..</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>printenv</tt></td>
<td>Show all environmental variables (in C-shell% &#8211; use <strong>set</strong>                  in Korn shell$).</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>quota -v</tt></td>
<td>Check your total disk use.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>uptime</tt></td>
<td>Find out system load.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><tt>w</tt></td>
<td>Who&#8217;s online and what are they doing?</td>
</tr>
</table>
<hr />         <font size="+1">Unix Directory Format</font></p>
<blockquote><p>Long listings (<strong>ls -l</strong>) have this format:</p>
<pre><tt>
    <strong>-</strong> file
    <strong>d</strong> directory,                                            <strong>*</strong> executable
    ^   symbolic links (?)  file size (bytes)   file name   <strong>/</strong> directory
    ^           ^               ^                  ^        ^
    <strong>drwxr-xr-x 11 mkummel      2560 Mar  7 23:25 public_html/
    -rw-r--r--  1 mkummel     10297 Mar  8 23:42 index.html</strong>
                                            ^
     ^^^        user permission  (rwx)      date and time last modified
        ^^^     group permission (rwx)
           ^^^  world permission (rwx)
</tt></pre>
</blockquote>
<hr />         <font size="+1">How to Make an Alias</font></p>
<blockquote><p>An alias lets you type something simple and do something complex.            It&#8217;s a shorthand for a command. If you want to type &#8220;dir&#8221; instead of            &#8220;ls -l&#8221; then type <strong>alias dir &#8216;ls -l&#8217;</strong>. The single quotes tell Unix            that the enclosed text is one command.Aliases are more useful if they&#8217;re permanent so you don&#8217;t have to              think about them. You can do this by adding the alias to your <strong>.cshrc</strong>              file so they&#8217;re automatically loaded when you start. Type <strong>pico              .cshrc</strong> and look for the alias section and add what you want. It              will be effective when you start. Just remember that if you make an              alias with the name of a Unix command, that command will become unavailable.</p>
<p>Here are a few aliases from my <strong>.cshrc</strong> file:</p>
<pre>            # enter your aliases here in the form:
	    # alias     this    means this

            alias       h       history
            alias       m       more
            alias	q	quota -v
            alias       bye     exit
            alias 	ls 	ls -F
            alias       dir     ls
            alias 	cdup	cd ..
            alias	motd	more /etc/motd</pre>
</blockquote>
<hr />         <font size="+1">How to Make a Script</font></p>
<blockquote><p>A Unix script is a text file of commands that can be executed,            like a <strong>.bat</strong> file in DOS. Unix contains a powerful programming            language with loops and variables that I don&#8217;t really understand. Here&#8217;s            a useful example.Unix can&#8217;t rename a bunch of files at once the way DOS can. This              is a problem if you develop Web pages on a DOS machine and then upload              them to your Unix Server. You might have a bunch of <strong>.htm</strong> files              that you want to rename as <strong>.html</strong> files, but Unix makes you              do it one by one. This is actually not a defect. (It&#8217;s a feature!)              Unix is just being more consistent than DOS. So make a script!</p>
<p>Make a text file (eg with <strong>pico</strong>) with the following lines.              The first line is special. It tells Unix what program or shell should              execute the script. Other # lines are comments.</p>
<pre>    #! /bin/csh
    # htm2html converts *.htm files to *.html
    foreach f ( *.htm )
      set base=`basename $f .htm`
      mv $f $base.html
    end</pre>
<p>Save this in your home directory as <strong>htm2html</strong> (or whatever). Then            make it user-executable by typing <strong>chmod 700 htm2html</strong>.            After this a <strong>*</strong> will appear by the file name when you <strong>ls -F</strong>,            to show that it&#8217;s executable. Change to a directory with <strong>.htm</strong>            files and type <strong>~/htm2html</strong>, and it will do its stuff.Think about scripts whenever you find yourself doing the same tedious              thing over and over.</p></blockquote>
<hr />         <font size="+1">Dotfiles (aka Hidden Files)</font></p>
<blockquote><p><strong>Dotfile</strong> names begin with a &#8220;.&#8221; These files and directories            don&#8217;t show up when you list a directory unless you use the <strong>-a</strong>            option, so they are also called <strong>hidden files</strong>. Type <strong>ls -la</strong>            in your home directory to see what you have.Some of these dotfiles are crucial. They initialize your shell and              the programs you use, like <strong>autoexec.bat</strong> in DOS and <strong>.ini</strong>              files in Windows. <strong>rc</strong> means &#8220;run commands&#8221;. These are all text              files that can be edited, but change them at your peril. Make backups              first!</p>
<p>Here&#8217;s some of what I get when I type <strong>ls -laF</strong>:</p>
<table border="0" width="500">
<tr>
<td>.addressbook</td>
<td>my email addressbook.</td>
</tr>
<tr>
<td>.cshrc</td>
<td>my C-shell startup info, important!</td>
</tr>
<tr>
<td>.gopherrc</td>
<td>my <strong>gopher</strong> setup.</td>
</tr>
<tr>
<td>.history</td>
<td>list of past commands.</td>
</tr>
<tr>
<td>.login</td>
<td>login init, important!</td>
</tr>
<tr>
<td>.lynxrc</td>
<td>my <strong>lynx</strong> setup for WWW.</td>
</tr>
<tr>
<td>.ncftp/</td>
<td>hidden dir of <strong>ncftp</strong> stuff.</td>
</tr>
<tr>
<td>.newsrc</td>
<td>my list of subscribed newsgroups.</td>
</tr>
<tr>
<td>.pinerc</td>
<td>my <strong>pine</strong> setup for email.</td>
</tr>
<tr>
<td>.plan</td>
<td>text appears when I&#8217;m <strong>fingered</strong>, ok to edit.</td>
</tr>
<tr>
<td>.profile</td>
<td>Korn shell startup info, important!</td>
</tr>
<tr>
<td>.project</td>
<td>text appears when I&#8217;m <strong>fingered</strong>, ok to edit.</td>
</tr>
<tr>
<td>.signature</td>
<td>my signature file for mail and news, ok to edit.</td>
</tr>
<tr>
<td>.tin/</td>
<td>hidden dir of my <strong>tin</strong> stuff for usenet.</td>
</tr>
<tr>
<td>.ytalkrc</td>
<td>my <strong>ytalk</strong> setup.</td>
</tr>
</table>
</blockquote>
<hr />         <font size="+1">DOS and UNIX commands</font></p>
<blockquote>
<table border="0" width="500">
<tr align="left">
<th>Action</th>
<th>DOS</th>
<th>UNIX</th>
</tr>
<tr>
<td>change directory</td>
<td>cd</td>
<td>cd</td>
</tr>
<tr>
<td>change file protection</td>
<td>attrib</td>
<td>chmod</td>
</tr>
<tr>
<td>compare files</td>
<td>comp</td>
<td>diff</td>
</tr>
<tr>
<td>copy file</td>
<td>copy</td>
<td>cp</td>
</tr>
<tr>
<td>delete file</td>
<td>del</td>
<td>rm</td>
</tr>
<tr>
<td>delete directory</td>
<td>rd</td>
<td>rmdir</td>
</tr>
<tr>
<td>directory list</td>
<td>dir</td>
<td>ls</td>
</tr>
<tr>
<td>edit a file</td>
<td>edit</td>
<td>pico</td>
</tr>
<tr>
<td>environment</td>
<td>set</td>
<td>printenv</td>
</tr>
<tr>
<td>find string in file</td>
<td>find</td>
<td>grep</td>
</tr>
<tr>
<td>help</td>
<td>help</td>
<td>man</td>
</tr>
<tr>
<td>make directory</td>
<td>md</td>
<td>mkdir</td>
</tr>
<tr>
<td>move file</td>
<td>move</td>
<td>mv</td>
</tr>
<tr>
<td>rename file</td>
<td>ren</td>
<td>mv</td>
</tr>
<tr>
<td>show date and time</td>
<td>date, time</td>
<td>date</td>
</tr>
<tr>
<td>show disk space</td>
<td>chkdsk</td>
<td>df</td>
</tr>
<tr>
<td>show file</td>
<td>type</td>
<td>cat</td>
</tr>
<tr>
<td>show file by screens</td>
<td>type filename | more</td>
<td>more</td>
</tr>
<tr>
<td>sort data</td>
<td>sort</td>
<td>sort</td>
</tr>
</table>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ezlinuxadmin.com/2007/12/linux-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
