Difference between revisions of "Basics"

From Amahi Wiki
Jump to: navigation, search
(New page: A small Linux cheat sheet, introducing the very basic and very essential commands for surviving at the Linux CLI. ===Moving around in the file system=== '''Command Action''' pwd ...)
 
Line 1: Line 1:
 
A small Linux cheat sheet, introducing the very basic and very essential commands for surviving at the Linux CLI.
 
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===
 
===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===
 
===Examining files===
 
+
<table border="1">
'''Command Action'''
+
<tr>
file         Determine the type of a file.
+
<th>Command</th>
cat         Concatenate a file.
+
<th>Action</th>
less         View text files and paginate them if needed.
+
</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===
 
===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===
 
===Files and directory Permissions===

Revision as of 00:08, 22 July 2009

A small Linux cheat sheet, introducing the very basic and very essential commands for surviving at the Linux CLI.

Heading Another Heading
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2

Moving around in the file system

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

Command Action
file Determine the type of a file.
cat Concatenate a file.
less View text files and paginate them if needed.


Manipulating files and directories

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

Command Action chown Change ownership chgrp Change group chmod Change permissions