2 title: Command line stuff
11 | Switch | Description |
13 | `-1` | One entry per line |
15 | `-o` | Long view (without groups) |
16 | `-C` | Multicolumn (sorted horizontally) |
17 | `-x` | Multicolumn (sorted vertically) |
19 | `-F` | Add / after directories |
26 | `-a` | Include hidden (dotfiles) |
27 | `-A` | Include hidden (but not . and ..) |
32 | Switch | Description |
34 | `-r` | reverse order |
35 | `-S` | sort by size |
36 | `-t` | sort by time modified |
37 | `-u` | sort by time accessed |
38 | `-U` | sort by time created |
39 | `-c` | sort by time status was changed |
41 | `-h` | Human-readable size (3k) |
48 tail [-F | -f | -r] [-bN | -cN | -nN] [file ...]
53 | `-F` | follow by filename (accounts for log rotation) |
54 | `-r` | Reverse order |
59 | `-bN` | N*512 bytes |
62 | `+N` | Start from line N |
70 sudo [options] <command>
75 | `-l` | List allowed commands |
80 | `-A` | Use $SUDO_ASKPASS |
81 | `-b` | Run in background |
82 | `-E` | Preserve environment |
83 | `-H` | use target's $HOME |
84 | `-n` | Don't prompt for password |
85 | `-P` | Preserve group vector |
86 | `-S` | Read password from stdin |
91 | `-C fd` | Close all open file descriptors |
96 | `-p prompt` | Custom prompt (-p "%p password:") |
101 | Switch | Description |
103 | `-i [cmd]` | Interactive shell without variables |
104 | `-s [cmd]` | Interactive shell |
106 | `-u user` | run as this user |
107 | `-g group` | run as this group |
112 | `-v` | revalidate timestamp for 5 mins |
113 | `-k` | invalidate timestamp |
114 | `-K` | just like -k |
127 | `-m` | Characters (incl multi-byte) |
133 ## Search-and-replace in all files
135 perl -p -i -e 's/hello/HELLO/g' **/*
142 grep [options] [pattern] [file ...]
147 | Switch | Description |
149 | `-A num` | Print `num` lines of training context |
151 | `-G` | --basic-regexp (default) |
152 | `-E` | --extended-regexp |
153 | `-P` | --perl-regexp |
155 | `-f file` | --file (Get patterns for file) |
156 | `-F` | --fixed-strings |
158 | `-h` | --no-filename |
159 | `-H` | --with-filename |
161 | `-l` | --files-with-matches (just print filenames) |
162 | `-L` | --files-without-match |
164 | `-r, -R` | --recursive |
165 | `-v` | --invert-match |
166 | `-i` | --ignore-case |