Blog
Home

cat

7 July 2026 · 68 views

One of the handy Linux utilities I use regularly in my work as a DevOps engineer is cat. I often use it in Linux containers, where a text editor is not always available.

cat is one of those Linux commands almost everybody knows for viewing a text file:

cat file.txt

But it is more than just a file viewer.

In containers, where an editor is often missing, cat > file is a quick way to create or update a file:

cat > file.txt
  1. type in your content
  2. leave a newline at end of file
  3. finish with Ctrl+D (or Ctrl+C if you really want to stop it)

And for connectivity troubleshooting it can be handy too, to check whether a port is open:

cat < /dev/null > /dev/tcp/8.8.8.8/53; echo $?

Cat using the cat command, illustration

Co-authored with Claude.

If this was useful, you can buy me a coffee.

New articles: follow via RSS.

Comments

← All articlesView as Markdown