Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

cat

Command to display first few and last few lines of a file

August 11, 2022 by Magenaut

I have a file with many rows, and each row has a timestamp at the starting, like

Categories Q&A, Unix & Linux Tags cat, head, logs, tail, text-processing Leave a comment

Difference between “cat” and “cat <"

August 11, 2022 by Magenaut

I was working through a tutorial and saw use of both cat myfile.txt and cat < myfile.txt. Is there a difference between these two sequences of commands? It seems both print the contents of a file to the shell.

Categories Q&A, Unix & Linux Tags cat, io-redirection Leave a comment

Should I care about unnecessary cats?

August 11, 2022 by Magenaut

A lot of command-line utilities can take their input either from a pipe or as a filename argument. For long shell scripts, I find starting the chain off with a cat makes it more readable, especially if the first command would need multi-line arguments.

Categories Q&A, Unix & Linux Tags cat, performance, pipe, shell-script Leave a comment

Is there a tool that combines zcat and cat transparently?

August 11, 2022 by Magenaut

When handling log files, some end up as gzipped files thanks to logrotate and others not. So when you try something like this:

Categories Q&A, Unix & Linux Tags cat, compression, gzip, text-processing Leave a comment

Ctrl+D for ending terminal line input

August 11, 2022 by Magenaut

If I do

Categories Q&A, Unix & Linux Tags cat, command-line, terminal Leave a comment

How can I “cat” a file and remove commented lines?

August 11, 2022 by Magenaut

I’d like to know if there is a way that I could cat file like php.ini and remove all lines starting with ;

Categories Q&A, Unix & Linux Tags cat, command-line, grep, linux, replace Leave a comment

How to make bash put prompt on a new line after cat command?

August 10, 2022 by Magenaut

What I get:

Categories Q&A, Unix & Linux Tags bash, cat, osx, prompt Leave a comment

Is it better to use cat, dd, pv or another procedure to copy a CD/DVD?

August 10, 2022 by Magenaut

Use of cat to copy a medium: http://www.yolinux.com/TUTORIALS/LinuxTutorialCDBurn.html

Categories Q&A, Unix & Linux Tags cat, dd, disk-image, linux, pv Leave a comment

How safe is it to cat an arbitrary file?

August 10, 2022 by Magenaut

Sometimes when I cat a binary file by mistake, my terminal gets garbled up. Nothing a quick reset can’t fix, but couldn’t an attacker theoretically create a file that, when displayed on a terminal, would execute some arbitrary code? Through an exploit in the terminal emulator or otherwise.

Categories Q&A, Unix & Linux Tags cat, special-characters, terminal Leave a comment

Difference between cat and ‘>’ to zero out a file

August 10, 2022 by Magenaut

Are these two commands any different on how they go about zero-ing out files? Is the latter a shorter way of doing the former? What is happening behind the scenes?

Categories Q&A, Unix & Linux Tags cat, io-redirection Leave a comment
Older posts
Page1 Page2 Page3 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress