A UNIX utility for concatenating files or input streams together. Do not use for questions about the animal.

learn more… | top users | synonyms

2
votes
0answers
29 views

Print (cat) a vim encrypted file

I used -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 ...
1
vote
1answer
21 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 ...
-1
votes
1answer
44 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?
0
votes
1answer
26 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?
0
votes
0answers
20 views

Reverse caret notation from “cat -v”

cat -v prints a file to the stdout, replacing special characters with the caret notation (e.g., the end of transmission becomes ^D). I'm looking for a way to reverse the process: I have the result of ...
0
votes
2answers
45 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?
-1
votes
3answers
20 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 ...
0
votes
1answer
27 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 ...
2
votes
1answer
279 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 ...
1
vote
0answers
42 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 ...
0
votes
1answer
28 views

Using wildcards with cat append target

I need to append the contents of two files to a third, where I don't know the exact file name of the target. Let's say it's named targetXXXXX where XXXXX is a random string. I am basically trying to ...
1
vote
2answers
433 views

pipe and stdin redirection to cat

Why does echo "hello world" | cat works while cat < echo "hello world" does not? My (incorrect) intuition is that pipe would redirect stdout to cat as stdin.
0
votes
0answers
16 views

remove last n lines of command line output? [duplicate]

When I run cat duplicates.txt I get the entire contents of the file duplicates.txt. The end of the file appears right above my command prompt. I can conveniently copy and paste content from it to my ...
0
votes
2answers
24 views

shell - multiple text insertion into each line of a file

I have a text containing coordinates of points such as x, y and z, I would like to change each line to be like: Point{ (1000+linenumber) } = {x , y, z}; What I want is: for example for line 212 ...
0
votes
1answer
52 views

/usr/bin/mail not interpreting new lines

I have a strange problem when piping a cat to mail. I have a simple text file which has been compiled from a script, which is a report on what folders were copied in the script. I then want to send ...
0
votes
2answers
53 views

What's the behaviour of `cat | less`?

I tried to run the following command: cat | less I know both commands require something from the standard input. When I run it that's what I expected: all my inputs goes to cat and I will not be ...
1
vote
3answers
172 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 ...
1
vote
1answer
32 views

Empty line appears while merging different file contents in shell script

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 /...
0
votes
1answer
85 views

Piping a line of the file read with while read loop

I am trying to read each line of the file and then assign some parts of it to variables. A line itself is read as a variable so I need to process a variable input say for cat which seems to be ...
0
votes
2answers
378 views

How to merge multiple files into single file in given directories

I want to write a shell script to merge contents of multiple files in a given directories. DIR1 contains sample1.txt sample2.txt sample1.txt contents :---this is sample1 file--- sample2.txt ...
0
votes
0answers
79 views

cat > $FILE_NAME << EOF - Explanation of the inner workings

I know what this one does, I learned "pattern like" and just works. I also know: that > is a redirect to a file that << is also a redirect to file see below EOF is just a placeholder, when ...
1
vote
1answer
2k 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 ...
0
votes
5answers
539 views

Do RJ45s need to be wired differently to enable POE (Power over ethernet) ?

On larger projects we tend to buy cat6 in drums of 1000ft, these are then run to the locations as required and RJ45s placed on the ends by the electrician, this all works fine. Were now starting to ...
0
votes
0answers
129 views

How to uninstall screen (monitor / display) drivers?

