Skip to main content

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
1 answer
73 views

How to get the return value of pipe and executable on Windows

I am running some unit tests which involve piping into my executable, like this. cat text.txt | my_exe --options Running these commands, how do I get the return value of my_exe? Even when my_exe ...
scx's user avatar
  • 173
0 votes
1 answer
286 views

how to output only a specific known line number using cat or head/tail

I know how to use head or tail to output a certain number of lines, but how do I output only a specific line number(s)? Something like: head --only-line=73 <file>
Oliver Williams's user avatar
2 votes
1 answer
192 views

cat files based on substring match

I have file names in the following format and I would like to cat files based on substring match(Orange,Apple) and a constant(S4,S5), file names example _S6_trimmed_, _S8_trimmed_, _S9_trimmed_, ...
user1967473's user avatar
-2 votes
1 answer
53 views

Atime don't change on mounted drive

i have CentOS Stream 9. when i mount a usb drive and create a file using touch command the Access time in stat command don't change and stays: "Access: 2023-06-20 03:00:00.000000000 +0300" ...
dshman's user avatar
  • 1
1 vote
0 answers
706 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,863
2 votes
0 answers
44 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
567 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
  • 685
0 votes
1 answer
80 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
91 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
601 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
1k 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
45 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
200 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
1k 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
5k 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
178 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 ...
safetyduck's user avatar
0 votes
3 answers
2k 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
322 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
1k 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
678 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
31 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
1k 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
11k 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
6 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
410 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
  • 9,027
2 votes
1 answer
1k 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,919
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
19 votes
7 answers
54k 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,217
2 votes
0 answers
3k 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
360 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
6k 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
4k 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,397
1 vote
1 answer
15k 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,964
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
10k 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,805
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
4k 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
594 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
168 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 [email protected] 'cat >> all_lines_collected.txt' rm ...
dronus's user avatar
  • 1,908
-4 votes
2 answers
123 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
174 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
2 votes
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
  • 151
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
1k 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
9k 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
454 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
  • 907
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