Please enable JavaScript.
Coggle requires JavaScript to display documents.
Terminal (cp (cp a.txt b.txt : copy the contents of a into b, cp dirA/a…
Terminal
-
ls
ls -a : lists all contents, including hidden files and directories
-
-
-
-
grep: stands for "global regular expression print". It searches files for lines that match a pattern and returns the results. It is also case sensitive
-
-
grep -R Arctic: searches the current directory for the string "Arctic" and outputs filenames and lines with matched results
grep -Rl Arctic: searches the current directory for the string "Arctic" and outputs only filenames with matched results
-
-
sed: stands for "stream editor". It accepts standard input and modifies it based on an expression, before displaying it as output data. It is similar to "find and replace".
sed 's/snow/rain/' forests.txt : sed searches forests.txt for the word "snow" and replaces it with "rain." Importantly, the above command will only replace the first instance of "snow" on a line
sed 's/snow/rain/g' forests.txt: The above command uses the g expression, meaning "global". Here sed searches forests.txt for the word "snow" and replaces it with "rain", globally. All instances of "snow" on a line will be turned to "rain"
-
uniq: stands for "unique" and filters out adjacent, duplicate lines in a file
-
-
-
| is a "pipe". The | takes the standard output of the command on the left, and pipes it as standard input to the command on the right