> For the complete documentation index, see [llms.txt](https://notes.d15r.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.d15r.de/dev/linux/bash.md).

# Bash

## Links

* [Bash scripting cheatsheet](https://devhints.io/bash)
* [DevOps Bash Tools](https://github.com/HariSekhon/DevOps-Bash-tools)
* [Bash script tutorial](https://www.devopsroles.com/bash-script/)
* [critic.sh](https://github.com/Checksum/critic.sh) - Dead simple testing framework for Bash with coverage.
* [The Linux Command Handbook](https://www.freecodecamp.org/news/the-linux-commands-handbook/)
* [Advanced Bash-Scripting Guide](https://tldp.org/LDP/abs/html/)
* [How to Use Bash Alias](https://www.shell-tips.com/bash/alias/)
* [The Complete How To Guide of Bash Functions](https://www.shell-tips.com/bash/functions/)
* [Learning Modern Linux](https://modern-linux.info/) - Handbook for the Cloud Native Practitioner.
* [The 50 Most Popular Linux & Terminal Commands](https://www.youtube.com/watch?v=ZtqBQ68cfJc)
* [The Arch Linux Handbook](https://www.freecodecamp.org/news/how-to-install-arch-linux/)
* [How to Search for Files from the Linux Command Line](https://www.freecodecamp.org/news/how-to-search-for-files-from-the-linux-command-line/)
* [The Front-End Developer's Guide to the Terminal](https://www.joshwcomeau.com/javascript/terminal-for-js-devs)
* [Improve Your Cybersecurity Command Line Skills](https://www.freecodecamp.org/news/improve-you-cybersecurity-command-line-skills-bandit-overthewire-game-walkthrough/)
* [jlevy/the-art-of-command-line](https://github.com/jlevy/the-art-of-command-line)

## Snippets

### Dateien älter als X Tage

Alle .json Dateien, die älter als 7 Tage sind finden

```
find /var/www/share/default/htdocs/agrirouter/mqtt/backup -name "*.json" -type f -mtime +7
```

und löschen

```
find /var/www/share/default/htdocs/agrirouter/mqtt/backup -name "*.json" -type f -mtime +7 -delete
```

[How to Delete Files Older than 30 days in Linux](https://tecadmin.net/delete-files-older-x-days/)

### Symlink

```
ln -s /path/to/file /path/to/symlink
```

```
ln -sf /path/to/file /path/to/symlink
```

### Print Working directory

```
pwd
```

### Change Driectory

```
cd - // Zum letzen Ordner
```

### Speicherplaz

```
du -hs *
```

### Rechte

#### Dateien

* r: lesen
* w: schreiben
* x: ausführen

#### Ordner

* r: lesen
* w: Dateien löschen, erstellen
* x: Ordner öffnen (cd dir)


---

# 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 dynamically by asking a question.

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

```
GET https://notes.d15r.de/dev/linux/bash.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
