1 lien privé
Guide complet pour maîtriser la gestion des paquets avec APT sous Linux : apt update, install, upgrade, remove et toutes les commandes essentielles sous Debian.
En fait, dans les shells Unix (bash, zsh, etc.), y'a 3 canaux de base : stdin (entrée, numéro 0), stdout (sortie normale, numéro 1) et stderr (les erreurs, numéro 2). Tout le reste, de > à 2>/dev/null, découle de ces 3 numéros.
In Linux, learning how to use cd, pushd, popd, and zoxide is essential, and these commands remain widely used by both beginners and system administrators.
Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
echo "test.txt" | tr [:lower:] [:upper:]
Voulez-vous accéder au BIOS rapidement via un raccourci sur votre Bureau ?
Mettez la commande suivante :
shutdown /r /fw /t 1
shutdown /r : pour redémarrer
/fw : pour firmware/BIOS
/t 1 : pour le temps d'une seconde
Introduction
Dans cet article, on va voir comment arrêter, redémarrer le système avec les commandes mises à notre...
nous allons aborder une fonctionnalité extrêmement puissante du shell.
Gagner en efficacité en utilisant la complétion automatique et l'historique des commandes
Quand on travaille régulièrement sous Linux, il est intéressant de savoir quelles commandes on utilise le plus souvent. Cela peut vous aider à optimiser vos alias, automatiser certaines tâches ou tout simplement mieux comprendre votre utilisation quotidienne.
history | awk '{print $2}' | sort | uniq -c | sort -nr | head -10
Explication étape par étape :
history : affiche l'historique des commandes que vous avez tapées dans votre terminal
awk '{print $2}' : avec awk, on récupère uniquement la deuxième colonne, qui correspond à la commande (le premier mot)
sort : trie toutes les commandes par ordre alphabétique
uniq -c : compte les occurrences de chaque commande
sort -nr : trie numériquement (-n) et en ordre décroissant (-r), pour avoir les plus fréquentes en premier
head -10 : affiche uniquement les 10 premières lignes, soit les 10 commandes les plus utilisées
Vous pouvez aussi modifier la commande pour compter non seulement le premier mot, mais toute la ligne de commande (exemple : git status vs git pull). Dans ce cas, remplacez awk '{print $2}' par awk '{$1=""; print $0}'. Ce qui donne :
history | awk '{$1=""; print $0}' | sort | uniq -c | sort -nr | head -10
In this article, you will learn how to install the dig and nslookup commands, which are used for network troubleshooting and gathering information about domains
nmcli device show <interfacename> | grep IP4.DNS
You can see your interfaces with
nmcli device status
In this article, we cover 10 lesser-known Linux commands like startx, pdftk, lsof, and find to help boost your productivity in the terminal.
11 Lesser Known Useful Linux Commands – Part 1
https://www.tecmint.com/lesser-known-linux-commands/
10 Lesser Known Linux Commands – Part 2
https://www.tecmint.com/10-lesser-known-linux-commands-part-2/
10 Advanced Linux Commands You’ve Probably Never Used – Part 3
https://www.tecmint.com/lesser-known-commands-linux/
10 Must-Know Linux Commands You Probably Missed – Part 4
https://www.tecmint.com/secret-linux-commands/
Linux is a powerful and versatile operating system that can handle a wide range of tasks. One of those tasks is adding text to images, which can be useful for creating graphics, designing logos, or simply adding captions to photos. In this article, we’ll show you how to add text to images using Linux command line tools.
To do this, you’ll use the convert command from ImageMagick. The basic syntax for adding text is:
convert input_image -pointsize 20 -fill white -annotate +100+100 'Your Text Here' output_image
Let’s break this down:
`input_image` is the name of your input image file.
`-pointsize` is the size of the font you want to use.
`-fill` is the color of the text.
`-annotate` is the position of the text. The +100+100 values indicate the X and Y coordinates of the text relative to the top left corner of the image.
`output_image` is the name of the output image file.
Here’s an example command:
convert myimage.png -pointsize 24 -fill white -annotate +50+50 'Hello World' output.png
This command adds the text “Hello World” to the image myimage.png in white 24-point font, positioned 50 pixels from the top left corner of the image. The output image is saved as output.png.
Step 4: Adjust Text Properties
You can adjust the font, color, and position of your text by modifying the command parameters. For example, you can use a different font by adding the -font parameter, like this:
convert input_image -pointsize 20 -font Times-Roman -fill white -annotate +100+100 'Your Text Here' output_image
You can also adjust the opacity of the text using the -alpha parameter. A value of Opaque will make the text fully opaque, while a value of Transparent will make it fully transparent. You can use values between 0 and 1 to create a semi-transparent effect.
Step 5: Save Your Image
Once you’re happy with your text, you can save your image using the -quality parameter. This determines the compression level of the image, with higher values producing better quality images but larger file sizes.
For example:
convert input_image -pointsize 20 -fill white -annotate +100+100 'Your Text Here' -quality 90 output_image.jpg
This command adds text to the input image and saves the output as a JPEG file with a quality of 90.
Step 6: Batch Processing
If you need to add text to multiple images, you can use a batch processing script to automate the process. For example, you can create a shell script that loops through a directory of images and adds text to each one.
Here’s an example script that adds the same text to all images in a directory:
/#!/bin/bash
for file in *.png
do
convert "$file" -pointsize 24 -fill white -annotate +50+50 'Hello World' "${file%.png}_text.png"
done
This script loops through all PNG files in the current directory, adds the text “Hello World” to each one, and saves the output as a new file with “_text” appended to the original file name.
In this guide, we’ll walk you through various methods to compare text files in Linux, from basic command-line tools to advanced visual diff tools.
mmv stands for multiple move, which is a command-line utility that allows you to rename, move, and copy multiple files at once.
wmctrl -r Firefox -e 0,110,15,1450,1030
Anyone knows a good way to resize any window to for example 640x480?
Reason is, of course, screencasting.
Under windows I've used ZoneSize from donationcoder. (Btw: For Firefox it's easy, just us...
Use the wmctrl command:
To list the windows:
$ wmctrl -l
0x00c00003 -1 rgamble-desktop Bottom Expanded Edge Panel
0x00c00031 -1 rgamble-desktop Top Expanded Edge Panel
0x00e00022 -1 rgamble-desktop Desktop
0x0260007c 0 rgamble-desktop Google - Mozilla Firefox
To resize a window based on its title:
wmctrl -r Firefox -e 0,0,0,640,480
The arguments to the resize option are gravity,X,Y,width,height so this will place the window at the top-left corner of the screen and resize it to 640X480.
Check Top Processes sorted by RAM or CPU Usage in Linux
The following command will show the list of top processes ordered by RAM and CPU use in descendant form (remove the pipeline and head if you want to see the full list):
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
Find Top 15 Processes by Memory Usage with ‘top’ in Batch Mode
To display the top 15 processes sorted by memory use in descending order, do:
top -b -o +%MEM | head -n 22
As opposed to the previous tip, here you have to use +%MEM (note the plus sign) to sort the output in descending order:
Les outils de réseau contenant notamment la commande ifconfig, netstat, route et arp sont dépréciés.
Il est conseillé d'utiliser maintenant la commande ip qui fait tout et qui est universelle sur toutes les distributions Linux.
Cet article va présenter les options possibles de la commande ip.
J'utiliserai le nom d'interface enp24s0 pour illustrer les commandes qui auront besoin d'une interface spécifique.
.
Introduction
La commande du est une commande Linux utilisée pour afficher la taille des fichiers et des dossiers. Elle pourra être utile...
Guide pratique pour maîtriser l'installation, la configuration et l'utilisation du shell Zsh, ainsi que ses fonctionnalités avancées.
https://zsh.sourceforge.io/Guide/zshguide02.html
https://zsh.sourceforge.io/Doc/
https://zsh-manual.netlify.app/
https://opensource.com/article/19/9/getting-started-zsh
https://zsh-user-guide.netlify.app/
Trurl est un outil en ligne de commande qui permet de parser et manipuler facilement les URL. Inspiré de tr, il utilise le puissant parser d'URL de libcurl. Trurl offre de nombreuses fonctionnalités pour modifier tous les composants d'une URL de façon sécurisée et fiable.