Difference between revisions of "Basics"

From Amahi Wiki
Jump to: navigation, search
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===
Line 120: Line 105:
  
 
===Files and directory Permissions===
 
===Files and directory Permissions===
 +
<table border="1">
 +
<tr>
 +
<th>Command</th>
 +
<th>Action</th>
 +
</tr>
 +
<tr>
 +
<td>chown</td>
 +
<td>Change ownership</td>
 +
</tr>
 +
<tr>
 +
<td>chgrp</td>
 +
<td>Change group</td>
 +
</tr>
 +
<tr>
 +
<td>chmod</td>
 +
<td>Change permissions</td>
 +
</tr>
 +
</table>
  
'''Command Action'''
+
NOTE:  Calculate permissions automatically using the [http://www.webune.com/an-example-code-script-of-javascript-linux-permission-chart-table-chmod-s81.html Linux Permission Chart Table]
chown          Change ownership
 
chgrp          Change group
 
chmod           Change permissions
 

Revision as of 00:13, 22 July 2009

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 "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

NOTE: Calculate permissions automatically using the Linux Permission Chart Table