Questions tagged [cat]

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

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

How to add a counter starting from a number other than 1?

I have a file where I need to add 200 more lines, but I'd like to know how to renumber them automatically. The file has the following structure: col1\tcol2\tdb4444\tcol4\tcol5\tcol6\tcol7\tcol8\tcol9\...
0
votes
1answer
77 views

How can I detect/remove special characters from this short text file?

This is the contents of a short text file created by an AppleScript written by someone else: Search time: Sunday April 28, 2019 at 07:21:07 Search complete. Nothing found. But, when I use cat I get ...
1
vote
0answers
1k views

CMD equivalent of cat >> text.txt

type >> text.txt doesn't work on Windows. I want it to prompt me to enter text into the document and then allow me to finish by entering control + d.
40
votes
2answers
4k views

Why can I cat /dev?

I can cat /dev, I can ls /dev, I can't less /dev. Why does cat let me cat this directory but no other directories?
2
votes
1answer
602 views

Cat hangs when attempting to read empty STDIN

My script attempts to gather information that may or may not be present in STDIN at execution time, but cat hangs if the pipe is empty. How can I ensure that my script skips this step if this there is ...
3
votes
1answer
248 views

What is the “next cell character” when coping and pasting from a table?

You know when you copy a row from a table and paste it into another one it is in the correct place. So what is the character that is between cell values when this operation is performed. Eg. I have ...
0
votes
1answer
177 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?
1
vote
1answer
288 views

cat and grep with a huge file - Broken pipe

I am tryting to cat and grep a huge 40 GB file. After some output, my process get killed. Any idea what can be the issue? Using OSX [1] 37392 broken pipe cat output.txt | 37393 killed ...
1
vote
1answer
166 views

Append to compressed log

