ABHIONLINUX
Site useful for linux administration and web hosting

2009/08/16

Screen Command

GNU Screen enables you to run many shell processes in a single terminal. So in one e.g. xterm you can have many bash instances like layers in GIMP or Adobe Photoshop. Even better, you can split your terminal into different regions.

Steps
-----
1)Create a screen using the command
#screen -S abhi

2)Close the shell without logout

3)Open a new shell

4)Type screen -ls

[root@cochin1 ~]# screen -ls
There are screens on:
16921.test (Dead ???)
3981.name (Attached)
5002.abhi (Attached)
Remove dead screens with 'screen -wipe'.
3 Sockets in /tmp/screens/S-root.

5)You can login to that screen using the command screen -r 'screen name'

[root@cochin1 ~]# screen -r 5002.niyas
There is a screen on:
5002.abhi (Attached)

Extract files from tar.gz file

First unzip the file using

gunzip filename.tar.gz

This create a filename.tar file then to display the contets use

tar -t filename.tar

Then if you want to extract a file called abc.sql from that tar just give the command

tar -xvf /path/filename.tar -M /fullpath/abc.sql

It will be extracted to /fullpath/inside/abc.sql in the directory you are residing.