Çarşamba, Ağustos 05, 2009

Rarely known unix text utilities

I have come across with some new text commands in a book that I hadnt seen before .These are : fmt, tac, join,(un)expand,split. Among them I am very impressed by join which makes an Sql-like join between 2 (or more I guess) files which is very useful.Here an example:Suppose you have two files whose one columns are equal (or contains same information, like an id column of sql) and you want to join these files with respect to tht column.You simply write
join file1 file2 if the first columns of file1 and file2 are common. If the common column is not first you can define it by -1 clnr or -2 clnr switches. There is also an -o switch which is useful for formatting output.To print the first and second columns from file 1 and say third column from file2 we write -o 1.1,1.2,2.3 .Here is a complete example
join file1 file2 -j 3 -o 1.1,1.3,2.2 .
Split is another nice command which splits larger files into smaller ones to easily handle them (when uploading,transferring etc). You just write split -b 32K file where -b 32K means the size of the parts is 32K.Then to join them you can write simply cat x* > newfile.
Tac is reverse of cat and does the reverse job.
Expand converts tab to spaces and unexpand does the vice versa.
Fmt is about formatting the output.

Pazartesi, Ağustos 03, 2009

Fring ile cep telefonunuzdan sip gorusmesi yapin

Cep telefonunuz ile internette dolasabiliyor musunuz? O zaman Java destekli bir telefona sahipseniz www.fring.com dan indireceginiz program sayesinde telefonunuzun sip ozelligi olmasa bile cebinizden sip gorusmesi yapabiliyorsunuz.Internet uzerinden cok ucuza gorusun.