Online Linux Terminal Logo
OnlineLinuxTerminal
Opérations sur les fichiersCLI Manual

$cat

Concaténer et afficher le contenu des fichiers sur la sortie standard.

Syntaxe de la commandePOSIX Standard
cat [OPTIONS] [FILE...]
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

cat lit et affiche rapidement le texte d'un ou plusieurs fichiers dans le terminal.

Options et drapeaux courants

Flag / OptionDescription
-nNumber all output lines starting from 1.
-bNumber only non-blank output lines.
-sSqueeze multiple consecutive blank lines into a single blank line.
-EDisplay a dollar sign ($) at the end of each line.

Exemples pratiques du monde réel

#1Display file contents with line numbers
cat -n welcome.txt

Reads welcome.txt and prints each line prefixed with its line index.

#2Inspect OS release configuration
cat /etc/os-release

Displays Linux distribution and kernel release information.