Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [cat]

cat is a standard Unix utility used for concatenating files or printing specific file on the standard output.

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
849 views

slow file transfer through serial port with cat

I'm transferring a binary file to an embedded device using a custom AT command set. I'm running Lubuntu Linux on a virtual machine (Windows 7 host) and the virtual linux guest controls the physical ...
3
votes
0answers
258 views

how to disable keyboard on debian 9 with shortcut?

I want to know if it's possible to configure Debian 9 to dedicate one key on the keyboard to disable the the rest of the keyboard. I'm trying to watch something and my cat keeps walking on the ...
2
votes
0answers
209 views

Data loss over ttyACM* when 'cat' command is used for data transfer

I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3. I have followed the following procedure for ...
2
votes
1answer
233 views

How to upload a file and then check it and run some other commands using only ssh, cat, and diff in a single SSH session?

The goal is to change some parameters on a lot of devices on connections that are kind of unreliable (wireless)--according to csv that has the format: IP,Parameter,Parameter I would like to make a ...
2
votes
0answers
3k views

cat /dev/ttyS0 Input/output error

I created infrared receiver as in LIRC manual (http://www.lirc.org/receivers.html). And tested it on windows using program called Terminal. When I switched on RTS pin DCD pin was also switched on ...
1
vote
0answers
31 views

PING token missed after un-successful Bulk OUT transfer

I'm trying to send a large amount of data(~15 Mb) from Host to Device over ttyACM3. I have used "cat" command for sending the data from host. Host side: cat ./pattern.bin > /dev/ttyACM3 Device ...
1
vote
0answers
829 views

Counting User Agent visits from the access log for just the last 30 days

I'm trying to print a list of the most frequent visits from User Agents from the Nginx access log. I have so far come up with this: cat /var/log/nginx/access.log | awk -F\" '{print $6}' | sort | ...
1
vote
0answers
794 views

Get contents of a .gz file over SSH and pipe it to zcat and mysql

I have a recent.sql.gz file on a remote server. What I try to accomplish is the following: I want to open the file, push the content over SSH to my local machine, use zcat to uncompress the content ...
1
vote
0answers
677 views

dd and cat both reporting no space left on device

I have a windows 8.1 Pro laptop with a 500GB HD and a 500GB portable USB HD. I boot up my laptop with a linux live CD so that I can use dd or cat. Testing cat: cat /dev/sda > /dev/sdc cat: write ...
1
vote
1answer
370 views

Concat all remotely distributed files in your cluster

I want to concatenate all abc_2015-12-15.txt files present on my cluster.Is there any best way to achieve this ? One way is to use below command across all nodes till all files concatenated :- ssh ...
1
vote
0answers
92 views

How to convert a merged file generated by cat command into individual files in terminal?

I have already merged several files into one file using cat command in linux. Now, I need the individual files; please let me know how I can recover individual files from merged file? Thanks a lot
1
vote
0answers
305 views

overlayfs root filesystem, cannot read /etc/mtab

I'm doing the following: mkdir /tmp/upper /tmp/work mount -t overlay overlay -o lowerdir=/,upperdir=/tmp/upper,workdir=/tmp/work / ls -l /etc/mtab > lrwxrwxrwx 1 root root 19 27. Feb 09:16 /etc/...
0
votes
2answers
24 views

find complete text in a one file and replace the string in another file

I have data like this in Source_file.txt 5daee1ef55297ba2fac78933 And in Target_file.txt has $$API_JOB_ID=5daed2a255297ba2fac78930 $$API_JOB_RES=succeeded $$API_SERVER=awsabc1108 Now, I need to ...
0
votes
0answers
29 views

Non blocking cat (Read as much data as you can from stdin and hold it in RAM until a write-blocking stdout becomes available)

I have a program (which may or may not be aplay) that accepts its stdin rather slowly. Programs that write to said stdin (such as via a pipe) tend to block on writes a lot. Needing to wait on input ...
0
votes
0answers
18 views

How do I monitor a Socat mounted COM Port device for a specific Char Delimiter?

I have a code like the following: cat -v -e /dev/tty03 | grep --line-buffered '^F' | while read do echo "Line Found" done How can I setup a timeout for the above While Loop. I want the "while" ...
0
votes
1answer
19 views

replace/remove text (sed) by a file

I want to replace/remove text all files by a file. $ echo "_uU_%UHY%^GSSD$%GWRW$T#wf4werwefF$fW#$wfdd%6blahblahblah" > pattern.txt $ sudo grep -rl "_uU" . | xargs sed -ie s/$(cat pattern.txt)//g ...
0
votes
0answers
85 views

How to convert visible control characters back to non-printing characters (opposite of 'cat -v')?

Given the content of the file which was the result of cat -v conversion such as: M-*M-;M-LM-]M-n How can I convert back the file to the original binary format? For example, given the following ...
0
votes
3answers
61 views

multiple concatenation of strings without writing intermediate files

I would like to extract parts of some files and concatenate them into another but without writing an intermediate file. For instance: $ cat textExample.txt Much I marvelled this ungainly fowl to ...
0
votes
0answers
49 views

keep reading files in an updated dir

I have directory, that gets new .gz files during the day. I'd like to have a scripts that I start in the morning, and which keeps reading the data (and possibly processing it) as the new files are ...
0
votes
0answers
151 views

What is the fastest command to trim the header of a csv file?

I need to trim the header in a csv file. I have used tail -n +2 ... which works fine but it is really slow (I have lots of 100M files), and I don't understand why since no memory is needed from tail ...
0
votes
1answer
97 views

cat multiple file in script truncates data when scheduled in cron

I'm cat'ing multiple files in a bash script on OEL 6. for f in /share/scripts/stats/*.stat; do (cat "${f}"; echo) >> /share/scripts/stats/finalmail.html; done When the script is triggered ...
0
votes
1answer
937 views

Piping cat to sendmail not respecting new lines

I have a script which runs a few sanity checks, outputs the results to a file which is then concatenated and piped to a sendmail function as so: { echo "$headers"; echo; cat health_check.log; } | ...
0
votes
1answer
171 views

concatenate .doc files with cat

I'm trying to concatenate several .doc files none of them bigger than 15 KB, I'm trying the usual cat file1.doc file2.doc file3.doc > new_file.doc But despite the result is an almost 200 KB new ....
0
votes
1answer
521 views

how to send data from serial port to printer?

I have a telephone system that is connected to my old Ubuntu machine and is receiving SMDR data from it. Connected to dev/lp0 is a dot matrix printer, phone system connected to /dev/ttyS0 Currently I ...
0
votes
1answer
33 views

data from text file in a form of text

I have multiple directories (different names) which contain text files of he same name. I have to extract lines (numerical values) from those text files and create a single text file with a list of ...
0
votes
1answer
38 views

How to code automatic uncompression of files in sh?

I'm coding a shell script, that processes log-files. Sometimes the files may be compressed -- and have the appropriate suffix in the file name. I'd like to add the decompression to the file-...
-1
votes
2answers
269 views

How to concatenate only identical file names within two folders to one file?

I have fasta.qz sequence files with identical names, but in two different folders that I need to concatenate (concatenate always those two with identical names only!). The directory structure looks ...
-2
votes
2answers
4k views

What is the difference between “grep -c ^b example” and “grep ^b example| cat –n”?

I'm trying to learn command line better and wondering what the difference between these two commands would be. grep -c ^b example and grep ^b example| cat –n