<jupyter_start><jupyter_text>**Shell Commands****A shell is an interface that executes commands. The shell allows the user to communicate (via commands) with the kernel (a program at the core of a computer's operating system). With shell, it’s possible to invoke complicated programs like climate modeling software or simple commands that create an empty directory with only one line of code.****A shell is a Command Line Interpreter (CLI) and is one form of navigating an operating system. The other form is through a Graphical User Interface or GUI which allows a user to navigate using icons, menus and windows.** Source: [Introducing the Shell](https://swcarpentry.github.io/shell-novice/01-intro/index.html) from the Software Carpentry Foundation  **Bash****Bash is a command language interpreter. It is widely available on various operating systems and is a default command interpreter on most GNU/Linux systems. The name is an acronym for the "Bourne-Again SHell".** Source: [Bash Scripting Tutorial for Beginners](https://linuxconfig.org/bash-scripting-tutorial-for-beginners) by <NAME>  **Bash within Google Colab****Bash is used as the command language within Google Colab. Bash is accessed using the `!` or `%` characters. `!` is used for temporary subshell commands while `%` is used for more enduring commands.** Source: [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/01.05-ipython-and-shell-commands.htmlShell-Related-Magic-Commands) by <NAME>  **`man`****`man` or "manual", is an interface to the system reference manuals. Manual is used to describe commands.**<jupyter_code>!man head<jupyter_output>HEAD(1POSIX)               POSIX Programmer's Manual              HEAD(1POSIX)

PPRROOLLOOGG
       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
       implementation of this interface may differ (consult the  corresponding
       Linux  manual page for details of Linux behavior), or the interface may
       not be implemented on Linux.

NNAAMMEE
       head — copy the first part of files

SSYYNNOOPPSSIISS
       head [[−n _n_u_m_b_e_r]] [[_f_i_l_e...]]

DDEESSCCRRIIPPTTIIOONN
       The _h_e_a_d utility shall copy its input files  to  the  standard  output,
       ending the output for each file at a designated point.

       Copying  shall  end at the point in each input file indicated by the −−nn
       _n_u_m_b_e_r option. The option-argument _n_u_m_b_e_r shall be counted in units  of
       lines.

OOPPTTIIOONNSS
       The  _h_e_a_d  utility  shall  conform  to  the  Base Definition[...]<jupyter_text>**`echo`****`echo` is a command that outputs the strings that are passed to it as arguments. `echo` can be thought of as a print function.**<jupyter_code>!echo hello world
!echo $SHELL<jupyter_output>/bin/bash<jupyter_text>Source: [The Shell and Shell Scripting ](https://www.cs.cmu.edu/~ab/15-123S09/lectures/Lecture%2002%20-%20Shell%20Scripting.pdf) by <NAME>  **`pwd`****`pwd` or "print work directory", returns the current working directory. The default working directory for Google Colab is the `/content` folder.**<jupyter_code>!pwd<jupyter_output>/content<jupyter_text>**`cd`****`cd` or "change directory", is used to change the working directory. The path name is input after `cd`.**<jupyter_code>%cd /content/sample_data
!pwd<jupyter_output>/content/sample_data<jupyter_text>**`ls`****`ls` or "list", prints out the content within the current working directory.**<jupyter_code>!ls<jupyter_output>anscombe.json		      mnist_test.csv
california_housing_test.csv   mnist_train_small.csv
california_housing_train.csv  README.md<jupyter_text>**`head` and `tail`****`head` by default prints out the first ten lines of a file.****`tail` prints out the last ten lines of a file.**<jupyter_code>!head /content/sample_data/california_housing_test.csv
!head -n5 /content/sample_data/california_housing_test.csv
!tail -n5 /content/sample_data/california_housing_test.csv<jupyter_output>-119.860000,34.420000,23.000000,1450.000000,642.000000,1258.000000,607.000000,1.179000,225000.000000
-118.140000,34.060000,27.000000,5257.000000,1082.000000,3496.000000,1036.000000,3.390600,237200.000000
-119.700000,36.300000,10.000000,956.000000,201.000000,693.000000,220.000000,2.289500,62000.000000
-117.120000,34.100000,40.000000,96.000000,14.000000,46.000000,14.000000,3.270800,162500.000000
-119.630000,34.420000,42.000000,1765.000000,263.000000,753.000000,260.000000,8.560800,500001.000000<jupyter_text>**`mkdir`****`mkdir` or "make directory", creates a new directory or folder.**<jupyter_code>!mkdir /content/test<jupyter_output><empty_output><jupyter_text>**`cp`****`cp` or "copy", is used to copy a given file into a directory.**<jupyter_code>!cp california_housing_test.csv /content/test
%cd /content/test
!ls<jupyter_output>/content/test
california_housing_test.csv<jupyter_text>**`rm`****`rm` or "remove", deletes a given file. Use this command with caution.**<jupyter_code>!rm /content/test/california_housing_test.csv<jupyter_output><empty_output><jupyter_text>**`rmdir`****`rmdir` or "remove directory", deletes a given directory. Use this command with caution.**<jupyter_code>!rmdir /content/test<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12214461015669247, 'fraction_numerical': 0.08098923919199547, 'mean_word_length': 5.375451263537906, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '196131', 'license': 'MIT', 'n_tokens_mistral': 2103, 'n_tokens_neox': 1762, 'n_words': 496, 'path': 'Google Colab Tutorials/Google Colab - An Intro to Bash Scripting!.ipynb', 'repo_name': 'ad17171717/Workshops-2020-2021', 'size': '5320'}