Skip to content

Commit ebe4937

Browse files
authored
Format ref page#246 (#287)
* 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
1 parent a27e024 commit ebe4937

File tree

1 file changed

+49
-45
lines changed

1 file changed

+49
-45
lines changed

learners/reference.md

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ title: Reference
1212

1313
**`man`** - display the user manual
1414

15-
**`history`** - displays the history list with line numbers, use `n` to limit the list
15+
**`history`** - display the history list with line numbers, use `n` to limit the list
1616

1717
**`ls`** - list contents of a directory
1818

@@ -22,94 +22,98 @@ title: Reference
2222
- `ls -a` - list all files, including hidden files
2323
- `ls *.txt` - list all files that end with `.txt`
2424

25-
**`cd`** change directory
25+
**`cd`** - change directory
2626

27-
`cd pathname` - takes you to the directory specified by `pathname`
28-
29-
`cd ~` - takes you to your home directory
30-
31-
`cd ..` - takes you up one directory
27+
- `cd pathname` - take you to the directory specified by `pathname`
28+
- `cd ~` - take you to your home directory
29+
- `cd ..` - take you up one directory
3230

3331
***
3432

3533
### Shell: Interacting with Files
3634

37-
**`mkdir`** make a directory
35+
**`mkdir`** - make a directory
3836

39-
**`cat`** print to shell or send file or files to output
37+
**`cat`** - print to shell or send file or files to output
4038

41-
**`head`** output first 10 lines of a file or files
39+
**`head`** - output first 10 lines of a file or files
4240

43-
**`tail`** output last 10 lines of a file or files
41+
**`tail`** - output last 10 lines of a file or files
4442

45-
**`mv`** rename or move a file or files. Syntax for renaming a file: `mv FILENAME NEWFILENAME`
43+
**`mv`** - rename or move a file or files. Syntax for renaming a file: `mv FILENAME NEWFILENAME`
4644

47-
**`cp`** make a backup copy of a file or files. Syntax: `cp FILENAME NEWFILENAME`
45+
**`cp`** - make a backup copy of a file or files. Syntax: `cp FILENAME NEWFILENAME`
4846

49-
**`>`** redirect output. Syntax with `cat`: `cat FILENAME1 FILENAME2 > NEWFILENAME`
47+
**`>`** - redirect output. Syntax with `cat`: `cat FILENAME1 FILENAME2 > NEWFILENAME`
5048

51-
**`>>`** 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`
5250

53-
**`rm`** remove a file or files. NB: *USE WITH EXTREME CAUTION!!!*
51+
**`rm`** - remove a file or files. NB: *USE WITH EXTREME CAUTION!!!*
5452

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
5654

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
5856

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
6058

6159
***
6260

6361
### Shell: Wildcards
6462

65-
**`?`** a placeholder for one character or number
63+
**`?`** - a placeholder for one character or number
6664

67-
**`*`** a placeholder for zero or more characters or numbers
65+
**`*`** - a placeholder for zero or more characters or numbers
6866

69-
**`[]`** defines a class of characters
67+
**`[]`** - define a class of characters
7068

7169
*Examples*
7270

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
7775

7876
***
7977

8078
### Shell: Counting and Mining
8179

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)
8387

84-
- `-w`: count words
85-
- `-l`: count lines
86-
- `-c`: count characters
88+
- `sort -n` - sort input numerically
8789

88-
**sort** sort input
90+
**`grep`** - global regular expression print
8991

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
9197

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`
98100

99101
***
100102

101103
### Shell: Working with Free Text
102104

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
104107

105-
**`tr`** translates or deletes characters in a file
108+
**`tr`** - translates or deletes characters in a file. Some allowed sequences:
106109

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
110113

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
112115

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
117+
- `uniq -c`- do a word count of the duplicates
114118

115119

0 commit comments

Comments
 (0)