While testing out some different computer screens (also called displays or monitors) on a Windows 7 SP1 system, I installed the .INF files for each screen. I also installed the .ICM (color matching ...
2
votes
4answers
336 views

Prevent cat from opening a binary file

Is there a way to prevent or prompt you when trying to cat binary files? Oftentimes I need to work with log files or data files, some of which are text and others not. It's easy to get mixed up, and ...
0
votes
2answers
76 views

Is cat output modified by writing to the file

With a piped command sequence like: $ cat afile | somecommand | tee afile afile is both read (by cat) and written (by tee). The question is, supposing afile is at least several megabytes (or large ...
0
votes
2answers
32 views

Combine the results of a CAT and TAC in a single window in Linux

I have two log files which I would like to view on my screen simultaneously. Below you can see my commands: pi@raspberrypi ~ $ watch -n 1 tac /home/pi/log/log.txt pi@raspberrypi ~ $ watch -n 1 cat /...
1
vote
0answers
254 views

lossless concatenation of ogg vorbis files

I have a couple of ogg vorbis files, all encoded with the exact same properties that I want to concatenate into a single file. I know that the ogg vorbis format supports plain concatenation of ...
0
votes
0answers
46 views

Unix cat to Windows user

I uploaded about 6GB of video in 3 separate files created using the cat command on my Mac, thinking the recipient of those files was a Mac user as well. It turns out he's using Windows 8. How can he ...
0
votes
2answers
137 views

linux cat into file including exiting code all from copy+paste

Can I print out a code to STDOUT that would mimic the behavior of Ctrl+c inside cat? E.g. I would like my script to print out the cat command followed by the content of the file like this: cat > /...
0
votes
2answers
54 views

how to clone a directory list to another directory

I am trying clone a directory and it's subdirectories into another directory. I have hundreds of music directories with sub-directories that I want to convert from flac to ogg. I want all the music ...
1
vote
2answers
169 views

Make a web request, cat response to stdout?

I'm working from the command line. I need to cat the response of a web request. What tool can I use to make the web request and print the response on stdout? Here's the command I'm trying to make ...
1
vote
2answers
56 views

Trying to cat the result of piped commands

I have a folder of files that are named list20140801.txt list20140802.txt .... I'm trying to do this ls | sort | tail -3 | cat But it is just giving me the file names, not cat'ing them.
0
votes
1answer
31 views

Sort piped to uniq unexpected output

I have a file that looks like this: "string",192.168.1.0,,TX,192.168.1.2,,,100,0,0,10,10,10,, "string",192.168.1.0,,TX,192.168.1.1,,,100,0,0,10,10,10,, "string",192.168.1.0,,TX,192.168.1.4,,,100,0,0,...
1
vote
2answers
256 views

Adding text to the end of multiple files, minus one line( Adding return 0; at the end of each program in C)

I have a bunch of C programs from K&R and of course, no return statement. I was wondering if there was a way to cat to the end of each file (except one line before the end, so EOF - 1) the ...
1
vote
2answers
870 views

cat wc -l count lines line with defined line endings (e.g Mac OS X specific)

As any command-line user I sometimes want to count lines in text file with well known command: cat some_text_file | wc -l I face the problem on Mac OS X, which as far I have it studied is connected ...
8
votes
3answers
7k views

Change Behavior of Linux Power Button

I have a headless linux mint machine that I use for a file server and other things. It's been working great for me for a few years, but there's one issue - my cat likes to hang out on top of it, and ...
1
vote
1answer
357 views

head and cat don't recognize Microsoft Excel text files

I have a large .xls file with 53760 rows and 19 columns. I saved it as Tab Delimited Text in order to pre-process it through command line tools and load it into R later. However, when I run head ...
0
votes
2answers
663 views

Execute a command for 3 lines at a time

I'm trying to run three separate processed while reading foo.txt Here is the example: cat foo.txt | while read line do echo line1 echo line2 echo line3 echo "" done The expected output is: line1 ...
4
votes
1answer
2k views

Can cat be used to clone a partition?

For example, can I do: cat /dev/sda1 > /dev/sda2 instead of using dd, and if not, why will this not work?
1
vote
3answers
139 views

Move multiple files from filename list to a new folder

I have a list of filename in list.txt, which have 'abc1.png, abc2.png, abc3.png....'. However, I don't know the directories where the files are. I want to find all files in the txt file, and move ...
0
votes
0answers
117 views

Special and diacritic charactres using less, cat and other linux tools

I am using GNU bash, Version 4.1.10(4)-release (i686-pc-cygwin) and set up my .inputrc to allow for special characters and German umlauts etc.: set meta-flag on set convert-meta off set output-meta ...
0
votes
1answer
81 views

How to print statistics from lines in a file

I often find myself computing percentages manually after filtering through a log file to find the proportion of X or Y in it. Can this easily be achieved via common CLI tools?
3
votes
2answers
539 views

Why did my bash prompt turn to gibberish after I accidentally ran `cat` on a .coverage file?

I had just installed coverage and run it a few times when I noticed a .coverage file hanging around in my repo, which is -- according to the file utility -- a 8086 relocatable (Microsoft) file. And ...
0
votes
1answer
370 views

Why does echo work through pipe but not cat with msmtp?

This works: echo "yada yada" | msmtp my@mail.com but not this: cat yadayada.txt | msmtp my@mail.com which delivers the email with empty content. Why does echo work through pipe but not ...
0
votes
2answers
681 views

Copying a template header to multiple existing files

I have a bunch of *.csv files that use headers. Right now the files have headers and the same number of lines of data. I need to erase the data in these files, so I figured I could just overwrite the ...
2
votes
4answers
8k views

How can I stop cat output immediately despite massive output?

I'm looking for someway to stop the output to STDOUT when I realize a command is wrong. For instance, if I accidentally cat a very large file. Usually it will eventually stop if you hold down ctrl + c,...
5
votes
3answers
2k views

Is there anyway to `cat` two remote `tail -f` streams via SSH?

I wanted to combine two continuous text streams generated by tail -f into one and watch them in the same screen. Is it possible? Both text streams are line-oriented (e.g. logs), if that helps. ...
2
votes
4answers
4k views

Cannot cat file which has space in name in linux

I believe there's a simple fix but cannot debug it out. I have file called "file name with space" How do I cat this file from Linux bash ?
6
votes
6answers
19k 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 ...