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
32 views

What is a unix cat -e analog in windows powershell?

I use Windows 10 Powershell and I want to see a file's content with a printed $ character at the end of each line, prior to the NEWLINE. In UNIX-like systems, I can do: cat -e file_name. Could I get ...
1
vote
1answer
23 views

concatening a variable to a file using cat

I wanted to do a bash function that given a text variable, it would concatenate it to a file. i.e function print() { cat << 'EOF' >> file This $1 is a variable EOF } But it wouldnt work. ...
0
votes
1answer
495 views

how do i combine 2 pdf documents into 1 in the terminal?

I have 2 files written in Markdown which I used pandoc to convert into pdf. I now need to combine the 2 into one single document(lets say I have many that I need to combine into a single pdf). Is ...
0
votes
1answer
55 views

Are there any good ways of stopping, avoiding or killing “cat bombs” (catting a large file) when using a remote session ssh or tmux?

A common problem is when you have a remote session open (ssh or tmux for example) and you accidentally cat a large file. The screen starts dumping text and you can't kill it. I am guessing those udp ...
0
votes
3answers
358 views

perform cat via ssh, send text or file via ssh

Greetings I am making a script to automate the sending of public keys but I cannot send my file or variable through ssh either by "echo or cat"
1
vote
1answer
105 views

How to pipe stdout into stdin of optipng?

Is there any way to do something like this: (or why below code doesn't work?) type input.png | optipng -out output.png p.s: type is Windows version of cat Unix command
0
votes
1answer
35 views

(base) cat command doesn't work

as a newcomer to the world of Ubuntu, I was testing cat command. After creating a file with JOE, I tried to see its content with cat. (base) someone@computer:~$ cat sth.txt However, the result is: ...
0
votes
1answer
314 views

Using cat in conky_parse doesn't work

I'm trying to show the name of my shell in conky. I can capture the name of the shell using this command: cat /proc/$$/comm But when I use this in my script.lua file, like this: text = 'Shell: ' .. ...
0
votes
1answer
27 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
296 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
5k 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.
42
votes
2answers
5k 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?
3
votes
1answer
2k 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
911 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
278 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?
2
votes
1answer
750 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
879 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 ...
15
votes
7answers
26k views

Cat command and echo

I'd like to concatenate the output from echo with content of a file. I've tried the following comand: echo "abc" | cat 1.txt > 2.txt but the 2.txt file only contains the content from 1.txt. Why ...
2
votes
0answers
2k 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 ...
3
votes
1answer
170 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 ...
1
vote
1answer
2k 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
2k 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
8k 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 ...
4
votes
3answers
938 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
8k 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
2k 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
3k 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
279 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
143 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
120 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
168 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
884 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 ...
4
votes
2answers
8k 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
625 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 ...
11
votes
2answers
6k 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
263 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
886 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
566 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
1k 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
141 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
2k 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
11k 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
66 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
60 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 ...
13
votes
2answers
36k 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
41 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
182 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
667 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
3k 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 ...