<jupyter_start><jupyter_text>Using the command lineUseful commands to perform programmatically common operations over files and folders (create, copy, move, delete, download or navigate folders)  Utilising the ExplainShell interactive command explorerThere is an excellent resource that provides an interactive command explainer that can be accessed at https://explainshell.com/.Feel free to use and paste the following commands from the tutorial to see an explanation of the command based on the official commands documentation.![](http://g.recordit.co/Ku6hdxwHaw.gif)  1. List files in the current folder Directory is used interchangeably with the term folder.<jupyter_code>ls -l<jupyter_output>total 632
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    8701 Mar 23 11:52 1-using-the-command-line.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users  302613 Mar 23 12:04 2-reading-data-and-plotting-in-R.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    1412 Mar 23 11:58 README.md
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users     167 Mar 23 11:52 install_dependencies.R<jupyter_text>2. Inspect your current folder location in the file systemTo see in which folder you are currently in, use the **`pwd`** command, short fro **`print working dorectory`**. This will return the absolut path to the location you currently stand.> NOTE: What is an _absolut_ path? And what is not considered an absolut path?See this resource for a thorough explanation: https://www.linuxnix.com/abslute-path-vs-relative-path-in-linuxunix/<jupyter_code>pwd<jupyter_output><empty_output><jupyter_text>3. Copy a fileDuplicate the file content while retaining the initial copy<jupyter_code>cp README.md duplicated_README.md<jupyter_output><empty_output><jupyter_text>Now let's inspect if the file was created, by listing files in the directory with the `ls -l` command. We are expecting to view the file with name `duplicated_README.md` in the listed files and folders<jupyter_code>ls -l<jupyter_output>total 640
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    8701 Mar 23 11:52 1-using-the-command-line.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users  302613 Mar 23 12:04 2-reading-data-and-plotting-in-R.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    1412 Mar 23 11:58 README.md
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    1412 Mar 23 12:12 duplicated_README.md
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users     167 Mar 23 11:52 install_dependencies.R<jupyter_text>4. Deleting a fileTo delete (remove) a file we can use the command `rm name_of_folder`. Let's delete the duplicate README.md file named `duplicated_README.md`<jupyter_code>rm duplicated_README.md<jupyter_output><empty_output><jupyter_text>Now let's inspect if the file was created, by listing files in the directory with the `ls -l` command. We are expecting to **not** view the file with name `duplicated_README.md` as we just **deleted** it in the listed files and folders<jupyter_code>ls -l<jupyter_output>total 632
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    8701 Mar 23 11:52 1-using-the-command-line.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users  302613 Mar 23 12:04 2-reading-data-and-plotting-in-R.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    1412 Mar 23 11:58 README.md
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users     167 Mar 23 11:52 install_dependencies.R<jupyter_text>5. Create a new direcctory (folder)To create a new folder if that folder doesn't exist, we can use the command `mkdir name_of_folder`. Let's create a folder named `new_folder`<jupyter_code>mkdir new_folder<jupyter_output><empty_output><jupyter_text>Now let's inspect if the folder was created, by listing files in the directory with the `ls -l` command. We are expecting to view the folder with name `new_folder` in the listed files and folders Let's inspect the folder exists with our trusted `ls -l` command<jupyter_code>ls -l<jupyter_output>total 632
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    8701 Mar 23 11:52 1-using-the-command-line.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users  302613 Mar 23 12:04 2-reading-data-and-plotting-in-R.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    1412 Mar 23 11:58 README.md
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users     167 Mar 23 11:52 install_dependencies.R
drwxr-xr-x  2 deslattesmaysa2  NIH\Domain Users      64 Mar 23 12:12 [34mnew_folder[m[m/<jupyter_text>6. Delete a folderWe can delete a folder using the `rm -r` command:<jupyter_code>rm -r new_folder<jupyter_output><empty_output><jupyter_text>Let's inspect that the folder is indeed deleted:<jupyter_code>ls -l<jupyter_output>total 632
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    8701 Mar 23 11:52 1-using-the-command-line.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users  302613 Mar 23 12:04 2-reading-data-and-plotting-in-R.ipynb
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users    1412 Mar 23 11:58 README.md
-rw-r--r--  1 deslattesmaysa2  NIH\Domain Users     167 Mar 23 11:52 install_dependencies.R
{'fraction_non_alphanumeric': 0.09135949266745938, 'fraction_numerical': 0.05965120887831946, 'mean_word_length': 4.240913811007269, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 37, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '485156', 'license': 'MIT', 'n_tokens_mistral': 2037, 'n_tokens_neox': 1797, 'n_words': 576, 'path': 'classes/Running-a-JupyterLab-Notebook/1-using-the-command-line.ipynb', 'repo_name': 'HigginsD3b/Elements-of-Style-Workflow-Creation-Maintenance', 'size': '5046'}