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
1 vote
1 answer
22 views

How does Git for Windows' cat.exe deal with charset encoding?

I'm testing the behaviour of Windows terminal (cmd.exe) in relation to charset encodings. I have some test files in several encodings (Win1252, CP437, UTF-8, etc) with the Spanish text: "qué tal&...
user avatar
  • 635
0 votes
1 answer
20 views

Set default editor [duplicate]

I would like to configure a program named howdy which allows you to login using your face. For this I need to edit the config file to add the path to my camera. However when I execute sudo howdy ...
user avatar
0 votes
1 answer
37 views

Concatenate pairs of mp3 files with ffmpeg or cat?

I've got a directory of mp3 files, which look a little like this: Blue Elephant part 1.mp3 Blue Elephant part 2.mp3 Tale of Two Cities part 1.mp3 Tale of Two Cities part 2.mp3 Lookism part 1.mp3 ...
user avatar
0 votes
1 answer
77 views

How to cat a local file to a remote printer using Linux

On DOS we can: NET USE LPT1: \\remote-pc\shared_printer COPY file.txt > LPT1 I know on Linux I can print to local usb printer: cat file.txt > /dev/usb/lp2 But how to print to a remote (Linux ...
user avatar
1 vote
1 answer
213 views

Is there a way to pass an ffmpeg command from a text file in Windows?

I was wondering if there was a way to pass one (or multiple) arguments from a text file for ffmpeg. I tried a bit here with this in powershell (expecting it to work like linux but to no avail ffmpeg -...
user avatar
  • 11
0 votes
2 answers
31 views

if statement - simple bash scripting

I am working on a simple script that checks if there is .vimrc file and what is configured in that file: if [ "$(ls -a /root | grep .vimrc)" = ".vimrc" ]; then echo "...
user avatar
0 votes
1 answer
69 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 ...
user avatar
1 vote
1 answer
76 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. ...
user avatar
  • 13
0 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
  • 174
0 votes
3 answers
811 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"
user avatar
  • 1
1 vote
1 answer
161 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
user avatar
0 votes
1 answer
138 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: ...
user avatar
  • 71
0 votes
1 answer
369 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: ' .. ...
user avatar
0 votes
1 answer
29 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\...
user avatar
  • 11
0 votes
1 answer
580 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 ...
user avatar
  • 11
2 votes
0 answers
6k 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.
user avatar
42 votes
2 answers
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?
user avatar
3 votes
1 answer
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 ...
user avatar
3 votes
1 answer
1k 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 ...
user avatar
  • 140
0 votes
1 answer
317 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?
user avatar
  • 7,988
2 votes
1 answer
846 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 ...
user avatar
  • 1,847
1 vote
1 answer
1k 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 ...
user avatar
17 votes
7 answers
34k 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 ...
user avatar
  • 957
2 votes
0 answers
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 ...
user avatar
  • 21
3 votes
1 answer
245 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 ...
user avatar
  • 33
1 vote
1 answer
3k 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 ...
user avatar
0 votes
0 answers
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 ...
user avatar
  • 1,259
1 vote
1 answer
10k 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 ...
user avatar
  • 5,505
4 votes
3 answers
1k 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....
user avatar
7 votes
7 answers
9k 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 ...
user avatar
  • 1,745
1 vote
1 answer
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 ...
user avatar
  • 11
0 votes
2 answers
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 ...
user avatar
  • 51
1 vote
1 answer
376 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 ...
user avatar
0 votes
1 answer
152 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 ...
user avatar
  • 1,780
-4 votes
2 answers
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....
user avatar
  • 121
0 votes
1 answer
172 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 ...
user avatar
  • 693
-1 votes
2 answers
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 ...
user avatar
  • 173
1 vote
2 answers
1k 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 ...
user avatar
  • 141
4 votes
2 answers
10k 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 ...
user avatar
  • 41
0 votes
1 answer
799 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 ...
user avatar
  • 67
12 votes
2 answers
7k 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 ...
user avatar
1 vote
1 answer
289 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 ...
user avatar
  • 897
0 votes
1 answer
944 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?
user avatar
0 votes
1 answer
600 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?
user avatar
0 votes
2 answers
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?
user avatar
-1 votes
3 answers
144 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 ...
user avatar
  • 1
1 vote
1 answer
3k 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 ...
user avatar
  • 199
2 votes
1 answer
13k 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 ...
user avatar
  • 135
1 vote
0 answers
69 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 ...
user avatar