Changes

From Amahi Wiki
Jump to: navigation, search
1,480 bytes added ,  01:53, 7 February 2015
A See [[Linux-hda commands|Linux HDA Commands]] for Amahi HDA-specific commands. This is a small Linux cheat sheet, introducing the very basic and very essential commands for surviving at the Linux Command Line Interface (CLI).
===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>
<tr>
<td>[[Linux-find|find]]</td>
<td>find files or directories.</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 Determine the type of 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>cat Concatenate <td>Ask before removing a file.Good to use with the -r option.</td>less View </tr><tr><td>mkdir</td><td>Make a directory.</td></tr><tr><td>rmdir</td><td>Remove an empty directory.</td></tr><tr><td>nano</td><td>Interactively edit a text files and paginate them if neededfile (sort of the command line equivalent to notepad.exe or TextEdit)</td></tr></table>
===Manipulating files and directoriesFiles/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>  '''NOTE:''' [http://www.webune.com/an-example-code-script-of-javascript-linux-permission-chart-table-chmod-s81.html Linux Permission Chart Table] calculates based on user input.
'''Command Action'''cp Copy a fileAnother good link on the basics of [http://www.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 optionahinc.mkdir Make a directorycom/linux101/permission.rmdir Remove an empty directoryhtm linux permissions].
===Files and directory PermissionsCRON Tester ===[http://cron.schlitt.info/ CRON Tester] and [http://www.cronchecker.net cron checker] will show you what your CRON definition equates too in time and frequency.
For example, <code>0 2 * * *</code> equates to ''2AM daily'Command Action'''chown Change ownershipchgrp Change groupchmod Change permissions.
12,424

edits