The tag has no wiki summary.

learn more… | top users | synonyms

17
votes
2answers
8k views

What is the Windows equivalent of the Unix command cat?

I want to do exactly what unix "cat" does, but on my PC. Is there a simple equivalent command for the Windows command line? Specifically I want to create a file from all the files of a given type in ...
16
votes
6answers
979 views

What is the general consensus on “Useless use of cat”?

When I pipe multiple unix commands such as grep, sed, tr etc. I tend to specify the input file that is being processed using cat. So something like cat file | grep ... | awk ... | sed ... . But ...
9
votes
3answers
6k views

Are there any options to let cat output with color?

If I want to output a C source code file with syntax highlighting, can I use cat?
7
votes
2answers
252 views

Xargs and Wget stops working after an hour

Running script with Cygwin on Windows XP with Dual Core and 4GB Ram cat url_list.txt | xargs -P50 wget -i I am trying to trawl through 4GB of URL to download (approx 43 Million) Works okay for ...
5
votes
3answers
663 views

Is it wasteful to call cat?

I'm sorry if this question is really stupid, but this is basically what I have been thinking about constantly: Suppose I run : cat ./somefile.txt a few hundred times a second. How much faster is my ...
5
votes
3answers
944 views

Showing the line count of a specific file

Is this the correct way to show the line count of a specific file? cat file | grep * -c
4
votes
4answers
7k 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>
4
votes
1answer
856 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 ...
4
votes
2answers
817 views

Concatenate files over FTP

I have a list of files on an FTP server that I would like to concatenate remotely. They are quite large so I would prefer not to download them. The reason I'm in this situation is because I ...
3
votes
5answers
2k views

Concatenating files from multiple subdirectories

Say I have a directory structure that looks like this: file1.txt folder1/ file2.txt folder2/ file3.txt How can I concatenate file1.txt, file2.txt, and file3.txt into a single file? Edit: ...
3
votes
2answers
189 views

Let less work like cat, if only one screen full of text

On my Debian machine here, less always opens the alternate screen to show stuff. This is annoying, if there are only 2 or 3 lines to be displayed. I'd like less to: work as pager, if there is more ...
3
votes
2answers
148 views

Cat command output varies unusually in regards to * character

I'm running the following command on a fairly standard Ubuntu 11.04 installation running under vSphere: sudo cat /home/*/.ssh/authorized_keys Basically, I am using puppet for ssh key management and ...
3
votes
4answers
2k views

List only the device names of all available network interfaces

I want to get a list of all available Network-Device Names on my Linux server. I figured that netstat -a would do the job, however netstat produces quite much output: eth0 Link encap:Ethernet ...
3
votes
2answers
325 views

MacOSX 10.6.7 cuts off stdin at 1024 chars

I've written a little perl script that I invoke as follows: perl -pe'...' <a I wanted to copy the contents of the input file 'a' from a web browser (a whole wordpress blog entry, to be exact). ...
2
votes
2answers
910 views

Linux cat example

Can You please explain me why: 'cat < file.txt > file.txt ' makes file.txt empty ?
2
votes
3answers
962 views

Is there a way to reassemble files split without enumerating all of the parts explicitly?

I used split -b 32m "file.bz2" "file.bz2.part-" to split a file and it created more than 50 parts. From googling, the way I found to reassemble the parts is to cat file.bz2.part-aa file.bz2.part-ab ...
2
votes
4answers
490 views

Linux shellscript combine all files without for loop

I have hundreds of files in one directory, is there a simple command or pipes of command I can use to append them together? I don't want to use any loops.
2
votes
3answers
5k views

Why does this not work? “ls *.txt | xargs cat > all.txt” (all files into single txt document)

Why does this not work? ls *.txt | xargs cat > all.txt (I want to join the contents of all text files into a single 'all.txt' file.) find with -exec should also work, but I would really like to ...
2
votes
1answer
219 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 ...
2
votes
2answers
1k views

Bash “Permission denied” issue when trying to append to EOF

When trying to push a couple lines to the end of a file, I get a permission issue. I understand why I'm getting the error, but I can't think of a way to resolve it. Any help would be appreciated. ...
2
votes
2answers
135 views

Why does cat not use options the way I expect UNIX programs to use switches?

I have been a UNIX user for more years than I care to think about, and in that time I have been trained to expect that when contradictory switches are given to a program the last one wins. Recently I ...
2
votes
2answers
378 views

