Linux, Tools

Grab a static website with Wget linux command

You can get any static websites on your local system with wget linux command. Let say there is simple static web application which you want to run on your local system. One option could be that you save each page and every script and css files embedded on each page as well of that application, and then you have to correct the path of the script and css files if the paths are not relatives. Wget can do this for you. For example: is very good static web application which create awesome css shapes just using drag and drops. If you want to run this application in your local system, in case you don’t have internet access. Using the following wget command you can get this application running on your local system.

wget --recursive --no-clobber --page-requisites --convert-links --no-parent

you can pass several option to wget command. The options are:

--recursive: download the entire Web site.

--domains don't follow links outside

--no-parent: don't follow links outside the directory tutorials/html/.

--page-requisites: get all the elements that compose the page (images, CSS and so on).

--html-extension: save files with the .html extension.

--convert-links: convert links so that they work locally, off-line.

--restrict-file-names=windows: modify filenames so that they will work in Windows as well.

--no-clobber: don't overwrite any existing files (used in case the download is interrupted and


Thats all now you can open index.html file in browser and everything works, in case if this doesn’t work as expected then you can put this grabbed website directory in your localhost document root.


import command for screenshots in linux

Screenshots: Every computer guy need it either you are normal computer user or developer.
There are many tools for screenshots but what about screenshots in linux.
If you use gnome as desktop manager then there is utility available for this gnome-screenshots.
In terminal type


if you little bit nerdy and linux guy then definitely you like terminal. There is a tool to capture screenshot directly from command line. This is the import command. This command is part of a tool called ImageMagick. Before using this command you should have this tool installed on your system. This tool is for image processing and work as back end for several applications.
You can install this tool via command line.

yum install ImageMagick.

For more detail you can see this link

import filename

As you type this command your mouse pointer converts into cross “X” mark and now you can select any region or any window to capture. If you want to capture any particular window then just select that window, or any region by selecting it.

you can specify different file extensions like(jpeg, png, gif etc) in which format you want to save your screenshot. If you didn’t specify any extension then by default it saves in poscript format.


Recursively extract all compressed files in a dir

Today i need to upload some tar.gz files to ftp server then i want to extract them. one way was to extract each file individually. Then i thought to write a simple shell script to extract them because i have ssh access to that server. So this is the simple script to extract all the tar.gz compressed files in a directory.

for user in $( ls *.tar.gz )
tar zxvf $user

if you have zip file then change the *.tar.gz to *.zip and tar zxvf to unzip. If you have tar.bz2 file change tar zxvf to tar jxvf