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.

1 vote
2 answers
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 ...
2 votes
3 answers
4k 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 ...
20 votes
7 answers
71k views

how to copy entire linux root filesystem to new hard drive on with ssh and tar

I need to transfer an entire linux root filesystem off of a failing hard drive onto another computer with an open, available partition. I've pretty sure this involves tar and ssh, but I can't remember ...
0 votes
1 answer
91 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 ...
33 votes
3 answers
48k 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 ...
56 votes
5 answers
96k views

Unix cat starting from line

What is the best way to output from a file starting from a specific line (big number like 70000). Something like: cat --line=70000 <file>
0 votes
1 answer
380 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>
2 votes
1 answer
212 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_, ...
-2 votes
1 answer
54 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" ...
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 ...
1 vote
0 answers
720 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 ...
21 votes
7 answers
15k views

Cat file to terminal at particular speed of lines per second

I'm lazy and I could write a script to do this, but I'm even too lazy to think of how to do it. I often do things like : cris$ python runexperiment.py > output.txt cris$ cat output.txt ...
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/...
19 votes
7 answers
55k 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 ...
1 vote
1 answer
592 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&...

15 30 50 per page
1
2 3 4 5
10