Questions tagged [cat]

29 questions
35
votes
3 answers

Linux: cat with separators among files

In Linux if you type cat *, you will get something like this: line1 from file1 line2 from file1 line1 from file2 line1 from file3 line2 from file3 line3 from file3 What I would like is to display a separator among files. Something like this: line1…
Daniele
  • 631
  • 1
  • 7
  • 10
10
votes
1 answer

How to concatenate streams?

I know cat can concatenate files, but I need to concatenate a mix of files and streams and pipe the result to another process. To make the question more concrete, I want to concatenate cat abc.sql together with gzip -dc xyz.sql.gz and cat qvf.sql…
rustyx
  • 1,506
  • 3
  • 19
  • 28
8
votes
2 answers

Cat, Grep, Redirect Output.... Blank File?

I just ran cat /opt/webapplications/Word/readme.log | grep -v 'Apple' and I got the output on the cli that I was expecting, which was all the lines in readme.log that did not contain 'Apple'... Next I ran... cat /opt/webapplications/Word/readme.log…
8
votes
2 answers

cat * | grep something... what file is the result in?

If one was to run the following command cat * | grep DATABASE the shell would spit out all the lines in * files that contained the word DATABASE in them. Is there any way to also spit out what file each line is apart of? I tried to use the -H…
Jake Wilson
  • 8,494
  • 29
  • 94
  • 121
6
votes
3 answers

View file contents on a Salt Stack minion

How do I output the contents of a file on all my minions using Salt Stack? The only 'pull' functionality I can find is in this minion push commit, but this requires configuration changes on the master.
Petrus Theron
  • 1,541
  • 5
  • 16
  • 24
6
votes
6 answers

What am I doing wrong with this cat 6 patch panel wiring?

top number is transmitter bottom number is remote terminator 12345678 36145278 is this because I could be mixing T568A and T568B wiring? how do I know if my patch cord is A or B? Do I just look at the plug and match it up with the diagram on the…
Max Hodges
  • 336
  • 2
  • 3
  • 15
6
votes
1 answer

File size limit exceeded in bash

I have tried this shell script on a SUSE 10 server, kernel 2.6.16.60, ext3 filesystem the script has problem like this: cat file | awk '{print $1" "$2" "$3}' | sort -n > result the file's size is about 3.2G, and I get such error message: File size…
yboren
  • 61
  • 1
5
votes
1 answer

Use of unused pairs in cat5 ethernet cables?

Cat5 ethernet cables use only 2 pairs for Ethernet what are the other 2 pairs for ? Pin Color Function 1 White with Green +TD 2 Green -TD 3 White with Orange +RD 4 Blue Not Used 5 White with…
Ravi Teja Bonam
  • 59
  • 1
  • 1
  • 2
5
votes
5 answers

How to concat rotated logs back together

How to concatenate the rotated logs back together to make the original file? huali-access.log huali-access.log.15 huali-access.log.21 huali-access.log.28 huali-access.log.34 huali-access.log.40 huali-access.log.47 …
steveyang
  • 623
  • 4
  • 9
  • 15
5
votes
2 answers

tail -f without the tail?

Is there a command in Solaris to read a file, and when it gets to the end to stream the way tail does? I need to read the file from the start, and it is a binary file. Information on Solaris and Linux would be appreciated.
700 Software
  • 2,163
  • 9
  • 47
  • 77
4
votes
2 answers

How can I combine two commands to tally data from compressed and uncompressed log files?

I am running this command to get a tally of failed login attempts from a server’s auth.log and it works well: sudo cat /var/log/auth.{log,log.1} | grep 'Failed password' | grep sshd | awk '{print $1,$2}' | sort -k 1,1M -k 2n | uniq -c But the issue…
Giacomo1968
  • 3,522
  • 25
  • 38
4
votes
1 answer

Loading a big database dump into PostgreSQL using cat

I have a pair of very large (~17 GB) database dumps that I want to load into postgresql 9.3. After installing the database packages, learning more or less how to use them, and fiddling around a little on various StackExchange pages (particularly…
RussH
  • 143
  • 1
  • 5
4
votes
2 answers

help with expect script, run cat on remote comp and get output of it to the variable

I have a bash+expect script which has to connect via ssh to the remote comp, read the file there, find specific line with the "hostname" (like "hostname aaaa1111") and store this hostname into the variable to be used after while. How can i get the…
lugger1
  • 43
  • 1
  • 1
  • 4
3
votes
1 answer

Cat a file(raw) to UDP at specific bitrate

I'm looking for a way to transfer a file over UDP at an specific bitrate. I can use netcat for example like this: cat file | nc -u 192.168.x.x 5000 And I use a custom application to listen at port 5000 at client side. Is there any way to "cat a…
user185165
  • 31
  • 1
  • 2
2
votes
1 answer

Cygwin 2.9.0 cat/tac Commands Fail on Large Files when Piping to grep -q -m1

I am seeing some odd behavior using Cygwin x64 2.9.0 on Windows 10 Pro x64. The command I am attempting to run is the following: tac | grep -q -m1 -F "literal string" The above command succeeds on all small files that I throw at it (small…
Jeff G
  • 121
  • 5
1
2