OSDN Git Service

Regular updates
[twpd/master.git] / command_line.md
index 36cba17..b2d8296 100644 (file)
@@ -1,8 +1,12 @@
 ---
 title: Command line stuff
+layout: 2017/sheet
 ---
 
 ## List (ls)
+{: .-three-column}
+
+### Usage
 
     ls [options] [paths]
 
@@ -18,14 +22,12 @@ title: Command line stuff
 |---
 | `-F` | Add / after directories |
 | `-G` | Color |
-{:.shortcuts}
 
 ### Options
 
 | `-R` | Recurse |
 | `-a` | Include hidden (dotfiles) |
 | `-A` | Include hidden (but not . and ..) |
-{:.shortcuts}
 
 ### Sorting
 
@@ -39,11 +41,11 @@ title: Command line stuff
 | `-c` | sort by time status was changed |
 |---
 | `-h` | Human-readable size (3k) |
-{:.shortcuts}
-
-<br>
 
 ## Tail
+{: .-three-column}
+
+### Usage
 
     tail [-F | -f | -r] [-bN | -cN | -nN] [file ...]
 
@@ -52,7 +54,6 @@ title: Command line stuff
 | `-f` | follow |
 | `-F` | follow by filename (accounts for log rotation) |
 | `-r` | Reverse order |
-{:.shortcuts}
 
 ### Options
 
@@ -60,11 +61,13 @@ title: Command line stuff
 | `-cN` | N bytes |
 | `-nN` | N lines |
 | `+N`  | Start from line N |
-{:.shortcuts}
 
 <br>
 
 ## Sudo
+{: .-three-column}
+
+### Usage
 
 ```
 sudo [options] <command>
@@ -73,7 +76,6 @@ sudo [options] <command>
 ### Listing
 
 | `-l` | List allowed commands |
-{:.shortcuts}
 
 ### Options
 
@@ -84,17 +86,14 @@ sudo [options] <command>
 | `-n` | Don't prompt for password |
 | `-P` | Preserve group vector |
 | `-S` | Read password from stdin |
-{:.shortcuts}
 
 ### File descriptors
 
 | `-C fd` | Close all open file descriptors |
-{:.shortcuts}
 
 ### Prompt
 
 | `-p prompt` | Custom prompt (-p "%p password:") |
-{:.shortcuts}
 
 ### Interactive
 
@@ -105,38 +104,33 @@ sudo [options] <command>
 |----
 | `-u user` | run as this user |
 | `-g group` | run as this group |
-{:.shortcuts}
 
 ### Timestamp
 
 | `-v` | revalidate timestamp for 5 mins |
 | `-k` | invalidate timestamp |
 | `-K` | just like -k |
-{:.shortcuts}
-
-<br>
 
 ## wc (Word count)
+{: .-three-column}
+
+### wc
 
 ```
 ... | wc [options]
 ```
 
+### Options
+
 | `-c` | Bytes |
 | `-l` | Lines |
 | `-m` | Characters (incl multi-byte) |
 | `-w` | Words |
-{:.shortcuts}
-
-<br>
-
-## Search-and-replace in all files
-
-    perl -p -i -e 's/hello/HELLO/g' **/*
-
-<br>
 
 ## Grep
+{: .-three-column}
+
+### Usage
 
 ```
 grep [options] [pattern] [file ...]
@@ -164,9 +158,15 @@ grep [options] [pattern] [file ...]
 | `-r, -R` | --recursive |
 | `-v` | --invert-match |
 | `-i` | --ignore-case |
-{:.shortcuts}
 
 ### Synonyms
 
     egrep  =>  grep -E
     fgrep  =>  grep -F
+
+## Other recipes
+{: .-three-column}
+
+### Search-and-replace in all files
+
+    perl -p -i -e 's/hello/HELLO/g' **/*