-1
votes
3answers
48 views

cat /dev/null emptied my log file but size did not change

I'm quite new to Unix. Using Solaris 10 I faced the below issue. There is a large log file with size 9.5G. I tried to empty the file using the below command. # cat /dev/null file_log.txt By doing ...
14
votes
2answers
1k views

How do I “cat and follow” a file?

A file is being sequentially downloaded by wget. If I start unpacking it with cat myfile.tar.bz2 | tar -xj, it may unpack correctly or fail with "Unexpected EOF", depending on what is faster. How to ...
1
vote
1answer
121 views

Difference between cat * and cat * >>

To merge multiple files in a dir I have tried: cat * myfile.log but this seems to just merge line and line and is thus very slow So using instead: cat * >> bigfile merges the files much ...
8
votes
4answers
611 views

Why does “cat ttyUSB0” not produce output?

I connected an infrared receiver to a USB port ... (the last line of dmesg tells device file) $ dmesg [10496.596063] usb 7-2: new full-speed USB device number 2 using uhci_hcd [10496.751112] usb 7-2: ...
9
votes
2answers
2k views

Fastest way to concatenate files

I've got 10k+ files totaling over 20GB that I need to concatenate into one file. Is there a faster way than cat input_file* >> out ? The preferred way would be a bash command, Python is ...
0
votes
2answers
267 views

How can I concatenate all files in a directory together in one command line operation? [duplicate]

I have 1000 csv files in a directory. I would like to concatenate them all together in order. They are named img_size_1.csv to approx img_size_1000.csv This answer is close but assumes a list file. ...
8
votes
4answers
1k views

Grep from the end of a file to the beginning

I have a file with about 30.000.000 lines (Radius Accounting) and I need to find the last match of a given pattern. The command: tac accounting.log | grep $pattern gives what I need, but it's too ...
0
votes
1answer
103 views

Passing multiple scripts to shell over ssh

I have a somewhat lengthy script which sources other scripts to include the functions there. I'd like to execute this script remotely via ssh. Now I thought to make one script file of it (without ...
2
votes
3answers
562 views

Can't cat a file or make a directory: contradictory output?

I am getting output from a terminal in Ubuntu 12 that I don't understand. $cat sublime no such file or directory $mkdir sublime cannot create directory 'sublime': File exists How can both of these ...
5
votes
2answers
235 views

A virtual file containing the concatenation of other files

Is there a way of creating a filesystem object akin to this: mknod files p cat file1 file2 ... fileN > files but such that it can be seeked in, as if it were a regular file?
20
votes
1answer
847 views

How to implement a horizontal cat? [duplicate]

Standard cat concatenates files line by line (row by row, if you will). I find myself needing a horizontal cat command more and more often recently; i.e. a command that takes a list of files and ...
1
vote
1answer
530 views

How to move files with same name and concatenate

My directory structure is given below. I need to move all the folders from Test3 to Test2 and concatenate the files with same names [jg@hpc Test2]$ tree . |-- Sample_1008 | |-- ...
3
votes
2answers
611 views

Subtracting Binary files

I have 2 Binary Files FileA and FileC Its is such that FileC = FileA + FileB using the cat utility How do I subtract FileA from FileC to get FileB ? PS: I am using Ubuntu Oneiric
5
votes
2answers
631 views

What is produced after using cat on an image?

Let's say one creates a file like so: touch myFile You enter some text in it with vim or whatever, and then use cat myFile to spit the contents out into the terminal. Now, what happens when I use ...