You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Changing format and some examples in the the reference file
* Adding new hyphen for file reference.md
* Remove third-person s in all lines
* Small typo in file file reference.md
* Update learners/reference.md
Co-authored-by: Kaitlin Newson <[email protected]>
* Update learners/reference.md
* Update reference.md
**`>>`** redirect output by appending to the filename specified. Syntax with `cat`: `cat FILENAME1 FILENAME2 >> NEWFILENAME`
49
+
**`>>`**- redirect output by appending to the filename specified. Syntax with `cat`: `cat FILENAME1 FILENAME2 >> NEWFILENAME`
52
50
53
-
**`rm`** remove a file or files. NB: *USE WITH EXTREME CAUTION!!!*
51
+
**`rm`**- remove a file or files. NB: *USE WITH EXTREME CAUTION!!!*
54
52
55
-
**`rmdir -r`** will delete a directory, even if it is not empty.
53
+
-`rm -ri` - delete a directory, even if it is not empty, but will ask you to confirm each deletion
56
54
57
-
**`rm -ri`**will delete a directory, even if it is not empty, but will ask you to confirm each deletion.
55
+
**`rmdir -r`**- delete a directory, even if it is not empty
58
56
59
-
**`touch`**will update timestamp information on files, or create a file or files if they don't exist.
57
+
**`touch`**- update timestamp information on files, or create a file or files if they don't exist
60
58
61
59
***
62
60
63
61
### Shell: Wildcards
64
62
65
-
**`?`** a placeholder for one character or number
63
+
**`?`**- a placeholder for one character or number
66
64
67
-
**`*`** a placeholder for zero or more characters or numbers
65
+
**`*`**- a placeholder for zero or more characters or numbers
68
66
69
-
**`[]`**defines a class of characters
67
+
**`[]`**- define a class of characters
70
68
71
69
*Examples*
72
70
73
-
-`foobar?`: matches 7-character strings starting with `foobar` and ending with one character or number
74
-
-`foobar*`: matches strings that start with `foobar` and end with zero or more other characters or numbers
75
-
-`foobar*txt`: matches strings that start with `foobar` and end with `txt`
76
-
-`[1-9]foobar?`: matches 8-character strings that start that start with a number, have `foobar` after the number, and end with any character or number.
71
+
-`foobar?` - match 7-character strings starting with `foobar` and ending with one character or number
72
+
-`foobar*` - match strings that start with `foobar` and end with zero or more other characters or numbers
73
+
-`foobar*txt` - match strings that start with `foobar` and end with `txt`
74
+
-`[1-9]foobar?` - match 8-character strings that start that start with a number, have `foobar` after the number, and end with any character or number
77
75
78
76
***
79
77
80
78
### Shell: Counting and Mining
81
79
82
-
**`wc`** word count
80
+
**`wc`** - word count
81
+
82
+
-`wc -w` - count words
83
+
-`wc -l` - count lines
84
+
-`wc -c` - count characters
85
+
86
+
**`sort`** - sort input (alphabetic sorting)
83
87
84
-
-`-w`: count words
85
-
-`-l`: count lines
86
-
-`-c`: count characters
88
+
-`sort -n` - sort input numerically
87
89
88
-
**sort**sort input
90
+
**`grep`**- global regular expression print
89
91
90
-
**`grep`** global regular expression print
92
+
-`grep -c` - display counts of matches for each file
93
+
-`grep -i` - match with case insensitivity
94
+
-`grep -w` - match whole words
95
+
-`grep -v` - exclude match
96
+
-`grep --file=FILENAME.txt` - use the file `FILENAME.txt` as the source of strings used in query
91
97
92
-
-`-c`: displays counts of matches for each file
93
-
-`-i`: match with case insensitivity
94
-
-`-w`: match whole words
95
-
-`-v`: exclude match
96
-
-`--file=FILENAME.txt`: use the file `FILENAME.txt` as the source of strings used in query
97
-
-`|`: (vertical bar character) send output from one command into another command
98
+
**`|`** - (vertical bar character) send output from one command into another command.
99
+
Example: `wc -l *.txt | sort -n`
98
100
99
101
***
100
102
101
103
### Shell: Working with Free Text
102
104
103
-
**`sed`** is used to modify files, use `-e` flag to run multiple commands
105
+
**`sed`** - is used to modify files
106
+
-`sed -e` - run multiple commands
104
107
105
-
**`tr`** translates or deletes characters in a file
108
+
**`tr`**- translates or deletes characters in a file. Some allowed sequences:
106
109
107
-
-`[:punct:]`: punctuation characters
108
-
-`[:upper:]`: upper-case characters
109
-
-`[:lower:]`: lower-case alphabetic characters
110
+
-`[:punct:]` - punctuation characters
111
+
-`[:upper:]` - upper-case characters
112
+
-`[:lower:]` - lower-case alphabetic characters
110
113
111
-
**`'''\n`** translates every blank space into `\n`, then renders on a new line
114
+
Example: `tr '''\n` - translate every blank space into `\n`, then renders on a new line
112
115
113
-
**`uniq`** reports or filters repeated lines in a file, use with `-c` to do a word count of the duplicates
116
+
**`uniq`** - report or filters repeated lines in a file
0 commit comments