From c10380bb3486d256b6544454fe1e6b622cbdae70 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sun, 15 Nov 2020 21:49:17 +0100 Subject: [PATCH] formatting --- basics/archives.md | 2 +- basics/bash.md | 22 ++++++++++++++++++---- distros/arch/arch_pi_install.md | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/basics/archives.md b/basics/archives.md index e849d4f..d2279b3 100644 --- a/basics/archives.md +++ b/basics/archives.md @@ -50,7 +50,7 @@ Compressing all Latex Files in /home/. > sudo find ~ -maxdepth 4 -name "*.txt" | xargs tar cvf latex-bundle.tar.gz -## `zip +## `zip` Install `zip`. diff --git a/basics/bash.md b/basics/bash.md index 46c87f0..3124823 100644 --- a/basics/bash.md +++ b/basics/bash.md @@ -22,7 +22,7 @@ Regular expression characters include: As a result, grep cannot read these characters as literal characters unless they are escaped. E.g. -> grep wtf\? log.txt +> grep wtf\\? log.txt ... will search the string 'wtf?' in the file log.txt. Another version is egrep (now used with 'grep -e') which uses more characters as special characters, or fgrep, which treats all characters as literal strings. @@ -46,10 +46,20 @@ Export this to the entire system using: > export colour=blue -# Search commands +# Search for Programs + +Search for commands relevant to `cat`. > apropos cat +Show files used in the `cat` program. + +> whereis cat + +Show *which* file is the actual code which runs when you type `cat`: + +> which cat + # Working with Text Convert every tab to ten spaces. @@ -76,9 +86,13 @@ The sort function arranges lines alphabetically. Use -r to reverse and -n to so # Sed -> sed -i s/hey/hoi/g greetings.txt +Change all examples of hey to hoi in greetings and show that output (does not change file). -Edit all examples of hey to hoi in greetings and print that to the file. +> sed 's/hey/hoi/g greetings.txt' + +Change each example of 'cat' to 'dog' in the file 'animals.md'. + +> sed 's/cat/dog/g' animals.md # Measurement diff --git a/distros/arch/arch_pi_install.md b/distros/arch/arch_pi_install.md index ce417fb..3b2b10f 100644 --- a/distros/arch/arch_pi_install.md +++ b/distros/arch/arch_pi_install.md @@ -28,7 +28,7 @@ Download and extract the root filesystem (as root, not via sudo): Move boot files to the first partition: -> mv root/boot/* boot +> mv root/boot/\* boot > Unmount the two partitions: > umount boot root