Changes

From Amahi Wiki
Jump to: navigation, search
727 bytes added ,  00:08, 22 July 2009
no edit summary
A small Linux cheat sheet, introducing the very basic and very essential commands for surviving at the Linux CLI.
 
<table border="1">
<tr>
<th>Heading</th>
<th>Another Heading</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
===Moving around in the file system===
<table border="1">
<tr>
<th>Command</th>
<th>Action</th>
</tr>
<tr>
<td>pwd</td>
<td>"Print working directory" - show what dir you're in.</td>
</tr>
<tr>
<td>ls</td>
<td>List the contents of a dir.</td>
</tr>
<tr>
<td>ls -l</td>
<td>List the contents of a dir and show additional info of the files.</td>
</tr>
<tr>
<td>ls -a</td>
<td>List all files, including hidden files.</td>
</tr>
<tr>
<td>cd</td>
<td>Change directory.</td>
</tr>
<tr>
<td>cd ..</td>
<td>Go to the parent directory.</td>
</tr>
</table>
'''Command Action'''
pwd "Print working directory" - show what dir you're in.
ls List the contents of a dir.
ls -l List the contents of a dir and show additional info of the files.
ls -a List all files, including hidden files.
cd Change directory.
cd .. Go to the parent directory.
===Examining files===
<table border="1">'''<tr><th>Command </th><th>Action'''</th></tr><tr><td>file </td><td>Determine the type of a file.</td></tr><tr><td>cat </td><td>Concatenate a file.</td></tr><tr><td>less </td><td>View text files and paginate them if needed.</td></tr></table>
===Manipulating files and directories===
<table border="1">
<tr>
<th>Command</th>
<th>Action</th>
</tr>
<tr>
<td>cp</td>
<td>Copy a file.</td>
</tr>
<tr>
<td>cp -i</td>
<td>Copy a file and ask before overwriting.</td>
</tr>
<tr>
<td>cp -r</td>
<td>Copy a directory with its contents.</td>
</tr>
<tr>
<td>mv</td>
<td>Move or rename a file.</td>
</tr>
<tr>
<td>mv -i</td>
<td>Move or rename a file and ask before overwriting.</td>
</tr>
<tr>
<td>rm</td>
<td>Remove a file.</td>
</tr>
<tr>
<td>rm -r</td>
<td>Remove a directory with its contents.</td>
</tr>
<tr>
<td>rm -i</td>
<td>Ask before removing a file. Good to use with the -r option.</td>
</tr>
<tr>
<td>mkdir</td>
<td>Make a directory.</td>
</tr>
<tr>
<td>rmdir</td>
<td>Remove an empty directory.</td>
</tr>
</table>
'''Command Action'''
cp Copy a file.
cp -i Copy a file and ask before overwriting.
cp -r Copy a directory with its contents.
mv Move or rename a file.
mv -i Move or rename a file and ask before overwriting.
rm Remove a file.
rm -r Remove a directory with its contents.
rm -i Ask before removing a file. Good to use with the -r option.
mkdir Make a directory.
rmdir Remove an empty directory.
===Files and directory Permissions===
12,424

edits