From e08360ed0b926d39cb408cfe29bb75a281874d9d Mon Sep 17 00:00:00 2001 From: Ramon Granell Date: Thu, 7 Aug 2025 16:31:04 +0100 Subject: [PATCH 1/7] Changing format and some examples in the the reference file --- learners/reference.md | 88 +++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/learners/reference.md b/learners/reference.md index 79818f9b..e01002d6 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -24,92 +24,98 @@ title: Reference **`cd`** change directory -`cd pathname` - takes you to the directory specified by `pathname` +- `cd pathname` - take you to the directory specified by `pathname` -`cd ~` - takes you to your home directory +- `cd ~` - take you to your home directory -`cd ..` - takes you up one directory +- `cd ..` - take you up one directory *** ### Shell: Interacting with Files -**`mkdir`** make a directory +**`mkdir`** - make a directory. -**`cat`** print to shell or send file or files to output +**`cat`** - print to shell or send file or files to output.` -**`head`** output first 10 lines of a file or files +**`head`** - output first 10 lines of a file or files -**`tail`** output last 10 lines of a file or files +**`tail`** - output last 10 lines of a file or files -**`mv`** rename or move a file or files. Syntax for renaming a file: `mv FILENAME NEWFILENAME` +**`mv`** - rename or move a file or files. Syntax for renaming a file: `mv FILENAME NEWFILENAME` -**`cp`** make a backup copy of a file or files. Syntax: `cp FILENAME NEWFILENAME` +**`cp`** - make a backup copy of a file or files. Syntax: `cp FILENAME NEWFILENAME` -**`>`** redirect output. Syntax with `cat`: `cat FILENAME1 FILENAME2 > NEWFILENAME` +**`>`** - redirect output. Syntax with `cat`: `cat FILENAME1 FILENAME2 > NEWFILENAME` -**`>>`** redirect output by appending to the filename specified. Syntax with `cat`: `cat FILENAME1 FILENAME2 >> NEWFILENAME` +**`>>`** - redirect output by appending to the filename specified. Syntax with `cat`: `cat FILENAME1 FILENAME2 >> NEWFILENAME` -**`rm`** remove a file or files. NB: *USE WITH EXTREME CAUTION!!!* +**`rm`** - remove a file or files. NB: *USE WITH EXTREME CAUTION!!!* -**`rmdir -r`** will delete a directory, even if it is not empty. +- `rm -ri` - delete a directory, even if it is not empty, but will ask you to confirm each deletion -**`rm -ri`** will delete a directory, even if it is not empty, but will ask you to confirm each deletion. +**`rmdir -r`** - delete a directory, even if it is not empty -**`touch`** will update timestamp information on files, or create a file or files if they don't exist. +**`touch`** - update timestamp information on files, or create a file or files if they don't exist *** ### Shell: Wildcards -**`?`** a placeholder for one character or number +**`?`** - a placeholder for one character or number -**`*`** a placeholder for zero or more characters or numbers +**`*`** - a placeholder for zero or more characters or numbers -**`[]`** defines a class of characters +**`[]`** - defines a class of characters *Examples* -- `foobar?`: matches 7-character strings starting with `foobar` and ending with one character or number -- `foobar*`: matches strings that start with `foobar` and end with zero or more other characters or numbers -- `foobar*txt`: matches strings that start with `foobar` and end with `txt` -- `[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. +- `foobar?` - matches 7-character strings starting with `foobar` and ending with one character or number +- `foobar*` - matches strings that start with `foobar` and end with zero or more other characters or numbers +- `foobar*txt` - matches strings that start with `foobar` and end with `txt` +- `[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 *** ### Shell: Counting and Mining -**`wc`** word count +**`wc`** - word count -- `-w`: count words -- `-l`: count lines -- `-c`: count characters +- `wc -w` - count words +- `wc -l` - count lines +- `wc -c` - count characters -**sort** sort input +**sort** - sort input (alphabetic sorting) -**`grep`** global regular expression print +- `sort -n` - sort input numerically -- `-c`: displays counts of matches for each file -- `-i`: match with case insensitivity -- `-w`: match whole words -- `-v`: exclude match -- `--file=FILENAME.txt`: use the file `FILENAME.txt` as the source of strings used in query -- `|`: (vertical bar character) send output from one command into another command +**`grep`** - global regular expression print + +- `grep -c` - displays counts of matches for each file +- `grep -i` - match with case insensitivity +- `grep -w` - match whole words +- `grep -v` - exclude match +- `grep --file=FILENAME.txt` - use the file `FILENAME.txt` as the source of strings used in query + +**`|`** - (vertical bar character) send output from one command into another command. +Example: `wc -l *.txt | sort -n` *** ### Shell: Working with Free Text -**`sed`** is used to modify files, use `-e` flag to run multiple commands +**`sed`** - is used to modify files +- `sed -e` - run multiple commands -**`tr`** translates or deletes characters in a file +**`tr`** - translates or deletes characters in a file. Some allowed sequences: -- `[:punct:]`: punctuation characters -- `[:upper:]`: upper-case characters -- `[:lower:]`: lower-case alphabetic characters +- `[:punct:]` - punctuation characters +- `[:upper:]` - upper-case characters +- `[:lower:]` - lower-case alphabetic characters -**`'''\n`** translates every blank space into `\n`, then renders on a new line +Example: `tr '''\n` - translate every blank space into `\n`, then renders on a new line -**`uniq`** reports or filters repeated lines in a file, use with `-c` to do a word count of the duplicates +**`uniq`** - report or filters repeated lines in a file +- `uniq -c`- do a word count of the duplicates From 2a4c7defdd032f571d35d94b30458fd59fb8941a Mon Sep 17 00:00:00 2001 From: Ramon Granell Date: Thu, 7 Aug 2025 16:39:20 +0100 Subject: [PATCH 2/7] Adding new hyphen for file reference.md --- learners/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learners/reference.md b/learners/reference.md index e01002d6..08d2e942 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -22,7 +22,7 @@ title: Reference - `ls -a` - list all files, including hidden files - `ls *.txt` - list all files that end with `.txt` -**`cd`** change directory +**`cd`** - change directory - `cd pathname` - take you to the directory specified by `pathname` From 11452333cab792baefbe47a503d78ca915ab535e Mon Sep 17 00:00:00 2001 From: Ramon Granell Date: Thu, 7 Aug 2025 16:41:38 +0100 Subject: [PATCH 3/7] Remove third-person s in all lines --- learners/reference.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/learners/reference.md b/learners/reference.md index 08d2e942..647a06bf 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -12,7 +12,7 @@ title: Reference **`man`** - display the user manual -**`history`** - displays the history list with line numbers, use `n` to limit the list +**`history`** - display the history list with line numbers, use `n` to limit the list **`ls`** - list contents of a directory @@ -66,14 +66,14 @@ title: Reference **`*`** - a placeholder for zero or more characters or numbers -**`[]`** - defines a class of characters +**`[]`** - define a class of characters *Examples* -- `foobar?` - matches 7-character strings starting with `foobar` and ending with one character or number -- `foobar*` - matches strings that start with `foobar` and end with zero or more other characters or numbers -- `foobar*txt` - matches strings that start with `foobar` and end with `txt` -- `[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 +- `foobar?` - match 7-character strings starting with `foobar` and ending with one character or number +- `foobar*` - match strings that start with `foobar` and end with zero or more other characters or numbers +- `foobar*txt` - match strings that start with `foobar` and end with `txt` +- `[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 *** @@ -91,7 +91,7 @@ title: Reference **`grep`** - global regular expression print -- `grep -c` - displays counts of matches for each file +- `grep -c` - display counts of matches for each file - `grep -i` - match with case insensitivity - `grep -w` - match whole words - `grep -v` - exclude match From 5102a1fa54574209076f88151de4f19f16f084f2 Mon Sep 17 00:00:00 2001 From: Ramon Granell Date: Thu, 7 Aug 2025 16:44:47 +0100 Subject: [PATCH 4/7] Small typo in file file reference.md --- learners/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learners/reference.md b/learners/reference.md index 647a06bf..a4b3ad36 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -85,7 +85,7 @@ title: Reference - `wc -l` - count lines - `wc -c` - count characters -**sort** - sort input (alphabetic sorting) +**`sort`** - sort input (alphabetic sorting) - `sort -n` - sort input numerically From f4c54b43cce4ca0371bc4a66c394604bcb26966d Mon Sep 17 00:00:00 2001 From: ramGranell <39826987+ramGranell@users.noreply.github.com> Date: Tue, 12 Aug 2025 22:45:16 +0100 Subject: [PATCH 5/7] Update learners/reference.md Co-authored-by: Kaitlin Newson --- learners/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learners/reference.md b/learners/reference.md index a4b3ad36..975e0416 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -36,7 +36,7 @@ title: Reference **`mkdir`** - make a directory. -**`cat`** - print to shell or send file or files to output.` +**`cat`** - print to shell or send file or files to output **`head`** - output first 10 lines of a file or files From 8c0e97578af42c69169e7ac6d8f115aaeaba45cf Mon Sep 17 00:00:00 2001 From: ramGranell <39826987+ramGranell@users.noreply.github.com> Date: Tue, 12 Aug 2025 22:45:25 +0100 Subject: [PATCH 6/7] Update learners/reference.md Co-authored-by: Kaitlin Newson --- learners/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learners/reference.md b/learners/reference.md index 975e0416..37427ade 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -34,7 +34,7 @@ title: Reference ### Shell: Interacting with Files -**`mkdir`** - make a directory. +**`mkdir`** - make a directory **`cat`** - print to shell or send file or files to output From 966fd7dfd246add7655b5fe96378ee699ba0f701 Mon Sep 17 00:00:00 2001 From: ramGranell <39826987+ramGranell@users.noreply.github.com> Date: Fri, 12 Sep 2025 19:33:04 +0100 Subject: [PATCH 7/7] Update reference.md --- learners/reference.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/learners/reference.md b/learners/reference.md index 37427ade..dddb3d7c 100644 --- a/learners/reference.md +++ b/learners/reference.md @@ -25,9 +25,7 @@ title: Reference **`cd`** - change directory - `cd pathname` - take you to the directory specified by `pathname` - - `cd ~` - take you to your home directory - - `cd ..` - take you up one directory ***