The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
3answers
51 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
18 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
42 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
98 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
46 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 ...
0
votes
1answer
88 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
88 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
51 views

How to uninstall screen (monitor / display) drivers?

I was testing out some different computer screens (displays / monitors) on a Windows 7 SP1 system, and so I installed the .INF files for each screen. I also installed the .ICM (color matching ...
2
votes
4answers
161 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
39 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
26 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
113 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
35 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
73 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
47 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
94 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
47 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
27 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,, ...
1
vote
2answers
190 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 ...
0
votes
2answers
447 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 ...
9
votes
1answer
207 views

Security concerns of displaying ssh private key

I've made I huge mistake, or at least I think it is: I've "catted" my private SSH key cat ~/.ssh/id_rsa I'm now afraid that I've created a security hole, allowing other users to see my private key ...
4
votes
2answers
3k 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
199 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
345 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 ...
3
votes
1answer
728 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
107 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
96 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
50 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?
2
votes
2answers
372 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
315 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
485 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 ...
1
vote
4answers
5k 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 + ...
5
votes
3answers
1k 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. ...
1
vote
4answers
2k 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 ?
4
votes
6answers
13k 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
1answer
205 views

Write output to $TMPDIR/$variable : file does not exist (should be created)

I have the following .sh script in which I am trying to do all major writing in $TMPDIR. However, when it gets to line 86, it returns the following error: ...
1
vote
1answer
126 views

How to prepend contents of a file to another

This question relates to the already asked question How to add text to beginning of file The answer suggested by Dennis Williamson does the job: echo 'task goes here' | cat - todo.txt > temp ...
0
votes
1answer
107 views

cat command outputs the whole directory when used in a bash script

I have a scirpt like this: #!/bash/bin file=`cat /proc/net/arp` echo $file And when I run the script it outputs the whole folder where the script is like this: IP address HW type Flags HW address ...
0
votes
1answer
366 views

Combining multiple data files with header while also adding a data column

I have multiple tab delimited data files that are separated by month in the format jan06.txt, feb06.txt, ..., dec07.txt. Within each file, it looks something like: Header1 Header2 Header3 ... Data1 ...
5
votes
5answers
10k views

How to display the file contents recursively?

I always have to submit the source codes in my printed assignment report. I have to copy and paste my course codes into the document and I find that it is an annoying task. I want to solve this "copy ...
1
vote
1answer
88 views

How do I create a new file with text outputted from a command?

I just want to create a file with the outputted text from a command, rather then copying and pasting & making a new file by hand. I'm on a unix machine - how do I do this?
1
vote
1answer
867 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 ...
0
votes
1answer
93 views

What is going wrong with cat

i have a very basic cat problem. I have 23 files, all is one line and around 100000 columns. I am trying to merge these one lines. I type the command cat test1 test2 > outcome The command line is not ...
4
votes
1answer
1k views

Escaping Variable in Cat

I'm trying to write a shell script over ssh via a bash prompt. The shell, however, insists on interpreting any variable I want to write instead of writing it directly to file. For example, cat ...
5
votes
1answer
255 views

Read non-blocking from multiple fifos in parallel

I sometimes sit with a bunch of output fifos from programs that run in parallel. I would like to merge these fifos. The naïve solution is: cat fifo* > output But this requires the first fifo to ...
1
vote
1answer
53 views

Creating a new file that has one line added to to the first line and one line added to the last

I need help or I will do this is python instead (by reading one line at a time) which I know I should not need to. I have large number of text files that I get using find. FILES=$(find ... -iname ...
2
votes
0answers
269 views

Linux: cat /dev/video0 TS into some kind of ring puffer

I want to cat a /dev/video0 device output (Transport Stream) into a temporary ring buffer. In fact i do not want that the file is growing over the time. Simultaneously access is not possible. So the ...
1
vote
1answer
82 views

What to expect in permanent installations of ethernet cable

In my line of work I recently encountered someone who had a DHCP problem, but only with certain hardware and only via certain cables. The cables that we found out caused the problems were in the walls ...
10
votes
1answer
5k views

Why is cat not changing the access time?

The second call to cat a file does not update the access time. I was expecting the access time to be updated ever time a file contents gets displayed. I see the same behaviour if I open the file in ...
6
votes
4answers
5k views

Can I use pipe output as a shell script argument?

Suppose I have a bash shell script called Myscript.sh that need on argument as input. But I want the content of the text file called text.txt to be that argument. I have tried this but it does not ...