Utility to cat/gunzip a list of files

Is there a commonly-installed Linux utility that will take a list of files and cat or gzip -d (==zcat) them based on whether the file is compressed? An example of where I just needed this is when I ...
2
votes
2answers
529 views

How to recursively find a .doc file that contains a specific word?

I'm using bash under Ubuntu. Currently this works well for the current directory: catdoc *.doc | grep "specificword" But I have lots of subdirectories with .doc files. How can I search for, ...
2
votes
1answer
201 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 ...
2
votes
1answer
125 views

copying files by using cat on a network interface ?

when using scp to copy files over ssh connection , it can be sometimes quite slow for me (a 12 meg file takes 1 or 2 minutes). once i saw a guy cancel a copy that was going too slow, and then copy it ...
2
votes
3answers
357 views

Is there a GUI 'cat'-like program for any platform?

What I am looking for is a way to recombine split files without using cat. Is there such a beast? It could run on Linux or Windows or Mac OS.
2
votes
0answers
78 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 ...
2
votes
0answers
126 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
2answers
291 views

cat on Mac OS X never exits

I'm a bit of a UNIX noob, but I'm trying to run the cat command to make a simple text file and it works great, however cat is never exited after making the file. For instance, I type cat > ...
1
vote
5answers
178 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
3answers
136 views

accidentally concatenate a large file on a remote system

Every once in a while on a computer I'm ssh'd into, I will accidentally type "cat largefile.txt" and my screen will start rushing with text for the next 10 minutes. I'm always working in a screen ...
1
vote
4answers
349 views

Overwrite a file with an edited version in bash

What's the shortest code that does this? I've been doing something like echo "header" > tmpfile cat $file >> tmpfile echo "footer" >> tmpfile mv tmpfile $file . Is there a more ...
1
vote
1answer
60 views

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

I just wanna 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.
1
vote
1answer
100 views

Pass an option syntax string as filename

I somehow got a file named --no-recursion in a directory. How can I get cat to show what it contains? Not like this, since the argument gets interpreted as an option: root@nagini [/home/lalilulelo]# ...
1
vote
1answer
36 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 ...
1
vote
1answer
417 views

Command to update terminal as file is updated

I'm looking for a way to have the access log for my nginx install scroll up the terminal as lines are added to the log. I think I need a command like cat access.log | diff but I'm not sure exactly ...
1
vote
1answer
50 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 ...
1
vote
5answers
110 views

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

I know I've found this information before, but can't remember the right google query. I need to transfer an entire linux root filesystem off of a failing hard drive onto another computer with an ...
1
vote
1answer
34 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 ...
0
votes
1answer
2k views

Error in the command “cat file | xclip”

The command works with the user "heo". But I get the error by "$ su another_user; cat file | xclip": No protocol specified Error: Can't open display: :0.0 A superuser has black CLI, no error ...
0
votes
3answers
173 views

What will happen when I 'cat' 'ksh'?

I used the following command in my unix box. $ cat ksh And it gave a rolling log of latin and greek letters and symbols and it kept on going with no signs of stopping. Eventually I had to close my ...
0
votes
3answers
1k views

Monitor sometimes does not go to sleep on a Mac

I have Mac mini with the latest Leopard + all patches. I've set it up for the monitor to go to sleep after 5 minutes of inactivity, but it just won't turn off. The trouble started last week after ...
0
votes
2answers
178 views

Join parts of two files together in Bash

I hope to draw on the knowledge of those who know far more about scripting than I. I have two files, F1 and F2, where F2 is located in a sub-directory of F1. I need to output a new file, F3, that ...
0
votes
3answers
170 views

Scripts shell recording playback

I hope this makes sense. I use 'scripts' to make copies of my ssh sessions for various reasons. When I access the logs via less, etc, I see this: Script started on Mon 12 Sep 2011 08:59:14 AM CDT ...
0
votes
1answer
104 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
18 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: ...
0
votes
1answer
35 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
37 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 ...
0
votes
1answer
83 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 ...
0
votes
0answers
163 views

How to correct if the catalog file doesn't contains a .sys file?

I have a driver, which contains of an inf and a sys file. This driver isn't digitally signed, so if i want to install it, i get a red warning from UAC at Windows 7, that this driver isn't signed, and ...

1 2