Questions tagged [cat]
A UNIX utility for concatenating files or input streams together. Do not use for questions about the animal.
143
questions
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 ...
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"
...
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 ...
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/...
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&...
0
votes
1
answer
83
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 ...
0
votes
1
answer
93
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
...
0
votes
1
answer
613
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 ...
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 -...
0
votes
2
answers
58
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 "...
0
votes
1
answer
204
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 ...
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. ...
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 ...
0
votes
1
answer
180
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
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"
2
votes
1
answer
325
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
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:
...
0
votes
1
answer
693
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
1
answer
33
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
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 ...
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.
42
votes
2
answers
6k
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?
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 ...
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 ...
0
votes
1
answer
411
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
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 ...
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 ...
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 ...