There is a couple of z-utilities (zless, zcat), which are able to read contents of zipped file in transparent manner. Is it possible to append to compressed log file (in either format, not ...
0
votes
0answers
1k views

the hash for the file is not present in the specified catalog file- Creating a .cat file for an edited .inf?

I got a rock candy xbox360 controller today and its not plug and play as an xbox 360 controller on pc. I edited the .inf file and now the driver may work, but i dont know how to make the .bat file ...
2
votes
1answer
93 views

Running 'cat' on a file opens the print dialog?

On a whim today, I ran the 'cat' command on a VirtualBox virtual disk image (VDI) file. As expected, a variety of gibberish was output to the stdout on the console. However about 15 seconds into ...
0
votes
1answer
1k views

select columns on cat command

I use a file as a little db table. The content is like this: client1 john doe engineer cal client2 jane doe nurse ny client3 ali veli doctor ny I want to find ...
0
votes
0answers
1k views

How to sign drivers properly for Windows 10

I am currently developing drivers for Windows 10, and I also have a code-signing certificate. When I sign my files, they get the signature and a hash set in the properties. However, Windows 10 refuses ...
1
vote
1answer
4k views

cat command with a variable that has spaces

I need to use cat command to display the contents of a file, and the filename has spaces in them: "embedded board link.rtf". I assign the filename using a variable: I="embedded board link.rtf", but ...
3
votes
2answers
499 views

Add text to list of files

I'm trying to use xargs to manipulate a set of files. A file called filelist.txt contain the file names john paul george ringo steve I can create all these files with this command: cat filelist....
7
votes
7answers
4k views

What is the equivalent of Bash's cat -n in PowerShell?

I want to cat a file and output the line number of each line it outputs. However, in PowerShell, cat outputs an array. Hence the question effectively becomes: How do I print the index of each item ...
1
vote
1answer
786 views

How to overwrite with a pipe in unix

So I am attempting to overwrite using a pipe: //reads contents of file| turns lowercase to uppercase | changes $ to # | // then attempts to overwrite original file with new version cat ...
0
votes
2answers
432 views

CAT6 Actually Slowing down connection

I previously had cat5 from my router in the garage run through my house to my room. I then have that go into a gigabit switch, which goes to the computers throughout the room. Now that I have put in ...
1
vote
1answer
183 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 ...
0
votes
1answer
97 views

Check success of remote file append via ssh

I like to periodically append some data to a remote file via ssh and remove it locally. Like: cat some_lines_to_append.txt | ssh user@example.com 'cat >> all_lines_collected.txt' rm ...
-4
votes
2answers
108 views

How to delete line which have only number using vim/grep/cat/awk?

I have this text which will be considered further in Chapter 6 Siannis et al., 2005 Crowther and Lambert, 2013a Schumacher et al., 1994 2014 df=4 2005 2005 0, 1 4....
0
votes
1answer
134 views

Adding Tag Data to File

For a security product (data loss prevention) my group is trying to tag files with specific keywords to allow for HR/Legal to specifically flag files for tracking by our DLP software. Currently the ...
-1
votes
2answers
2k views

How to display only the last paragraph of text in a file using cat?

I have been set a challenge for an assignment at school and can't find the answer anywhere. I have a text file called tomtextfile and the question states 'Use the cat command, suitably modified, to ...
1
vote
2answers
561 views

Is it safe to split large encrypted GnuPG file then cat and decrypt later?

I have a GnuPG encrypted tar.gz file that is about 20 GB in size and I need to split it then backup to another machine. Is it safe to split large encrypted GnuPG file without compromising security ...
3
votes
2answers
5k views

Piping commands into nc

I've seemingly searched many very similar questions but never quite found something to work. I'm trying to use a raspberry pi (2nd gen) to communicate with a Wifi OBDII sensor. I'm able to use the ...
0
votes
1answer
383 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 ...
9
votes
2answers
3k views

Print (decrypt) a vim encrypted file

I use the -x option in vim to encrypt a file. I read this files much more times than I write to it, so I always use cat and then remember it is encrypted because of what it shows.. So then I have to ...
1
vote
1answer
161 views

cat files from pipe

I have to join files to one original file, which was split. There is a catalog, in which there are a lot of files,but no every is necessary. I have file with md5sum, which contain md5sum files I have ...
0
votes
1answer
478 views

Can router bottleneck LAN traffic over Ethernet?

Say I have a 100mb router and I'm using cat 6 cables connecting 2 PCs to the router, will I be able to achieve 1gb transfers between the 2 PC's via the network or will it only get upto 100mb?
0
votes
1answer
446 views

Tar & save the output of a command

I want to tar the output of a command, say cat hello.world, to a compressed tar file. I don’t want to save a temporary file and later tar it manually. How can I do this?
0
votes
2answers
774 views

Recover text file that I deleted with “cat” command

I used cat > filename while not thinking about it, then hit ctrl + c and naturally enough the file is now empty... Is there a way to recover that file's contents?
-1
votes
3answers
103 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 ...
1
vote
1answer
990 views

To print values in diferent line in mail body shell script

Below is the code to print contents of files present in the directory File contents are : apple banana grapes mango names=() FILES=/path_to_dir/* for f in $FILES do names+=($f) done ...
2
votes
1answer
5k views

Receiving data from Serial Port

I want to receive data from RS232 Serial port to my terminal and with a directive to a file. It should be pretty straight forward. cat /dev/ttyS0 cat /dev/ttyS0 > file.txt Before that I've ...
1
vote
0answers
65 views

Cat playing with mouse broke my Windows/Explorer :( Cannot click buttons in most of standard apps/menus

My mouse was laying on a sofa (I was going to clean it a bit) and my cat suddenly decided to play with the mouse (while the start menu was opened). Nothing serious happened with it during these 10 ...
0
votes
1answer
55 views

Using wildcards with cat append target

I need to append the contents of two files to a third, where I don't know the exact file name of the target. Let's say it's named targetXXXXX where XXXXX is a random string. I am basically trying to ...
6
votes
2answers
21k views

pipe and stdin redirection to cat

Why does echo "hello world" | cat works while cat < echo "hello world" does not? My (incorrect) intuition is that pipe would redirect stdout to cat as stdin.
0
votes
2answers
37 views

shell - multiple text insertion into each line of a file

I have a text containing coordinates of points such as x, y and z, I would like to change each line to be like: Point{ (1000+linenumber) } = {x , y, z}; What I want is: for example for line 212 ...
0
votes
1answer
136 views

/usr/bin/mail not interpreting new lines

I have a strange problem when piping a cat to mail. I have a simple text file which has been compiled from a script, which is a report on what folders were copied in the script. I then want to send ...
0
votes
2answers
385 views

What's the behaviour of `cat | less`?

I tried to run the following command: cat | less I know both commands require something from the standard input. When I run it that's what I expected: all my inputs goes to cat and I will not be ...
1
vote
3answers
2k views

add new line after every end of file's contents while merging multiple files

I have written shell script to merge different file's contents I have created directories f1,f2,d1,d2 and files under them , I need to merge all files's contents : comand is (find /home/ah5024331/f1 ...
1
vote
1answer
65 views

Empty line appears while merging different file contents in shell script

I have written shell script to merge different file's contents I have created directories f1,f2,d1,d2 and files under them , I need to merge all files's contents : comand is find /home/ah5024331/f1 /...
0
votes
1answer
140 views

Piping a line of the file read with while read loop

I am trying to read each line of the file and then assign some parts of it to variables. A line itself is read as a variable so I need to process a variable input say for cat which seems to be ...
0
votes
2answers
1k views

How to merge multiple files into single file in given directories

I want to write a shell script to merge contents of multiple files in a given directories. DIR1 contains sample1.txt sample2.txt sample1.txt contents :---this is sample1 file--- sample2.txt ...
0
votes
0answers
599 views

cat > $FILE_NAME << EOF - Explanation of the inner workings

I know what this one does, I learned "pattern like" and just works. I also know: that > is a redirect to a file that << is also a redirect to file see below EOF is just a placeholder, when ...
11
votes
2answers
16k views

Using -replace on pipes in powershell

I want to test out a replace before I use it, so I'm trying to write a quick online command to see what the output is. However, I'm not sure what the syntax is. What I want to do is something like ...
0
votes
0answers
467 views

How to uninstall screen (monitor / display) drivers?

While testing out some different computer screens (also called displays or monitors) on a Windows 7 SP1 system, I installed the .INF files for each screen. I also installed the .ICM (color matching ...
2
votes
4answers
1k views

Prevent cat from opening a binary file

Is there a way to prevent or prompt you when trying to cat binary files? Oftentimes I need to work with log files or data files, some of which are text and others not. It's easy to get mixed up, and ...
0
votes
2answers
341 views

Is cat output modified by writing to the file

With a piped command sequence like: $ cat afile | somecommand | tee afile afile is both read (by cat) and written (by tee). The question is, supposing afile is at least several megabytes (or large ...
0
votes
2answers
59 views

Combine the results of a CAT and TAC in a single window in Linux

I have two log files which I would like to view on my screen simultaneously. Below you can see my commands: pi@raspberrypi ~ $ watch -n 1 tac /home/pi/log/log.txt pi@raspberrypi ~ $ watch -n 1 cat /...