<jupyter_start><jupyter_text>Basic *nix Commands – Pipes & Redirects  Redirection  Redirect command output to a file* Think of redirection characters as arrows. * e.g., `ls /dev > test.txt`    * redirects the output of ls into a new file named test.txt  Append command **output** to the end of a file* e.g., `ls /proc >> test.txt`  Redirect input from other than stdin* Works for commands that normally use keyboard input.* e.g., `echo ‘print ‘‘Hello, World!’’ ’ > hello.py && python < hello.py`    * The && means continue with next command   std*There are 3 standard I/O file stream descriptors  stdin* 0    * Use `<`                        stdout* 1    * `>` is the same as `1>`  stderr* 2* Most often used to redirect to nowhere    * e.g., `find / -name ls 2>/dev/null`  Pipes  `|`  * As the name implies, a pipe (`|`) takes the output of one command to the input of another command    * e.g., `ls /usr/sbin | less`    * We can actually write short "programs" by stringing pipestogether.  `tee`* Splits a data stream so it flows both into a specified file and continues as `tee`'s `stdout`* Useful for saving intermediate steps in a long string of pipes.    * e.g., `ls /usr/sbin | tee processes.txt | less`<jupyter_code>%%javascript
function hideElements(elements, start) {
    for(var i = 0, length = elements.length; i < length;i++) {
        if(i >= start) {
            elements[i].style.display = "none";
        }
    }
}

var prompt_elements = document.getElementsByClassName("prompt");
hideElements(prompt_elements, 0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11602564102564103, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 3.2884615384615383, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '84822', 'license': 'MIT', 'n_tokens_mistral': 493, 'n_tokens_neox': 463, 'n_words': 193, 'path': 'BasicUnixCommands-Pipes_and_Redirects-rise.ipynb', 'repo_name': 'PGE383-HPC/live_lectures', 'size': '1560'}