This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
notes:unix [2019/03/07 19:22] – [Notes] ceberli1 | notes:unix [2020/10/29 03:53] – [Course Notes] smalik3 | ||
---|---|---|---|
Line 5: | Line 5: | ||
</ | </ | ||
- | ======Projects====== | + | ======Course Notes====== |
- | ======URLs====== | + | The " |
+ | Example: < | ||
+ | This will display the manual for the Linux command " | ||
- | ======Notes====== | + | ---------------------------------- |
- | Commands\\ | + | The " |
+ | Example: < | ||
+ | After using " | ||
- | How to claim participation points\\ | ||
- | -from lab46 prompt type: 'wcp unix wcp1' (putting the proper week number at the end instead of the 1)\\ | ||
- | |||
- | Commands for your repository\\ | ||
- | (make sure you are in your repository directory)\\ | ||
- | |||
- | -'hg status' | ||
- | -'hg add' (begins tracking all untracked files, put a filename at the end to just do one)\\ | ||
- | -'hg commit -m " | ||
- | -'hg push' (updates repository with commits) | ||
- | |||
- | Commands That we Have Learned:\\ | ||
- | (Note: commands are used as written so if capitalized it needs to be capitalized and if a " " is used you need to put what is in there.) | ||
- | * ls - Lists the files in your current directory. If combined with a -l (ls -l) will give more info including permissions for the files. | ||
- | * pwd - print the working directory. Will show you where you currently are. | ||
- | * cd - change directory. Allows you to change your current directory. You can set up the absolute path to go through multiple directories in one command. | ||
- | * mkdir " | ||
- | * cp "name of file you wish to copy" "where you are copying it" - copies the file and put it somewhere if combined with a -R you copy a directory | ||
- | * mv "name of file you wish to move" "where to move/new name" - allows you to move a file to a different directory. If in the second argument the name is not a directory it will rename the file to what was imputed." | ||
- | * rm "name of file to delete" | ||
- | * rmdir " | ||
- | * touch "name of new file" - creates an empty file but you could just... | ||
- | * vi "name of file you wish to edit/ | ||
- | * cat "name of the file" - prints the contents of the file to standard output. So can be redirected for shenanigans | ||
- | * head/tail "name of file - shows the top/bottom part of file. **NOTE:** if you want to specify the amount of lines from the top/bottom that it shows but a --lines=" | ||
- | * less "name of the file" - allows you to scroll up and down through the file. Handy for large text files. | ||
- | * more "name of the file" - like less, allows you to scroll through a text document but once you hit next page you cannot go back. | ||
- | * file "name of file" - tells you what kind a file the file is | ||
- | * man "name of manual page" - handy tool for figuring out how commands work | ||
- | * rev "name of the file" - to be able to reverse all the text in a file you use | ||
- | * wc - gives you the line/ | ||
- | * > - use this change the standard output of a command | ||
- | * >> - use this to append a file to another file. | ||
- | * apropos " | ||
- | * tr " | ||
- | * sort "file to sort" - sorts a file numerically/ | ||
- | * grep " | ||
- | |||
- | Control (Ctrl or ^) Commands:\\ | ||
- | * ^a - sends cursor to the start of the line | ||
- | * ^e - sends cursor to the end of the line | ||
- | * ^f - moves cursor forward once | ||
- | * ^b - moves cursor backwards once | ||
- | * ^k - delete everything in front of the cursor | ||
- | * ^u - delete everything behind the cursor | ||
- | * ^q turn the transmit ability of the terminal back on. | ||
- | |||
- | |||
- | __// | ||
- | //(the greatest text editor known to man...)//\\ | ||
- | // | ||
- | |||
- | -'vi (filename)' | ||
- | -'vi (line number) (filename)' | ||
- | |||
- | |||
- | Vi is a moded editing system, invented before the mouse and when keyboards had less keys.\\ | ||
- | |||
- | |||
- | **Modes**\\ | ||
- | |||
- | __Command mode__\\ | ||
- | - This is the starting mode\\ | ||
- | - All other modes are accessed from here\\ | ||
- | - Escape usually brings you here\\ | ||
- | - Nearly every key stands for a command\\ | ||
- | - (see below for commands)\\ | ||
- | |||
- | __Insert mode__\\ | ||
- | Typing of text happens in this mode\\ | ||
- | These are some ways to start insert mode from command mode:\\ | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | |||
- | |||
- | __Other Commands__\\ | ||
- | -' | ||
- | -'/' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | |||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | -' | ||
- | ' | ||
- | i.e. #yl yanks # of characters to the right\\ | ||
- | -' | ||
- | -': | ||
- | -': | ||
- | |||
- | You can prefix many of these commands (i.e. with numbers for repitition)\\ | ||
- | |||
- | **EXTRA** | ||
- | |||
- | https:// | ||
- | |||
- | Difference Between :wq and :x | ||
- | |||
- | The :wq command is used in Vim to write and quit. The contents of the buffer are written to disk for the associated file and then the Vim session is terminated. So, what is the difference between this and the :x command. The Vim help files give the following description of the :x command: | ||
- | |||
- | Like “:wq”, but write only when changes have been made. | ||
- | |||
- | So, :wq writes the buffer to disk either way, whereas :x just exits if the buffer hasn’t changed. Either way the contents of the resulting file are going to be the same. So what’s the difference? | ||
- | |||
- | Modification time. | ||
- | |||
- | If you :x a buffer that hasn’t changed, the modification time will be untouched because the file isn’t re-saved. The :wq command will alter the modification time no matter what. | ||
- | |||
- | This matters if the modification time is used by anything. For instance, a background process that monitors a directory for changed files based on modification times will get some false positives if you use :wq too liberally. | ||
- | |||
- | ======Login Problems====== | ||
- | Some people have reported problems logging into the wiki. There seems to be a few sources of problems experienced: | ||
- | |||
- | * User cannot log in. | ||
- | * User cannot log in using " | ||
- | * Attempting to connect over **http** versus **https** (ALWAYS USE **https**!!!) | ||
- | |||
- | If you are confident you are using the correct username and password, and are using a version of Internet Explorer, it is suggested that you use a different browser, such as Firefox, Safari, or Chrome. | ||
- | |||
- | If the " | ||
- | |||
- | * Uncheck "Use Secure Login" | ||
- | * Change your password to something that doesn' | ||
- | |||
- | ======Syntax====== | ||
- | For those unfamiliar, here is a page on [[wiki: | ||
- | |||
- | ======Course Notes Wiki====== | ||
- | This is a space for members of the UNIX/Linux Fundamentals class to create a source of information reflective and assisting to the course. | ||
- | |||
- | Aside from assignments that may have you specifically perform operations here, you should contribute when you encounter any of the following: | ||
- | |||
- | * Some neat bit of information related to the class | ||
- | * Some clarification or understanding you've had with respect to concepts in the class | ||
- | * Organizational/ | ||
- | * Questions you have that may deserve a more visual answer | ||
- | |||
- | =====DokuWiki wrap plugin===== | ||
- | http:// |