Skip to content
Snippets Groups Projects
Commit c9a0a9ea authored by joshcarini's avatar joshcarini
Browse files

added code fonts to commands in table

parent 84e38575
No related branches found
No related tags found
1 merge request!148Tablefix
......@@ -32,182 +32,26 @@ For a more information, check out one of these references:
- [Linux Command Line Cheat Sheet](https://www.cheatography.com/davechild/cheat-sheets/linux-command-line) -
a quick reference for Linux commands. Offers a PDF version that you
can print out.
Linux Commands Reference List:
------------------------------
<table>
<tbody>
<tr class="odd">
<td>ls</td>
<td>list: Lists the files and directories located in the current directory</td>
<td><ul>
<li>ls</li>
<li>ls -a
<ul>
<li>shows all the files in the directory, including hidden ones</li>
</ul></li>
<li>ls -l
<ul>
<li>shows contents in a list format including information such as file size, file permissions and date the file was modified</li>
</ul></li>
<li>ls *.txt
<ul>
<li>shows all files in the current directory which end with .txt</li>
</ul></li>
</ul></td>
</tr>
<tr class="even">
<td>cd</td>
<td>change directory: this allows users to navigate in or out of file directories</td>
<td><ul>
<li>cd &lt;folder path&gt;</li>
<li>cd folder_name
<ul>
<li>navigates into directory &quot;folder_name&quot; located in the current directory</li>
</ul></li>
<li>cd ..
<ul>
<li>navigates out of a directory and into the parent directory</li>
</ul>
cd $HOME (or $WORK)
<ul>
<li>navigates to a user's home (or work) directory</li>
</ul></li>
</ul></td>
</tr>
<tr class="odd">
<td>mv</td>
<td>move: used to move a file or directory to another location</td>
<td><ul>
<li>mv &lt;current file(s)&gt; &lt;target file(s)&gt;</li>
<li>mv * ../
<ul>
<li>moves all files from the current directory into the parent directory</li>
</ul></li>
<li>mv old_filename new_filename
<ul>
<li>renames the file &quot;old_filename&quot; to &quot;new_filename&quot;</li>
</ul></li>
</ul></td>
</tr>
<tr class="even">
<td>cp</td>
<td>copy: used to copy a file or directory to another location</td>
<td><ul>
<li>cp &lt;current file(s)&gt; &lt;target file(s)&gt;</li>
<li>cp * ../
<ul>
<li>copies all files in the current directory and puts the copies into the parent directory</li>
</ul></li>
<li>cp -r ./orig_folder ./new_folder<br />
<ul>
<li>copies all files and directories within orig_folder into new_folder (-r indicates this is a recursive copy, so all sub-directories and files within orig_folder will be included in new_folder)</li>
</ul></li>
</ul></td>
</tr>
<tr class="odd">
<td>man</td>
<td><p>manual: displays documentation for commands</p>
<p><strong>Note:</strong> Use up and down arrows to scroll through the text. To exit the manual display, press 'q'</p></td>
<td><ul>
<li>man &lt;command name&gt;</li>
<li>man ls
<ul>
<li>displays documentation for the ls command</li>
</ul></li>
</ul></td>
</tr>
<tr class="even">
<td>mkdir</td>
<td>make directory: creates a directory with the specified name</td>
<td><ul>
<li>mkdir &lt;new_folder&gt;
<ul>
<li>creates the directory &quot;new_folder&quot; within the current directory</li>
</ul></li>
</ul></td>
</tr>
<tr class="odd">
<td>rmdir</td>
<td><p>remove directory: deletes a directory with the specified name</p>
<p><strong>Note:</strong> rmdir only works on empty directories</p></td>
<td><ul>
<li>rmdir &lt;folder_name&gt;
<ul>
<li>removes the directory &quot;folder_name&quot; if the directory is empty</li>
</ul></li>
<li>rmdir *
<ul>
<li>removes all directories within the current directory</li>
</ul></li>
</ul></td>
</tr>
<tr class="even">
<td>rm</td>
<td>remove: deletes file or files with the specified name(s)</td>
<td><ul>
<li>rm &lt;file_name&gt;
<ul>
<li>deletes the file &quot;file_name&quot;</li>
</ul></li>
<li>rm *
<ul>
<li>deletes all files in the current directory</li>
</ul></li>
</ul></td>
</tr>
<tr class="odd">
<td><p>nano</p></td>
<td><p>nano text editor: opens the nano text editor</p>
<p><strong>Note:</strong> To access the menu options, ^ indicates the control (CTRL) key.</p></td>
<td><ul>
<li>nano
<ul>
<li>opens the text editor in a blank file</li>
</ul></li>
<li>nano &lt;file_name&gt;
<ul>
<li>opens the text editor with &quot;file_name&quot; open. If &quot;file_name&quot; does not exist, it will be created if the file is saved</li>
</ul></li>
</ul></td>
</tr>
<tr class="even">
<td>clear</td>
<td>clear: clears the screen of all input/output</td>
<td><ul>
<li>clear</li>
</ul></td>
</tr>
<tr class="odd">
<td>less</td>
<td><p>less: opens an extended view of a file</p>
<p><strong>Note:</strong> Use up and down arrows to scroll through the text. To exit the extended view, press 'q'</p></td>
<td><ul>
<li>less &lt;file_name&gt;
<ul>
<li>opens an extended view of the file &quot;file_name&quot;</li>
</ul></li>
</ul></td>
</tr>
<tr class="even">
<td>cat</td>
<td>concatenate: sends file contents to standard input - used frequently with pipes</td>
<td><ul>
<li>cat &lt;file_name&gt;
<ul>
<li>prints the contents of the file &quot;file_name&quot;</li>
</ul></li>
<li>cat *.txt
<ul>
<li>prints the contents of all files in the current directory that end in &quot;.txt&quot;</li>
</ul></li>
</ul></td>
</tr>
</tbody>
</table>
| | | |
|-------|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ls` | list: Lists the files and directories located in the current directory | <ul><li>`ls`</li><li>`ls -a`<ul><li>shows all the files in the directory, including hidden ones</li></ul></li><li>`ls -l`<ul><li>shows contents in a list format including information such as file size, file permissions and date the file was modified</li></ul></li><li>`ls *.txt`<ul><li>shows all files in the current directory which end with `.txt`</li></ul></li></ul>|
| `cd` | change directory: this allows users to navigate in or out of file directories | <ul><li>`cd <folder path>`</li><li>`cd <folder_name>`<ul><li>navigates into directory `<folder_name>` located in the current directory</li></ul></li><li>`cd ..`<ul><li>navigates out of a directory and into the parent directory</li></ul><li>`cd $HOME` (or `$WORK`)<ul><li>navigates to a user's home (or work) directory</li></ul></li></ul> |
| `mv` | move: used to move a file or directory to another location | <ul><li>`mv <current file(s)> <target file(s)>`</li><li>`mv * ../`<ul><li>moves all files from the current directory into the parent directory</li></ul></li><li>`mv <old_filename> <new_filename>`<ul><li>renames the file `<old_filename>` to `<new_filename>`</li></ul></li></ul> |
| `cp` | copy: used to copy a file or directory to another location | <ul><li>`cp <current file(s)> <target file(s)>`</li><li>`cp * ../`<ul><li>copies all files in the current directory and puts the copies into the parent directory</li></ul></li><li>`cp -r ./orig_folder ./new_folder`<br /><ul><li>copies all files and directories within `orig_folder` into `new_folder` (`-r` indicates this is a recursive copy, so all sub-directories and files within `orig_folder` will be included in `new_folder`)</li></ul></li></ul> |
| `man` | manual: displays documentation for commands </br> </br>**Note:** Use up and down arrows to scroll through the text. To exit the manual display, press 'q' | <ul><li>`man <command name>`</li><li>`man ls`<ul><li>displays documentation for the `ls` command</li></ul></li></ul> |
| `mkdir` | make directory: creates a directory with the specified name | <ul><li>`mkdir new_folder`<ul><li>creates the directory `new_folder` within the current directory</li></ul></li></ul> |
| `rmdir` | remove directory: deletes a directory with the specified name </br></br>**Note:** `rmdir` only works on empty directories | <ul><li>`rmdir folder_name`<ul><li>removes the directory `folder_name` if the directory is empty</li></ul></li><li>`rmdir *`<ul><li>removes all directories within the current directory</li></ul></li></ul> |
| `rm` | remove: deletes file or files with the specified name(s) | <ul><li>`rm file_name`<ul><li>deletes the file `file_name`</li></ul></li><li>`rm *`<ul><li>deletes all files in the current directory</li></ul></li></ul> |
| `nano` | nano text editor: opens the nano text editor </br></br> **Note:** To access the menu options, `^` indicates the control (CTRL) key. | <ul><li>`nano`<ul><li>opens the text editor in a blank file</li></ul></li><li>`nano file_name`<ul><li>opens the text editor with `file_name` open. If `file_name` does not exist, it will be created if the file is saved</li></ul></li></ul> |
| `clear` | clear: clears the screen of all input/output | <ul><li>`clear`</li></ul> |
| `less` | less: opens an extended view of a file </br></br> **Note:** Use up and down arrows to scroll through the text. To exit the extended view, press '`q`' | <ul><li>`less <file_name>`<ul><li>opens an extended view of the file `file_name`</li></ul></li></ul> |
| `cat` | concatenate: sends file contents to standard input - used frequently with pipes | <ul><li>`cat <file_name>`<ul><li>prints the contents of the file `file_name`</li></ul></li><li>`cat *.txt`<ul><li>prints the contents of all files in the current directory that end in `.txt`</li></ul></li></ul> |
Tutorial Video
--------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment