# Linux

#### Display size of all sub folders in current dir

* macOS

```bash
du -sh ./* ./.*/ 2>/dev/null | sort -h | tail -10 # with hidden
du -sh ./* 2>/dev/null | sort -h | tail -10 # no hidden
```

* Linux

```shellscript
 du -sh -- * .[!.]* | sort -hr | head -n 10
```

#### get all running process of a program

```bash
ps -ef | grep program_name
```

#### unzip a tar.gz

```bash
tar xvzf file.tar.gz
```

#### transfer files through scp

```bash
scp -r /source_folder/ yangj8@10.248.115.166://destination_folder/
```

#### zip a dir

```bash
zip –r filename.zip directory_name
```

#### list all dir

```bash
ls -d */
```

#### list all specific extension file

```bash
ls -1 *.zip
```

#### nohup run

```bash
ls > samplefile.txt 2>&1
```

#### add path

```bash
export PATH="$HOME/bin:$PATH"
```

#### find a specific running process

```bash
ps -ax | grep -i skype
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://juechen-yang.gitbook.io/juechen-s-codebook/linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
