User Tools

Site Tools


notes:unix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:unix [2018/11/14 21:03] – [Notes] sdiarranotes:unix [2020/11/04 23:50] (current) – Changed hyperlink to secure variant smalik3
Line 5: Line 5:
 </WRAP> </WRAP>
  
-======Projects======+======Course Notes======
  
-======URLs======+The "man" command can be used on Linux to display the manual of an inputted command. To use this command type "man" followed by a space and then a Linux command. 
 +Example: <code>man cd</code> 
 +This will display the manual for the Linux command "cd". This is very useful for starting off understanding Linux commands. And when in more doubt [[https://www.google.com|Google]] or asking questions to your professor is the answer.
  
-======Notes====== +----------------------------------
-------- +
-I feel like there should be some beautiful words of knowledge contained on this page, so I have decided to do my best attempt at making it that way. +
  
-===Vim/Vi Command Mode Commands===+The "cd" command is useful for going into directories or folders. 
 +Example: <code>cd</code> 
 +After using "cd" you add the option if which directory/folder you want to go into. Such as "cd familyphotos", you can even get to directories not close to the one you're in like "cd ~/games/somegame/unrelated".
  
-Escape key leads to command mode. +----------------------------------
  
-- 'i' leads to insert mode at the current space+The "mkdir" command is useful for creating folders
-  +Example: <code>mkdir</code> 
-- Navigation is accomplished through h (right), j (down), k (up), l (left).+After using "mkdir" you add the name of the folder. For example "mkdir folder" will create a folder named "folder" in whatever directory you are in. You can also use full paths like "mkdir ~/classes/unix" to create a folder that may not be in the same directory as you.
  
-- 'a' leads to insertion mode at the next space.  
- 
-- 'I' leads to insert mode at the beginning of the line. 
- 
-- 'A' leads to insert mode at the end of the line. 
- 
-- 'o' leads to insert mode on a new line after the current line. 
- 
-- 'O' leads to insert mode on a new line before the current line. 
- 
-- 'w' is move forward a word (stop not just at spaces, but also / . , ? and more). 
- 
-- 'b' is move back a word (same as above).  
- 
-- 'W' and 'B' move forward and backward a word (only stop at spaces). 
- 
-- '.' repeats the last command. 
- 
-- '^' and '$' take you to the beginning and end of lines respectively without going into insert mode.  
- 
-- '{' and '}' take you to the previous and next paragraphs. [Side Note: many of these commands can be prefixed  
-with a number, which means you want the command to be executed that many times]. 
- 
-- 'x' deletes the next character. 
- 
-- 'X' is cutting (acts like backspace). 
- 
-- You can also do commands like dw, db, d^, d$, d{, d}, dd which do a delete operation related to the letter after the 'd' (dd deletes the current line). 
- 
-- 'v' allows you to highlight text by moving around with the arrow keys. 
- 
-- 'y' is yank (essentially just 'copy'). There must be text highlighted for this to work.  
- 
-- 'p' pastes below and 'P' pastes above. 
- 
-------- 
-<color #ed1c24>Regular expressions</color>  
- 
-In a sort of a related note, as vi uses some regular expressions patterns, this section will cover regular expressions and pattern matching. In Unix regular expressions are used to give a user/admin the capability to search based on patterns. Regular expressions, or regex, or regexp is a very useful tool. The common patterns are the followings: 
- 
-- '.' --> indicates match every characters 
- 
-- '^' --> match the beginning of a string or file(As in Vi)  
- 
-- '$' --> match the end of a line of file(As in Vi) 
- 
-- '[a-zA-Z]' --> match all letters uppercase and lowercase  
- 
-- '[0-9]' --> match only digits from 0-9  
- 
-- '[0-9]*' --> match 0 or more digits  
- 
-- '[0-9]+' --> match 1 or more digits  
- 
-- '[a-d]?' --> match 0 or only one occurrence of a-d lowercase  
- 
-- '[0-9]{x, y}' --> match digits at least x times, and less than y times 
- 
-*These are few common patterns in regex. 
-======Other====== 
notes/unix.txt · Last modified: 2020/11/04 23:50 by smalik3