Thursday, 18 December 2014

Tar Files extraction Unix / Linux

Q: How can I extract  specific file from a tar ball ?

Tar or Tar ball is a single file  bundled with files &/ directories. First  we will discuss about general extraction of a files from tar ball.

Unpack or extract a tar file :

To unpack or extract a tar file, type:
tar -xvf myfile.tar
some times to save more space and bandwidth , we  need compress the tar balls using compression techniques like gzip or bzip2.

To unzip and extract  those tar files, type as below 
For  .tar.gz files 
tar -xzvf myfile.tar.gz

For .tar.bz2
tar -xjvf myfile.tar.bz2
-x : Extract a tar ball.
-v : Verbose output or show progress while extracting files.
-f : Specify an archive or a tarball filename.
-j : Decompress and extract the contents of the compressed archive created by bzip2 program (tar.bz2 extension).
-z : Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).
Now here comes our main purpose ,  to extract a specific file  from a tar file.

Extract Specific file from a tar ball:

To extract a single file called myfile1.txt, enter:
tar -xvf file.tar myfile1.txt
tar -xzvf file.tar.gz myfile1.txt
tar -xjvf file.tar.bz2 myfile1.txt
You can also specify path such as home/um/myfile2.txt, enter:
tar -xvf file.tar home/um/myfile2.txt
tar -xzvf file.tar.gz home/um/myfile2.txt
tar -xjvf file.tar.bz2 home/um/myfile2.txt

How to Extract a Single Directory?

To extract a single directory called /home/um, enter:
tar -xvf file.tar home/um
tar -xzvf file.tar.gz home/um
tar -xjvf file.tar.bz2 home/um

Sample O/P:

Wednesday, 17 December 2014

MobaXterm free Xserver and SSH client

Recently when I am browsing internet  for Unix connectivity tools I came across a wonderful tool called MobaXterm. As per the MobaXterm team  its "an enhanced terminal for Windows with an X11 server, a tabbed SSH client and several other network tools for remote computing (VNC, RDP, telnet, rlogin). MobaXterm brings all the essential UNIX commands to Windows desktop, in a single portable exe file which works out of the box".

Downaload:There are two different versions available, one is free version and other is Pro.
I think free version is good enough to accommodate our daily tasks. If you still  feel you need  more then  go for Pro.

Download Link

The following are  the key features mentioned by them.

Key Features:
  • Free X server fully configured (based on Xorg)
  • Tabbed terminal based on PuTTY / MinTTY with antialiased fonts and macro support
  • Easy DISPLAY exportation from any remote host
  • X11-Forwarding capability in OpenSSH
  • Several Unix/Linux commands based on Cygwin (rsync, wget, sed, awk, grep, cd, ls, cat, cp, ...)
  • A session manager with all the network clients you need: RDP, VNC, SSH, telnet, rsh, FTP, SFTP and XDMCP
  • Program without installation that you can start from an USB stick
  • Light and portable application, packaged in a single executable

I am really enthralled by the features its offering.Here are few snippets.

1) Inbuilt Unix Command Support :
When you open MobaXterm  it will automatically  open session which supports many of Unix/Linux based commands  (ls, cd, grep, awk, tail, cut, sed, wget, rsync, telnet, ssh, rlogin, rsh etc ) based on Cygwin. You can further add packages using this link plugins.

2)Tabbed Sessions:
When ever you open a session , it will be open as tabbed session, just like Putty Connection Manager.
You can also save your session along with usernames and passwords

The SSH connection configured with automatic X-11 forwarding.You can use this as fully configured "X server " and also supports OpenGL.

4) Automatic SFTP Support:
A SFTP session is automatically opened when you open a ssh session on leftside. You can  download or upload files directly with a drag and drop from/to the remote server.You  can also  edit And save the files with one click open it in MobiXeditor or  which ever the text editor on your system.

5) Remote Windows Connections using RDP: 
  You can access the remote windows machines using RDP adding as connection.

6) Split-mode Terminal:
you can display up to 4 terminals at the same time in the main window. It is very useful for monitoring 4 remote computers or for comparing outputs of 2 terminals.

7) Multiple Sessions Support:
It will support various session types like SSH,RSH,Telnet,Xdmcp,RDP,VNC, SFTP,FTP many more.

8) Muti Execution Mode:
There us a facility just klike PuttyCM, You can run one single command in all the open sessions.But be more cautious when you are using this facility, need to be careful on which sessions you are running this.

There are lot more features and further information you can refer the following link.
more features link