Questions tagged [cat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
61 views

show content of file and sort the content output

very simple question (i'm guessing.) i use cat <filename.txt> | grep "word:" | awk '{print $2}' and get the desired info like so [user@server ~]# cat <filename.txt> | grep "...
Nick Veronski's user avatar
2 votes
1 answer
254 views

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 <file> | grep -q -m1 -F "literal string" The above command ...
Jeff G's user avatar
  • 121
1 vote
2 answers
211 views

Concatenating text files to a virtual file(or a program) on Linux

For example, I have four pieces (1.txt, 2.txt, 3.txt, 4.txt) and when the concatenate together (all.txt), that's the file what I want: cat 1.txt 2.txt 3.txt 4.txt > all.txt However, I don't want ...
Michael Sun's user avatar
-2 votes
1 answer
3k views

cat /dev/zero | pv > /dev/null [closed]

cat /dev/zero | pv > /dev/null What exactly happens here and what determines the speed of this process. Even on low end hardware you get a couple of GB/s transfer speeds like this.
Flatron's user avatar
  • 328
5 votes
1 answer
58k views

Use of unused pairs in cat5 ethernet cables? [duplicate]

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 +...
Ravi Teja Bonam's user avatar
9 votes
2 answers
3k views

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'... ...
Jeffrey L. Roberts's user avatar
-3 votes
3 answers
105 views

Trying to double the size of a file fails [closed]

I'm trying to create a large random file on a ramdisk, in order to do some tests. I've created the ramdisk and my starting file (from /dev/urandom) without much trouble, but I'm having trouble ...
Rumbles's user avatar
  • 1,014
4 votes
3 answers
601 views

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,$...
Giacomo1968's user avatar
  • 3,560
1 vote
1 answer
1k views

Running CAT in SCREEN no output to file

I am trying to code this command to run in screen along with 2 others that will be using cat to read a file then pipe it into awk for filtering. Here is the command; screen -d -m /bin/cat /var/www/...
LinHost's user avatar
  • 39
1 vote
3 answers
318 views

How to grep (or other command?) for first instance to last instance in a log?

How does one grep/search a text file so that the results show the first line with the string, and then every other line until the last line with the string? So, if I have a file that looks like this: ...
IVR Avenger's user avatar
0 votes
2 answers
50 views

8x slower cat for the same files on the same disk but different directory

I'm having an issue where I have 8x slower access to a set of files as compared to the same files in another directory on a linux machine. The filesystem is a 36TB RAID-5 filesystem exported from a ...
John Kirkland's user avatar
0 votes
1 answer
614 views

Restarting HAProxy with -st flag returns error

I'm restarting HAproxy (on Ubuntu Server x64 14.04) with the following command haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -st $(cat /var/run/haproxy.pid) However, when actually ...
Ryan's user avatar
  • 181
4 votes
1 answer
3k views

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 ...
RussH's user avatar
  • 143
3 votes
1 answer
4k views

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 ...
user185165's user avatar
6 votes
3 answers
7k views

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 ...
Petrus Theron's user avatar
0 votes
1 answer
81 views

Why is Cat quoting individual words in command substitution

All, I'm attempting to use command substitution to keep command line arguments in a file. My initial thought was to simply place the command line arguments in a single line in a file and then call ...
mklauber's user avatar
  • 133
6 votes
6 answers
34k views

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 ...
ChatGPT's user avatar
  • 336
5 votes
5 answers
4k views

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....
steveyang's user avatar
  • 683
6 votes
1 answer
1k views

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 ...
yboren's user avatar
  • 61
1 vote
1 answer
2k views

How to combine files with unix cat command based on file name, then rename?

I have a bunch of CSV files in a directory like: modfinalak_1.csv modfinalal_1.csv modfinalal_2.csv modfinalal_3.csv modfinalar_1.csv modfinalar_2.csv so it's one or multiple files per each US state ...
tiredofcoding's user avatar
11 votes
1 answer
3k views

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 ...
rustyx's user avatar
  • 1,757
5 votes
2 answers
3k views

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 ...
700 Software's user avatar
  • 2,273
0 votes
2 answers
524 views

X3440 cat /proc/cpuinfo question

im wondering is this normal? [root@RPDS181 ~]# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 30 model name : Intel(R) Xeon(R) CPU ...
Treat's user avatar
  • 25
4 votes
2 answers
19k views

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 ...
lugger1's user avatar
  • 43
2 votes
2 answers
488 views

Locate a string in a folder and the file it came from?

I am trying to find some keywords in my /var/log directory, so using cd /var/log cat * | grep keyword I find the string is in that directory and see the lines it exists on, but don't know which ...
wjimenez5271's user avatar
8 votes
2 answers
14k views

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 ...
Jake Wilson's user avatar
  • 8,924
0 votes
2 answers
2k views

How to clone with cat?

I want to clone an 8.1gig bootable disk to an 8.0gig disk and have the clone remain bootable. dd causes problems because the destination disk is a few mb smaller than the source. Can "cat" help me ...
Joshua Robison's user avatar
0 votes
2 answers
3k views

cat or vi a file, hangs

we're having some issue on a SUN 5.8 machine. first of all, the server is on his network (i.e. 10.x.x.x) and we can login using an ssh server which is on another network (196.x.x.x), so there're ...
rpiga's user avatar
  • 3
1 vote
4 answers
135 views

Locate a particular string in a directory

I want to do the following: cat *.xml | grep some_string_here This tells me if a particular string exists in an xml file in a directory. Unfortunately it does not tell me which file. how can I do ...
Sid Kshatriya's user avatar
38 votes
3 answers
29k views

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 ...
Daniele's user avatar
  • 661