Questions tagged [cat]

29 questions
2
votes
2 answers

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 file it came from. How can I locate the string, and…
wjimenez5271
  • 729
  • 2
  • 6
  • 16
1
vote
2 answers

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 to create the real file (all.txt) because it might…
1
vote
1 answer

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/html/filter/unfiltered.txt | awk '{print $1}' >…
LinHost
  • 39
  • 5
1
vote
3 answers

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: A A B C C B A A And I perform this command…
IVR Avenger
  • 325
  • 1
  • 5
  • 16
1
vote
1 answer

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 (AK, AL, AR, etc.). How can I use cat to combine…
1
vote
4 answers

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 this better? cat command does not see me to have an…
0
votes
2 answers

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 Dell PERC H810, and it's formatted with ext4. The…
0
votes
1 answer

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 executing this command, I get the following error cat:…
Ryan
  • 181
  • 1
  • 2
  • 6
0
votes
1 answer

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 my command as command $( cat [arguments-file] )…
mklauber
  • 133
  • 1
  • 6
0
votes
2 answers

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 X3440 @ 2.53GHz stepping : 5 cpu…
Treat
  • 25
  • 3
0
votes
2 answers

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 here? cp and rsync didn't work either for some…
0
votes
2 answers

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 firewalls openings, in the middle, which allow us to…
rpiga
  • 3
  • 1
  • 2
-2
votes
1 answer

cat /dev/zero | pv > /dev/null

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
  • 318
  • 2
  • 5
  • 19
-3
votes
3 answers

Trying to double the size of a file fails

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 increasing it's size (I was hoping I could just cat it…
Rumbles
  • 994
  • 1
  • 12
  • 28
1
2