MouthShut.com Would Like to Send You Push Notifications. Notification may includes alerts, activities & updates.

OTP Verification

Enter 4-digit code
For Business
MouthShut Logo
8 Tips
×

Upload your product photo

Supported file formats : jpg, png, and jpeg

Address



Contact Number

Cancel

I feel this review is:

Fake
Genuine

To justify genuineness of your review kindly attach purchase proof
No File Selected

10 Linux command line utilities
Apr 20, 2006 09:33 PM 3375 Views
(Updated Apr 20, 2006 09:37 PM)

Dear reader,


This a very short and pithy summary of the tools I love and use in my UNIX love affair.


1) netcat or nc


This is known as the networking Swiss army knife. Fortunately this is available for Windows also now. It is a marvellous little tool that can do wonders. In fact for my recent seminal work on'peer to peer traffic traversal across NATs', nc played a great role.


It simplicity of use is as elegant as its power. What all can you do with it?


You can listen at arbitrary TCP and UDP ports, you can act as a client and server both, you can specify the client port, you can do port scanning, you can transfer files, you can chat with each other using my above work. And you can also do IP spoofing. In the FreeBSD variant, you can also send and receive IPsec traffic with it. You can also execute arbitrary commands and send the output to the client using nc. You can even run a simple web server with it. The possibilities are endless.


Now obviously my intention here is not to get into the details since I want the article to be pithy. I just give you an example for UDP because I don't know any other tool that can easily talk UDP.


$nc -u -p 1500 1500


at both sides will give you a UDP peer to peer connection. Please don't mistake me, UDP is not peer to peer, but it lends easily to the peer to peer model.  Now you can transfer files easily by


$nc -u -p 1500 1500

and


$nc -u -p 1500 1500 >filename to receive the file. Lot more can be done, but I am running out of space. Please explore yourself, in case you need help please don't hesitate to contact me.


2) socat


Unfortunately I don't know much about this program. I discovered it when I wanted a command line UNIX domain socket client and server. Apparently it is much more powerful. But I will just dwell on what I know. Pardon me for my ignorance.


$ socat - UNIX-CONNECT:/tmp/socket


will act as a UNIX domain socket client where /tmp/socket is the socket. And


$ socat - UNIX-LISTEN:/tmp/socket will act as server.


Much more is possible, it also does TCP stuff, UDP stuff and much much more. It also supports hundreds of options.


3) openssl


Fortunately I am associated with this for a long time so much that I am going to write a book on the same.


However I use it as a library than as a command line utility. This is a full fledged encryption dynamo that can do everything under the sun imaginable for crypto.


$openssl dgst -md5

can give you the MD5 checksum of the file.


You can encrypt and decrypt with the command line. You can do lot of things but crypto is not for everyone. It is a very deep science. So let me leave you there so you can sleep at peace tonight.:-)


4) tr


Most people have not even used it once though everyone has heard of it. It translates text, it can be used for UNIX to DOS file format conversion,


$tr -d'\r'


It can squeeze out blanks lines, delete unwanted characters, squeeze spaces and so on. It is not feature rich but whatever it does it does well and it can play very well with other software like figlet(see below) for some excellent stuff.


$ tr [a-z] [A-Z]


will convert all lowercase to uppercase.


$tr -s'\n'


will remove duplicate successive blank lines.


5) figlet


Wow! This is really amazing. I have really wondered what people do to create ASCII graphics. I tried doing it in Vim and failed badly. I think it should be really painstaking.


And ASCII art looks too good in signatures in email. If you write your name with it, people will instantly fall in love with you. Don't ask me how many people fell in love with me!:-) Ha ha! I have never tried that.


$figlet girish


will type girish in a specific ASCII font. You should necessarily install the companion package figlist for an exhaustive collection of fonts.


And of course please don't forget to use it with tr.  Fortunately the man page gives a useful example for that.


6) fortune


If any of my previous employers read this, I think they will beat me up. Because this is the only game I play. And it is no game at all. It is very enlightening as Oscar Wilde said,


Its failings notwithstanding, there is much to be said in favor of journalism


in that by giving us the opinion of the uneducated, it keeps us in touch with


the ignorance of the community.




  • Oscar Wilde




I think if you are like me( I would like to think you are), then you will love this.


$fortune -m'Oscar'


7) mplayer


I misunderstood this section as meaning only command line utilities. I forgot that I could write about any free software. Anyway mplayer is also a command line tool only even though it is used to play movies and audio of any format. Just mplayer and file name in the command line will take you places.


Pressing the arrow keys do the right thing. Skip multiple frames or rewind.


8) openuniverse


This is a GUI based galaxy exploration tool,  but beware you need a recent graphics card with 3D capability and also it needs a good CPU. I have not played much with it, never got around to doing it.


9) windowmaker


The sexiest window manager on UNIX. It wins hands down compared to KDE or GNOME or any other. It is actually not comparing apples to apples since Windowmaker is not a desktop but still I have never liked anything else enough to make a switch. I have not tried xfce much, so maybe I have not seen enough of the world yet.


It was written by a Brazilian programmer and it is truly classy. It is the sexiest desktop I have ever seen. Takes a small amount of time to get used to it but it looks marvellous and is also simple and somewhat user friendly.


http://www.windowmaker.org


And of course it is very very very fast even on very old hardware because it is very slim. I should congratulate GNOME  here because though they got several things wrong, it also works very well on old hardware because of one single decision, they wrote in C instead of C+.


10) ssh


ssh and its companion scp are one of the sexiest innovations of the recent past. As usual OpenBSD folks are very bad at inventing, but they quickly identify good stuff and come out with something supernatural. They are very very brilliant, committed folks. In fact they are so good that in their hackathons, there are really no talks, only coding.


They have the attitude, 'Shut up and code'. I like it a lot. What about you?


For mirroring your home directory type,


$ssh -r~ user@host:


And ssh can also execute remote commands instead of logging in and giving you a shell. You can just enter


$ssh host'date'


if you want to know the date at the remote machine.


In fact using the dd command with ssh, you can even transfer arbitrary input to a remote machine. Almost like accessing a remotely mounted file system.


And using companion tools like ssh-agent and ssh-add you can login to machines without entering passwords using an RSA or DSA  key pair.


Hope you enjoyed this nice little sojourn. Bye till we meet again in my next article.


Upload Photo

Upload Photos


Upload photo files with .jpg, .png and .gif extensions. Image size per photo cannot exceed 10 MB


Comment on this review

Read All Reviews

X