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
0 answers
330 views

cat through ssh does not work, it hangs on "debug2: exec request accepted on channel 0" and scp never finishes

I trying to print a file through ssh on CentOS7 but it does not work somehow : $ time timeout 60s ssh -vvv SERVER-01 cat /etc/yum.repos.d/CentOS-Base.repo OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan ...
SebMa's user avatar
  • 1,477
0 votes
0 answers
23 views

How to navigate in mail quickly?

Hi I use mail command in my Linux terminal to access new mails. The mail which I have is very long to read, which means, I had to press 'enter 1000 times to go to the end of the message. Is there a ...
Thaatha_Paati's user avatar
0 votes
0 answers
21 views

How to make good .log files in Linux? [duplicate]

Whenever I run some program in background of my VM using LINUX, I use .log files to easily identify what has happened to the file. This is a sample on how I do it: rscript check.R | tee check.log But ...
Thaatha_Paati's user avatar
2 votes
0 answers
41 views

Cat with gun parallel does not continue as expected

Here is my code. file_name="all_parts" find parts/ -type f > ${file_name} while read part do echo processing ${part} cat ${part} | parallel -j 100 'wget {} -o logs/...
Jon Xu's user avatar
  • 21
1 vote
1 answer
291 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&...
leonbloy's user avatar
  • 645
0 votes
1 answer
48 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 ...
TheFibonacciEffect's user avatar
0 votes
1 answer
50 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 ...
cannyboy's user avatar
0 votes
1 answer
384 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 ...
Will Schubert's user avatar
1 vote
1 answer
613 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 -...
Jean's 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 "...
Belphegor's user avatar
0 votes
1 answer
143 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 ...
Laughing_Man's user avatar
2 votes
1 answer
652 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. ...
Valku's user avatar
  • 23
2 votes
1 answer
3k 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 ...
First User's user avatar
0 votes
1 answer
113 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 ...
mathtick's user avatar
  • 235
0 votes
3 answers
1k 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"
lainer's user avatar
  • 1
2 votes
1 answer
233 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
Mehdi Dehghani's user avatar
0 votes
1 answer
920 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: ...
fgh's user avatar
  • 81
0 votes
1 answer
488 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: ' .. ...
Amir Shabani's user avatar
0 votes
1 answer
30 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\...
Primo's user avatar
  • 11
0 votes
1 answer
915 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 ...
Buadhai's user avatar
  • 111
3 votes
0 answers
8k 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.
maximilian2000's 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?
haboutnnah's user avatar
5 votes
1 answer
3k 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 ...
StarCrashr's user avatar
3 votes
1 answer
2k 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 ...
user14492's user avatar
  • 140
0 votes
1 answer
367 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?
Evan Carroll's user avatar
  • 8,261
2 votes
1 answer
995 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 ...
Madhur Ahuja's user avatar
  • 1,887
1 vote
1 answer
2k 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 ...
Tomilov Anatoliy's user avatar
17 votes
7 answers
44k 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 ...
Ringger81's user avatar
  • 1,057
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 ...
air's user avatar
  • 21
3 votes
1 answer
303 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 ...
Ben's user avatar
  • 33
1 vote
1 answer
4k 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 ...
Jo Shepherd's user avatar
0 votes
0 answers
3k 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 ...
Erik's user avatar
  • 1,329
1 vote
1 answer
13k 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 ...
prosseek's user avatar
  • 5,754
4 votes
3 answers
2k 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....
cannyboy's 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 ...
deostroll's user avatar
  • 1,795
1 vote
1 answer
3k 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 ...
bordenE's 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 ...
Wup123's user avatar
  • 51
1 vote
1 answer
538 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 ...
Camille Goudeseune's user avatar
0 votes
1 answer
157 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 ...
dronus's user avatar
  • 1,860
-4 votes
2 answers
121 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....
alhelal's 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 ...
Ranger's user avatar
  • 703
-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 ...
Tom Scott's 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 ...
Jim M's user avatar
  • 141
4 votes
2 answers
11k 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 ...
Markysm's user avatar
  • 41
0 votes
1 answer
949 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 ...
sober's user avatar
  • 75
14 votes
2 answers
8k 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 ...
Pablo Matias Gomez's user avatar
1 vote
1 answer
392 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 ...
diego9403's user avatar
  • 897
0 votes
1 answer
1k 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?
Pengiuns's user avatar
0 votes
1 answer
788 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?
ather05's user avatar
0 votes
2 answers
2k 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?
Not Amused's user avatar