Ma collection de commandes Bash utiles et pratiques !

explainshell.com - match command-line arguments to their help text
match command-line arguments to their help text
Outil d'explication des commandes shell

Chercher un fichier contenant une chaîne de caractères :

find . -type f -print | xargs grep "some string"
grep "some string" . -R

Lister les fichiers dans un répertoire avec une taille en MB :

ls -al --block-size=M

Calculer la taille des sous dossiers

sudo du -h / --max-depth=1

Droits d'accès des clés SSH

chmod 600 ~/.ssh/id_rsa ~/.ssh/id_rsa.pub

Lancer un serveur web dans le répertoire courant

# Python 2.x
python -m SimpleHTTPServer 8000

# Python 3.x
python -m http.server 8000

Autres commandes : Big list of http static server one-liners


Docker : Purger l'espace disque docker (Efface toutes les images et les volumes non utilisés, à lancer avec précaution)

docker system prune -f -a

Ressources

One-liners | Basic | Cheat sheet | Linux Command Library
Handy cheat sheet with basics and tips about working with One-liners on the linux command line.
Learn Linux Basics – Bash Command Tutorial for Beginners
This Linux Command Handbook will cover 60 core Bash commands you will need as adeveloper. Each command includes example code and tips for when to use it. This Linux Command Handbook follows the 80/20 rule: you’ll learn 80% of a topicin around 20% of the time you spend studying it. I find that th…
cheat/cheat
cheat allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not ...

Idées et Astuces

Help message for shell scripts
I share what I know.
Sockets In Your Shell
Minimal safe Bash script template | Better Dev
Minimal Bash script template that will make your scripts safer, consistent with standards, and provide a way to parse and validate parameters.
https://news.ycombinator.com/item?id=25428621
Functions as first-class citizens: the shell-ish version
functional-bash The idea to compose multiple functions together, passing one or more of them to another as parameters, ...
Bash HTTP monitoring dashboard - Raymii.org
What am I running inside my bash?
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand. - LICENSE
Best of .bashrc | datagubbe.se
Use The ‘tail’ Command To Monitor Everything
Use The ‘tail’ Command To Monitor Everything
An Opinionated Guide to xargs