textile Flutter App小工具树

notes.md
# Notes

App
└── ContactsProvider
    └── MaterialApp
        └── {Routes}
            ├── HomeScreen
            │   └── Scaffold
            │       ├── AppBar
            │       ├── ListView
            │       │   └── ContactListItem
            │       └── FloatingActionButton
            └── AddContactScreen
                └── Scaffold
                    ├── AppBar
                    └── Form
                        ├── WordFormField
                        └── DatePickerField

textile 从Automounter中提取volume / qtree /目录名

createTuples
t = '/nfs/site/proj/memvobs.work	sitecfsv01a:/vol/proj001/p00/blavobs.work'
t1 = re.match('(/.*)\t(.*):(.*)/(.*)',t).groups()

nfs_path = t1[0]
fileserver = t1[1]
netapp_path = t1[2]
project_area = t1[3]


useful links for regex
https://regexr.com/
https://regexone.com/lesson/capturing_groups?

textile Mac终端备忘单

Mac终端备忘单

gistfile1.textile
h3. SHORTCUTS

{background:#ddd}. |_. Key/Command |_. Description |
| Tab | Auto-complete files and folder names |
| Ctrl + A | Go to the beginning of the line you are currently typing on |
| Ctrl + E | Go to the end of the line you are currently typing on |
| Ctrl + U | Clear the line before the cursor |
| Ctrl + K | Clear the line after the cursor |
| Ctrl + W | Delete the word before the cursor |
| Ctrl + T | Swap the last two characters before the cursor |
| Esc + T | Swap the last two words before the cursor |
| Ctrl + R | Lets you search through previously used commands |
| Ctrl + L or Command + K | Clears the Screen |
| Ctrl + C | Kill whatever you are running |
| Ctrl + D | Exit the current shell |


h3. CORE COMMANDS

| cd | Home directory |
| cd [folder] | Change directory |
| cd ~ | Home directory, e.g. 'cd ~/folder/' |
| cd / | Root of drive |
| ls | Short listing |
| ls -l | Long listing |
| ls -a | Listing incl. hidden files |
| ls -lh | Long listing with Human readable file sizes |
| ls -R | Entire content of folder recursively |
| sudo [command] | Run command with the security privileges of the superuser (Super User DO) |
| open [file] | Opens a file |
| open . | Opens the directory |
| top | Displays active processes. Press q to quit |
| nano [file] | Opens the Terminal it's editor |
| pico	[file] | Opens the Terminal it's editor |
| q | Exit |
| clear | Clear screen |


h3. COMMAND HISTORY

| history n | Shows the stuff typed - add a number to limit the last n items |
| ctrl-r | Interactively search through previously typed commands |
| ![value] | Execute the last command typed that starts with 'value' |
| !! | Execute the last command typed |


h3. FILE MANAGEMENT

| touch [file] | Create new file |
| pwd | Full path to working directory |
| .. | Parent/enclosing directory, e.g. |
| ls -l .. | Long listing of parent directory |
| cd ../../ | Move 2 levels up |
| . | Current folder |
| cat | Concatenate to screen |
| rm [file] | Remove a file, e.g. rm [file] [file] |
| rm -i [file] | Remove with confirmation |
| rm -r [dir] | Remove a directory and contents |
| rm -f [file] | Force removal without confirmation |
| rm -i [file] | Will display prompt before |
| cp [file] [newfile] | Copy file to file |
| cp [file] [dir] | Copy file to directory |
| mv [file] [new filename] | Move/Rename, e.g. mv -v [file] [dir] |


h3. DIRECTORY MANAGEMENT

| mkdir [dir] | Create new directory |
| mkdir -p [dir]/[dir] | Create nested directories |
| rmdir [dir] | Remove directory ( only operates on empty directories ) |
| rm -R [dir] | Remove directory and contents |
 


h3. PIPES - Allows to combine multiple commands that generate output

| more | Output content delivered in screensize chunks |
| > [file] | Push output to file, keep in mind it will get overwritten |
| >> [file] | Append output to existing file |
| < | Tell command to read content from a fi |


h3. HELP

| [command] -h | Offers help |
| [command] --help | Offers help |
| [command] help | Offers help |
| reset | Resets the terminal display |
| man [command] | Show the help for 'command' |
| whatis [command] | Gives a one-line description of 'command' |

textile Sublime Text 3 OSX的快捷方式

Sublime Text 3 OSX的快捷方式

sublime_text_3_shortcut_osx.textile
h2. Keyboard Shortcuts for Sublime Text 3- OSX

h3. Editing

| Keypress | Command |
| ⌘ + X | Delete line |
| ⌘ + ↩ | Insert line after |
| ⌘ + ⇧ + ↩ | Insert line before |
| ⌘ + ⌃ + ↑ | Move line/selection up |
| ⌘ + ⌃ + ↓ | Move line/selection down |
| ⌘ + L | elect line - Repeat to select next lines |
| ⌘ + D | Select word - Repeat select others occurrences |
| ⌃ + M | Jump to closing parentheses Repeat to jump to opening parentheses |
| ⌃ + ⇧ + M | Select all contents of the current parentheses |
| ⌘ + K, ⌘ + K | Delete from cursor to end of line |
| ⌘ + K + ⌫ | Delete from cursor to start of line |
| ⌘ + ] | Indent current line(s) |
| ⌘ + [ | Un-indent current line(s) |
| ⌘ + ⇧ + D | Duplicate line(s) |
| ⌘ + J | Join line below to the end of the current line |
| ⌘ + / | Comment/un-comment current line |
| ⌘ + ⌥ + / | Block comment current selection |
| ⌘ + Y | Redo, or repeat last keyboard shortcut command |
| ⌘ + ⇧ + V | Paste and indent correctly |
| ⌃ + Space | Select next auto-complete suggestion |
| ⌃ + U | Soft undo; jumps to your last change before undoing change when repeated |
| ⌃ + ⇧ + Up | Column selection up |
| ⌃ + ⇧ + Down | Column selection down |

h3. Navigation/Goto Anywhere

| Keypress | Command |
| ⌘ + P | Quick-open files by name |
| ⌘ + R | Goto symbol |
|   | Goto word in current file |
| ⌃ + G | Goto line in current file |

h3. General

| Keypress | Command |
| ⌘ + ⇧ + P | Command prompt |
| ⌘ + K, ⌘ + B | Toggle side bar |
| ⌃ + ⇧ + P | Show scope in status bar |

h3. Find/Replace

| Keypress | Command |
| ⌘ + F | Find |
| ⌘ + ⌥ + F | Replace |
| ⌘ + ⇧ + F | Find in files |

h3. Tabs

| Keypress | Command |
| ⌘ + ⇧ + t | Open last closed tab |
| ^ + Tab | Cycle up through tabs |
| ⇧ + ^ + Tab | Cycle down through tabs |
|	 | Find in files |
 	
h3. Split window

| Keypress | Command |
| ⌘ + ⌥ + 2 | Split view into two columns |
| ⌘ + ⌥ + 1 | Revert view to single column |
| ⌘ + ⌥ + 5 | Set view to grid (4 groups) |
| ⌃ + [NUM] | Jump to group where num is 1-4 |
| ⌃ + ⇧ + [NUM] | Move file to specified group where num is 1-4 |

h3. Bookmarks

| Keypress | Command |
| ⌘ + F2 | Toggle bookmark |
| F2	Next | bookmark |
| ⇧ + F2 | Previous bookmark |
| ⇧ + ⌘ + F2 | Clear bookmarks |

h3. Text manipulation

| Keypress | Command |
| ⌘ + K, ⌘ + U | Transform to Uppercase |
| ⌘ + K, ⌘ + L | Transform to Lowercase |

textile Ruby on Rails最佳实践

Ruby on Rails最佳实践

gistfile1.textile
h1. Ruby on Rails best practices


h2. Code style

* Use UTF-8. It's 21 century, 8bit encodings dead now.
* Use 2 space indent, not tabs
* Use Unix-style line endings
* Keep lines not longer than 80 chars
* Remove trailing whitespace

h2. Development process

* Think
* Describe
* Write tests
* Implement & go green
* Rethink
* Refactor

h2. MVC

* Follow MVC conventions
* Do not ever mix logics: no model/view logic in controller, no view logic in model & etc.
* Follow "Fat model, skinny controllers" methodology
* If you have different data representation, use format aliases (e.g. different html views for same data: /users/:id.iphone)

h3. Controllers

* Keep it simple and clean
* Keep ApplicationController clean. Commonly it should be used only for global filters and per-request logic (e.g locale configuration and access control)
* Keep in mind that all @ApplicationController@ filters will be executed in each request and optimize it to be ultra-fast
* Controllers should operate with abstract logic. Keep this logic simple and understandable without detailed review. E.g:

<pre><code class="ruby"># Disgusting
  Account.transaction do
    transfer = @sender.orders.new(:action => :transfer, :receiver => @receiver, :ammount)
    
    if @sender.assets >= amount
      @sender.assets -= amount
      @receiver.assets += amount
    else
      flash[:error] = "Balance not enough to transfer funds"
      success = false
    end
    
    if @sender.save! and @receiver.save! and transfer.save!
      flash[:info] = "You have transferred #{ammount} to #{@receiver.last_name + "" + @receiver.first_name}"
      success = true
    else
      errors = ...
    end
  end
  
  if !success
    respond_to ...
  else
    respond_to ...
  end
</code></pre>
<pre><code class="ruby"># Much better, but not quite abstract
  Account.transaction do
    @sender.withdraw amount
    @receiver.deposit amount
  end

  if @sender.errors? or @receiver.errors?
    respond_to ...
  else
    respond_to ...
  end
</code></pre>
<pre><code class="ruby"># Best way
  if @sender.transfer!(amount, :to => @receiver)
    respond_to ...
  else
    respond_to 
  end
</code></pre>  

* View interaction in controllers always should be placed in @respond_to@ method or in responders (for Rails 3)
* Do not place any logic in @respond_to@ method
* Prefer :except in filters. E.g.: @before_filter :authorize!, :except => [:index]@ to be sure that new actions will be covered by filter by default
* Follow REST convention: Commonly one controller should only operate one resource.
* Follow REST convention naming. E.g.: @UsersController@ should operate only users. Groups operations should be placed in @GroupsController@
* Follow HTTP methods conventions in REST actions: @DELETE@ for destructive action, @PUT@ for update, @POST@ to create, @GET@ to read
* Use nested resources when needed. E.g: @map.resource :users {|user| user.resource :groups }@ instead of groups @action@ in @UsersController@
* Avoid deep nesting where it's not necessary. E.g: Not @/places/:place_id/events/:event_id/users@ but @/events/:event_id/users@

h3. Models

* Keep it simple and clean
* Model, method and variable names should be obvious
* Do not use shortcuts and avoid non widely used abbreviation for model names. (e.g UsrHst or UserHist should be UserHistory)
* Don't repeat yourself
* Don't repeat rails. Zero custom code that duplicates rails built-in functionality
* If you use find with similar condition in more than once — use @named_scope@
* If you use same code in more than one model turn it into module/library
* Prefer XML Builder over to_xml overrides

h3. Views

* Views is for presentation. DO NOT EVER CHANGE STATE OF ANYTHING IN VIEW
* Keep views simple
* Move complex logic to helpers
* Move HTML markup generation to helpers
* Do not use finders in views
* DRY. Use partials, but keep in mind that partials can be really slow
* Keep HTML markup semantic an clean
* Do not inline any Javascript code. It should be unobtrusive

h2. Tests

* Follow Test Driven Development methodology: write tests, then code
* Keep tests simple and easy understandable
* Test everything what should be tested. If something can be broken: try to broke it by test
* Do not test rails built-in methods, test method usage

h2. Comments and documentation

* Respect other developers: use only English
* rdoc your friend, not enemy. Let application be self-documented
* More is better than less: it's better to excess, than hold back

textile Sublime Text 2 - 有用的快捷方式

Sublime Text 2 - 有用的快捷方式

gistfile1.textile
h1. Sublime Text 2 - Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.

h2. Editing

| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |
| *Ctrl+⇧+↩* | insert line before |
| *Ctrl+⇧+↑* | move line (or selection) up |
| *Ctrl+L* | select line (repeat to select next lines) |
| *Ctrl+D* | select word (repeat select others occurrences in context for multiple editing) |
| *Ctrl+M* | jump to closing bracket for current code, repeat to jump to opening bracket |
| *Ctrl+⇧+M* | select all contents of the current brackets (curly brackets, square brackets, parentheses) |
| *Ctrl+KK* | delete from cursor to end of line |
| *Ctrl+K+⌫* | delete from cursor to start of line |
| *Ctrl+]* | indent current line(s) |
| *Ctrl+[* | un-indent current line(s) |
| *Ctrl+⇧+D* | duplicate line(s) |
| *Ctrl+J* | join line below to the end of the current line |
| *Ctrl+ /* | comment/un-comment current line |
| *Ctrl+⇧+/* | block comment current selection |
| *Ctrl+Y* | redo, or repeat last keyboard shortcut command |
| *Ctrl+⇧+V* | paste and indent correctly |
| *Ctrl+Space* | select next auto-complete suggestion |
| *Ctrl+U* | soft undo (somehow undoes your movements; it jumps to your last change before undoing it when you repeat this command) |

h2. Navigation/Goto Anywhere

| *Ctrl+P* | quick-open files by name in your project (doesn't seem to need an actual project set up, it just searches in the directories around the currently-opened file |
| *Ctrl+R* | goto symbol (functions and classes) in the file. Same as *Ctrl+P*, then type *@*|
| *Ctrl+;* | goto word in current file. Same as *Ctrl+P*, then type *#*|
| *Ctrl+G* | goto line in current file. Same as *Ctrl+P*, then type *:*|

h2. General

| *Ctrl+⇧+P* | command prompt |
| *Ctrl+KB* | toggle side bar |

h2. Find/Replace

| *Ctrl+F* | find |
| *Ctrl+H* | replace |
| *Ctrl+⇧+F* | find in files |

h2. Tabs

| *Ctrl+⇧+t* | open last closed tab (just like in your browser) |
| *Ctrl+PgDn*| cycle down through open tabs, cycle up with Ctrl+PgUp |
| *Ctrl+⇆* | cycle through last tabs (repeat to go back further in history) |

h2. Split window

| *Alt+⇧+2* | split into two columns |
| *Alt+⇧+1* | revert to single column |
| *Alt+⇧+5* | grid (4 groups) |
| *Ctrl+[1,2,3,4]* | jump to "group" (pane) |
| *Ctrl+⇧+[1,2,3,4]* | move file to specified group |

h2. Bookmarks

| *Ctrl+F2* | toggle bookmark |
| *F2* | next bookmark |
| *⇧+F2* | previous bookmark |
| *Ctrl+⇧+F2* | clear bookmarks |

h2. Text manipulation

| *Ctrl+KU* | upper case |
| *Ctrl+KL* | lower case |

textile Sublime Text 2 - 有用的快捷方式

Sublime Text 2 - 有用的快捷方式

gistfile1.textile
h1. Sublime Text 2 - Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.

h2. Editing

| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |
| *Ctrl+⇧+↩* | insert line before |
| *Ctrl+⇧+↑* | move line (or selection) up |
| *Ctrl+L* | select line (repeat to select next lines) |
| *Ctrl+D* | select word (repeat select others occurrences in context for multiple editing) |
| *Ctrl+M* | jump to closing bracket for current code, repeat to jump to opening bracket |
| *Ctrl+⇧+M* | select all contents of the current brackets (curly brackets, square brackets, parentheses) |
| *Ctrl+KK* | delete from cursor to end of line |
| *Ctrl+K+⌫* | delete from cursor to start of line |
| *Ctrl+]* | indent current line(s) |
| *Ctrl+[* | un-indent current line(s) |
| *Ctrl+⇧+D* | duplicate line(s) |
| *Ctrl+J* | join line below to the end of the current line |
| *Ctrl+ /* | comment/un-comment current line |
| *Ctrl+⇧+/* | block comment current selection |
| *Ctrl+Y* | redo, or repeat last keyboard shortcut command |
| *Ctrl+⇧+V* | paste and indent correctly |
| *Ctrl+Space* | select next auto-complete suggestion |
| *Ctrl+U* | soft undo (somehow undoes your movements; it jumps to your last change before undoing it when you repeat this command) |

h2. Navigation/Goto Anywhere

| *Ctrl+P* | quick-open files by name in your project (doesn't seem to need an actual project set up, it just searches in the directories around the currently-opened file |
| *Ctrl+R* | goto symbol (functions and classes) in the file. Same as *Ctrl+P*, then type *@*|
| *Ctrl+;* | goto word in current file. Same as *Ctrl+P*, then type *#*|
| *Ctrl+G* | goto line in current file. Same as *Ctrl+P*, then type *:*|

h2. General

| *Ctrl+⇧+P* | command prompt |
| *Ctrl+KB* | toggle side bar |

h2. Find/Replace

| *Ctrl+F* | find |
| *Ctrl+H* | replace |
| *Ctrl+⇧+F* | find in files |

h2. Tabs

| *Ctrl+⇧+t* | open last closed tab (just like in your browser) |
| *Ctrl+PgDn*| cycle down through open tabs, cycle up with Ctrl+PgUp |
| *Ctrl+⇆* | cycle through last tabs (repeat to go back further in history) |

h2. Split window

| *Alt+⇧+2* | split into two columns |
| *Alt+⇧+1* | revert to single column |
| *Alt+⇧+5* | grid (4 groups) |
| *Ctrl+[1,2,3,4]* | jump to "group" (pane) |
| *Ctrl+⇧+[1,2,3,4]* | move file to specified group |

h2. Bookmarks

| *Ctrl+F2* | toggle bookmark |
| *F2* | next bookmark |
| *⇧+F2* | previous bookmark |
| *Ctrl+⇧+F2* | clear bookmarks |

h2. Text manipulation

| *Ctrl+KU* | upper case |
| *Ctrl+KL* | lower case |

textile Sublime Text 2 - 有用的快捷方式

Sublime Text 2 - 有用的快捷方式

gistfile1.textile
h1. Sublime Text 2 - Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.

h2. Editing

| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |
| *Ctrl+⇧+↩* | insert line before |
| *Ctrl+⇧+↑* | move line (or selection) up |
| *Ctrl+L* | select line (repeat to select next lines) |
| *Ctrl+D* | select word (repeat select others occurrences in context for multiple editing) |
| *Ctrl+M* | jump to closing bracket for current code, repeat to jump to opening bracket |
| *Ctrl+⇧+M* | select all contents of the current brackets (curly brackets, square brackets, parentheses) |
| *Ctrl+KK* | delete from cursor to end of line |
| *Ctrl+K+⌫* | delete from cursor to start of line |
| *Ctrl+]* | indent current line(s) |
| *Ctrl+[* | un-indent current line(s) |
| *Ctrl+⇧+D* | duplicate line(s) |
| *Ctrl+J* | join line below to the end of the current line |
| *Ctrl+ /* | comment/un-comment current line |
| *Ctrl+⇧+/* | block comment current selection |
| *Ctrl+Y* | redo, or repeat last keyboard shortcut command |
| *Ctrl+⇧+V* | paste and indent correctly |
| *Ctrl+Space* | select next auto-complete suggestion |
| *Ctrl+U* | soft undo (somehow undoes your movements; it jumps to your last change before undoing it when you repeat this command) |

h2. Navigation/Goto Anywhere

| *Ctrl+P* | quick-open files by name in your project (doesn't seem to need an actual project set up, it just searches in the directories around the currently-opened file |
| *Ctrl+R* | goto symbol (functions and classes) in the file. Same as *Ctrl+P*, then type *@*|
| *Ctrl+;* | goto word in current file. Same as *Ctrl+P*, then type *#*|
| *Ctrl+G* | goto line in current file. Same as *Ctrl+P*, then type *:*|

h2. General

| *Ctrl+⇧+P* | command prompt |
| *Ctrl+KB* | toggle side bar |

h2. Find/Replace

| *Ctrl+F* | find |
| *Ctrl+H* | replace |
| *Ctrl+⇧+F* | find in files |

h2. Tabs

| *Ctrl+⇧+t* | open last closed tab (just like in your browser) |
| *Ctrl+PgDn*| cycle down through open tabs, cycle up with Ctrl+PgUp |
| *Ctrl+⇆* | cycle through last tabs (repeat to go back further in history) |

h2. Split window

| *Alt+⇧+2* | split into two columns |
| *Alt+⇧+1* | revert to single column |
| *Alt+⇧+5* | grid (4 groups) |
| *Ctrl+[1,2,3,4]* | jump to "group" (pane) |
| *Ctrl+⇧+[1,2,3,4]* | move file to specified group |

h2. Bookmarks

| *Ctrl+F2* | toggle bookmark |
| *F2* | next bookmark |
| *⇧+F2* | previous bookmark |
| *Ctrl+⇧+F2* | clear bookmarks |

h2. Text manipulation

| *Ctrl+KU* | upper case |
| *Ctrl+KL* | lower case |

textile Mac终端备忘单

Mac终端备忘单

gistfile1.textile
h3. SHORTCUTS

{background:#ddd}. |_. Key/Command |_. Description |
| Tab | Auto-complete files and folder names |
| Ctrl + A | Go to the beginning of the line you are currently typing on |
| Ctrl + E | Go to the end of the line you are currently typing on |
| Ctrl + U | Clear the line before the cursor |
| Ctrl + K | Clear the line after the cursor |
| Ctrl + W | Delete the word before the cursor |
| Ctrl + T | Swap the last two characters before the cursor |
| Esc + T | Swap the last two words before the cursor |
| Ctrl + R | Lets you search through previously used commands |
| Ctrl + L or Command + K | Clears the Screen |
| Ctrl + C | Kill whatever you are running |
| Ctrl + D | Exit the current shell |


h3. CORE COMMANDS

| cd | Home directory |
| cd [folder] | Change directory |
| cd ~ | Home directory, e.g. 'cd ~/folder/' |
| cd / | Root of drive |
| ls | Short listing |
| ls -l | Long listing |
| ls -a | Listing incl. hidden files |
| ls -lh | Long listing with Human readable file sizes |
| ls -R | Entire content of folder recursively |
| sudo [command] | Run command with the security privileges of the superuser (Super User DO) |
| open [file] | Opens a file |
| open . | Opens the directory |
| top | Displays active processes. Press q to quit |
| nano [file] | Opens the Terminal it's editor |
| pico	[file] | Opens the Terminal it's editor |
| q | Exit |
| clear | Clear screen |


h3. COMMAND HISTORY

| history n | Shows the stuff typed - add a number to limit the last n items |
| ctrl-r | Interactively search through previously typed commands |
| ![value] | Execute the last command typed that starts with 'value' |
| !! | Execute the last command typed |


h3. FILE MANAGEMENT

| touch [file] | Create new file |
| pwd | Full path to working directory |
| .. | Parent/enclosing directory, e.g. |
| ls -l .. | Long listing of parent directory |
| cd ../../ | Move 2 levels up |
| . | Current folder |
| cat | Concatenate to screen |
| rm [file] | Remove a file, e.g. rm [file] [file] |
| rm -i [file] | Remove with confirmation |
| rm -r [dir] | Remove a directory and contents |
| rm -f [file] | Force removal without confirmation |
| rm -i [file] | Will display prompt before |
| cp [file] [newfile] | Copy file to file |
| cp [file] [dir] | Copy file to directory |
| mv [file] [new filename] | Move/Rename, e.g. mv -v [file] [dir] |


h3. DIRECTORY MANAGEMENT

| mkdir [dir] | Create new directory |
| mkdir -p [dir]/[dir] | Create nested directories |
| rmdir [dir] | Remove directory ( only operates on empty directories ) |
| rm -R [dir] | Remove directory and contents |
 


h3. PIPES - Allows to combine multiple commands that generate output

| more | Output content delivered in screensize chunks |
| > [file] | Push output to file, keep in mind it will get overwritten |
| >> [file] | Append output to existing file |
| < | Tell command to read content from a fi |


h3. HELP

| [command] -h | Offers help |
| [command] --help | Offers help |
| [command] help | Offers help |
| reset | Resets the terminal display |
| man [command] | Show the help for 'command' |
| whatis [command] | Gives a one-line description of 'command' |

textile Mac终端备忘单

Mac终端备忘单

gistfile1.textile
h3. SHORTCUTS

{background:#ddd}. |_. Key/Command |_. Description |
| Tab | Auto-complete files and folder names |
| Ctrl + A | Go to the beginning of the line you are currently typing on |
| Ctrl + E | Go to the end of the line you are currently typing on |
| Ctrl + U | Clear the line before the cursor |
| Ctrl + K | Clear the line after the cursor |
| Ctrl + W | Delete the word before the cursor |
| Ctrl + T | Swap the last two characters before the cursor |
| Esc + T | Swap the last two words before the cursor |
| Ctrl + R | Lets you search through previously used commands |
| Ctrl + L or Command + K | Clears the Screen |
| Ctrl + C | Kill whatever you are running |
| Ctrl + D | Exit the current shell |


h3. CORE COMMANDS

| cd | Home directory |
| cd [folder] | Change directory |
| cd ~ | Home directory, e.g. 'cd ~/folder/' |
| cd / | Root of drive |
| ls | Short listing |
| ls -l | Long listing |
| ls -a | Listing incl. hidden files |
| ls -lh | Long listing with Human readable file sizes |
| ls -R | Entire content of folder recursively |
| sudo [command] | Run command with the security privileges of the superuser (Super User DO) |
| open [file] | Opens a file |
| open . | Opens the directory |
| top | Displays active processes. Press q to quit |
| nano [file] | Opens the Terminal it's editor |
| pico	[file] | Opens the Terminal it's editor |
| q | Exit |
| clear | Clear screen |


h3. COMMAND HISTORY

| history n | Shows the stuff typed - add a number to limit the last n items |
| ctrl-r | Interactively search through previously typed commands |
| ![value] | Execute the last command typed that starts with 'value' |
| !! | Execute the last command typed |


h3. FILE MANAGEMENT

| touch [file] | Create new file |
| pwd | Full path to working directory |
| .. | Parent/enclosing directory, e.g. |
| ls -l .. | Long listing of parent directory |
| cd ../../ | Move 2 levels up |
| . | Current folder |
| cat | Concatenate to screen |
| rm [file] | Remove a file, e.g. rm [file] [file] |
| rm -i [file] | Remove with confirmation |
| rm -r [dir] | Remove a directory and contents |
| rm -f [file] | Force removal without confirmation |
| rm -i [file] | Will display prompt before |
| cp [file] [newfile] | Copy file to file |
| cp [file] [dir] | Copy file to directory |
| mv [file] [new filename] | Move/Rename, e.g. mv -v [file] [dir] |


h3. DIRECTORY MANAGEMENT

| mkdir [dir] | Create new directory |
| mkdir -p [dir]/[dir] | Create nested directories |
| rmdir [dir] | Remove directory ( only operates on empty directories ) |
| rm -R [dir] | Remove directory and contents |
 


h3. PIPES - Allows to combine multiple commands that generate output

| more | Output content delivered in screensize chunks |
| > [file] | Push output to file, keep in mind it will get overwritten |
| >> [file] | Append output to existing file |
| < | Tell command to read content from a fi |


h3. HELP

| [command] -h | Offers help |
| [command] --help | Offers help |
| [command] help | Offers help |
| reset | Resets the terminal display |
| man [command] | Show the help for 'command' |
| whatis [command] | Gives a one-line description of 'command' |