> For the complete documentation index, see [llms.txt](https://digitalgarden.batamladen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://digitalgarden.batamladen.com/notes/linux/basic-linux-commands.md).

# Basic Linux Commands

Basic commands used in a linux terminal

<table><thead><tr><th width="140">Command</th><th>Explanation</th><th>Example</th></tr></thead><tbody><tr><td>cd</td><td>change directory</td><td>cd <em>/home/kali/file_name.txt</em></td></tr><tr><td>mv</td><td>move a file/directory</td><td>mv f<em>ile.txt /path/to/newlocation</em></td></tr><tr><td>pwd</td><td>print current working directory</td><td>pwd</td></tr><tr><td>grep</td><td>find the entered word</td><td>ls -l | grep ".txt"</td></tr><tr><td>ls</td><td>list files in current directory</td><td>ls</td></tr><tr><td>    -l</td><td>Lists files in a long format, showing details such as permissions, ownership, size, and modification time.</td><td>ls -l</td></tr><tr><td>    -a</td><td>Shows all files, including hidden files (those that start with a dot <code>.</code>).</td><td>ls -a</td></tr><tr><td>    -h</td><td>Makes file sizes human-readable, often used with <code>-l</code> to show sizes in KB, MB, or GB.</td><td>ls -lh</td></tr><tr><td>mkdir</td><td>make directory</td><td>mkdir <em>dir_name</em></td></tr><tr><td>rmdir</td><td>remove directory</td><td>rmdir <em>dir_name</em></td></tr><tr><td>touch</td><td>create an empty file</td><td>touch <em>file_name.txt</em></td></tr><tr><td>cat</td><td>see file content</td><td>cat file_name.txt</td></tr><tr><td>man</td><td>display manual for other commands</td><td><em>any command</em> man</td></tr><tr><td>chmod</td><td>change mod of a file (rwx)</td><td>chmod +rwx <em>file_name.txt</em></td></tr><tr><td>chown</td><td>change owner and group of a file</td><td>chown <em>user:group file_name.txt</em></td></tr><tr><td>df</td><td>display available disk space</td><td>df -h</td></tr><tr><td>find</td><td>search for files in a directory hierarchy</td><td>find <em>/path</em> -type f -size +10M</td></tr><tr><td>tar</td><td>archive files</td><td>tar -czvf project.tar.gz project/</td></tr><tr><td>gzip</td><td>compres &#x26; decompres files/dirs</td><td>gzip <em>file_name.txt</em></td></tr><tr><td>ssh</td><td>ssh connection request</td><td>ssh <em>ip_addres port</em></td></tr><tr><td>curl</td><td>transfer data from/to server</td><td>curl -o <em>downloaded_file.txt</em> <em>http://example.com/file.txt</em></td></tr><tr><td>ping</td><td>test connectivity</td><td>ping <em>site.com</em></td></tr><tr><td>ifconfig</td><td>see network interface info</td><td>ifconfig</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://digitalgarden.batamladen.com/notes/linux/basic-linux-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
