Mastering Terminal Commands and Jupyter Notebook Shortcuts: Your Complete Handbook
Published: 2023-09-29 11:29:40

Most developers, relies on graphical user interfaces (GUIs) for their computing needs. GUIs offer a user-friendly way to interact with machines. 
However, it's worth noting that there exists a highly capable alternative: the command-line interface (CLI). By issuing text-based commands, a CLI empowers users with greater control and flexibility over their computers, providing a powerful means of interaction.

In this article, we will delve into the world of common terminal commands that can significantly enhance your efficiency and productivity, whether you're an engineer or a data scientist. These commands are key to unlocking the full potential of your computer.


### **Common Terminal Commands:**

**1. Navigating the File System:**

- ls: List files and directories in the current directory.

```python
ls 
```

- cd <directory>: Change directory.

```python
cd Documents
```

- pwd: Print the current working directory.

```
pwd
```

- mkdir <directory>: Create a new directory.

```python 
mkdir mynewapp
```
- rm <file/directory>: Remove a file or directory.

```sql
rm file.txt
```

- cp <source> <destination>: Copy files or directories.

```sql
cp file.txt /backup/

```

- mv <source> <destination>: Move or rename files or directories.

```sql
mv file.txt newfile.txt
```

**2). Managing Files:**

- touch <filename>: Create a new empty file.

```sql 
touch newfile.txt
```

cat <filename>: Display the contents of a file.

```sql 
cat file.txt
```

- nano <filename> or vim <filename>: Open a text editor to edit a file.

```sql
nano file.txt
```

- head <filename>: Display the first few lines of a file.

```sql 
head file.txt 
```

- tail <filename>: Display the last few lines of a file.


```sql
tail file.txt
```

**3). Searching and Finding:**

- grep <pattern> <filename>: Search for a pattern in a file.

```sql
grep "pattern" file.txt
```
- find <directory> -name <filename>: Find files by name in a directory.

```sql
find /path/to/directory -name "file.txt"
```

**4). System Information:**

- top: Display a dynamic view of system processes.

```sql
top
```
- df -h: Show disk space usage.

```sql
df -h
```
- free -h: Display free and used memory.

```sql
free -h
```

**5). Package Management (Linux):**

- apt-get install <package>: Install a package (Debian/Ubuntu).

```sql
sudo apt-get install package-name
```
- yum install <package>: Install a package (Red Hat/CentOS).

```sql
sudo yum install package-name
```

**6). Network and Connectivity:**

- ping <host>: Send ICMP echo requests to a host.

```sql
ping google.com
```
ifconfig or ip addr: Show network interface information.

```sql
ifconfig
```
- ssh <user>@<host>: Connect to a remote server using SSH.

```python
ssh username@hostname
```

### **Anaconda Jupyter Notebook Shortcut Keys:** 

**1. Command Mode Shortcuts (Press Esc to enter command mode):**

- A: Insert a new cell above the current cell.
- B: Insert a new cell below the current cell.
- D, D (Press D twice): Delete the current cell.
- M: Change the cell type to Markdown.
- Y: Change the cell type to Code.
- Shift + Enter: Run the current cell and move to the next one.
- Ctrl + Enter: Run the current cell and stay on it.
- Up Arrow or K: Select the cell above the current cell.
- Down Arrow or J: Select the cell below the current cell.

**2. Edit Mode Shortcuts (Press Enter to enter edit mode):**

- Shift + Tab: Show docstring and function signature help.
- Tab: Code completion or indentation.
- Ctrl + /: Comment/uncomment selected lines.
- Ctrl + Shift + -: Split the current cell at the cursor position.

**3. Other Useful Shortcuts:**

- Esc, H: Show keyboard shortcuts help.
- Esc, I, I (Press I twice): Interrupt the kernel.
- Esc, 0, 0 (Press 0 twice): Restart the kernel.
- Esc, L: Toggle line numbers in code cells.
- Esc, O: Toggle cell output.


In summary, mastering these essential terminal commands and Anaconda Jupyter Notebook shortcuts empowers users, whether engineers or data scientists, with the tools to navigate and efficiently perform a wide array of tasks. By embracing the command-line interface and harnessing the power of these commands, you can significantly enhance your efficiency and productivity, ultimately unlocking the full potential of your computer. Whether you're managing files, searching for information, or monitoring system processes, these skills are invaluable in today's technology-driven world, enabling you to work with greater control and flexibility while making the most of your computing experience.