Skip to main content

Questions tagged [cat]

A UNIX utility for concatenating files or input streams together. Do not use for questions about the animal.

51 votes
8 answers
13k views

What is the general consensus on "Useless use of cat"?

When I pipe multiple unix commands such as grep, sed, tr etc. I tend to specify the input file that is being processed using cat. So something like cat file | grep ... | awk ... | sed ... . But ...
arunkumar's user avatar
  • 623
413 votes
3 answers
1.0m views

What is the Windows equivalent of the Unix command cat?

I want to do exactly what unix "cat" does, but on my PC. Is there a simple equivalent command for the Windows command line? Specifically I want to create a file from all the files of a given type in ...
Kirt's user avatar
  • 7,391
39 votes
4 answers
56k views

Change Behavior of Linux Power Button

I have a headless linux mint machine that I use for a file server and other things. It's been working great for me for a few years, but there's one issue - my cat likes to hang out on top of it, and ...
schizodactyl's user avatar
-1 votes
3 answers
205 views

How to use the command "read" on a Shell script which reads its arguments from stdin

First of all, thank you for your help in advance and sorry in case this was answered before. I have not been able to find it. For helping to understand my question, I have written the following ...
Lucas's user avatar
  • 1
38 votes
1 answer
25k views

Why is cat not changing the access time?

The second call to cat a file does not update the access time. I was expecting the access time to be updated ever time a file contents gets displayed. I see the same behaviour if I open the file in ...
nelaaro's user avatar
  • 13.8k
6 votes
1 answer
6k views

Can cat be used to clone a partition?

For example, can I do: cat /dev/sda1 > /dev/sda2 instead of using dd, and if not, why will this not work?
Grezzo's user avatar
  • 972
6 votes
3 answers
12k views

Bash "Permission denied" issue when trying to append to EOF

When trying to push a couple lines to the end of a file, I get a permission issue. I understand why I'm getting the error, but I can't think of a way to resolve it. Any help would be appreciated. ...
onassar's user avatar
  • 173
5 votes
3 answers
1k views

Is it wasteful to call cat?

I’m sorry if this question is really stupid, but this is basically what I have been thinking about constantly. Suppose I run: : cat ./somefile.txt A few hundred times a second. How much faster is my ...
Blub's user avatar
  • 468
1 vote
1 answer
597 views

echo stdin, unless empty, in which case cat a file

The pipeline fstdraw in.fst | dot -Tpng | convert - -rotate 90 out.png converts a file in a certain binary format into a PNG image. Unfortunately, in some cases fstdraw emits zero bytes. (A bug in ...
Camille Goudeseune's user avatar
0 votes
1 answer
411 views

What is the Unix equivalent of `cat` for TempleOS?

If I want to cat or a list the contents of a file on the page, what is the TempleOS-equivalent of that command?
Evan Carroll's user avatar
  • 9,077
0 votes
1 answer
1k views

Grep with multiple patterns used on the command

A few days ago I installed Centos 7 on my server and run ssh. Now I want to track logs. Is there anyway to combine cat or tail with grep to have clear failed and accepted login attempts list from a ...
sober's user avatar
  • 75