The cat tag has no wiki summary.
0
votes
3answers
33 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
2answers
83 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 ...
2
votes
2answers
115 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 ...
1
vote
1answer
48 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]# ...
0
votes
1answer
98 views
cat file that contains escaped characters to netcat
I'm trying to test a webserver with some HTTP request written in a file.
GET / HTTP/1.1\r\n\r\n
Right now I'm feeding that file to netcat like this:
cat files | nc localhost 80
However, the \r\n ...
1
vote
2answers
262 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.
...
0
votes
2answers
100 views
Terminal is Stuck in “cat”
A while back I recall attempting to install an updated version of Ruby on my Mac. I had an interest in the language and thought I would give it a go. I followed detailed instructions that lead me ...
0
votes
3answers
63 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
...
2
votes
2answers
118 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, ...
1
vote
5answers
288 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: ...
8
votes
4answers
334 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 ...
1
vote
4answers
107 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 ...
2
votes
3answers
180 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.
5
votes
3answers
616 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 ...
2
votes
4answers
232 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
1answer
71 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 ...
7
votes
2answers
154 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 ...
3
votes
2answers
187 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). ...
4
votes
3answers
384 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
1
vote
1answer
168 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
2answers
108 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
4answers
618 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 ...
2
votes
3answers
2k 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
2answers
119 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 ...
1
vote
2answers
192 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
3answers
104 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 ...
2
votes
3answers
685 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
2answers
661 views
Linux cat example
Can You please explain me why:
'cat < file.txt > file.txt '
makes file.txt empty ?
3
votes
3answers
3k 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?
1
vote
4answers
2k 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
2answers
613 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 ...
0
votes
1answer
733 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
912 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 ...