ODOC: zip

zip — Package and Compress files in Zip format.


zip is a compression and file packaging utility. The zip program puts one or more compressed files into a single zip archive, along with information about the files.


$ zip stuff * — Create stuff.zip, add current Dir files in it.

$ zip -r myzip mydir — Create myzip.zip, add mydir files in it.

$ zip -j myzip mydir/* — Same as above. But mydir name will not be recorded.

$ zip -rm myzip mydir — Delete the original files after zipping.

$ zip -r myzip mdir -x *~ — Exclude all files that end in ~.

$ zip -u stuff * — If myzip.zip is already exist then, update new and modified files from the current Dir.

$ zip -R foo ‘*.c’ — Travel the Dirs recursively starting at the current directory and zip all C files.

$ zip -n .Z:.zip:.tiff:.gif:.snd myzip * — Create myzip.zip file, add files from current Dir and Don’t try compress the specified files.

$ zip -rt 2005-06-06 myzip mydir — Zip all the files in foo and its subdirs that were last modified on or AFTER 06-06-2005.

$ zip -rtt 2005-06-06 myzip mydir — Zip all the files in foo and its subdirs that were last modified BEFORE 06-06-2005.

Read: man zip (Lot of examples are available)
zip, odoc, linux,gnu/linux

ODOC: tar

tar — Create/Add/Extract Tape ARchives files.


tar is an archiving program designed to store and extract files from an archive file known as a tar file. A tar file may be made on a tape drive, however, it is also common to write a tar file to a normal file.

Normally “.tar” file is not a compressed file. It is actually a collection of files within a single file.
“.tar.gz”/ “.tgz” is a collection of files which are compressed. You can also use BZip2 compresion for the tar files.


$ tar -cf myfile.tar mydir — Create new tar file.

$ tar -cvf myfile.tar mydir — With detail output.

$ tar -tvf myfile.tar — List the content of the tar file.

$ tar -uvf myfile.tar mydir — Update/Append files that are newer than copy in tar.

$ tar -xvf myfile.tar — Extract the tar file.

$ tar -xvf myfile.tar dir1/file1 — Extract only file1 from the tar.

$ tar –delete -vf myfile.tar *.doc — Delete all files with .doc extn from tar file.

$ tar –diff -vf myfile.tar mydir — Differences between archive & mydir

$ tar -czvf myfile.tgz mydir — Tar and GZip the files.

$ tar -xzvf myfile.tgz — Extract the tgz file.

$ tar -cZvf myfile.tgz mydir — Tar and compress the files.

$ tar -xZvf myfile.tgz — Extract the tgz file.

Read: man tar
tar, odoc, linux, gnu/linux

Host problems

The site was not available to anyone for more than a week. This was due to some problem with my host and today the backups were restored and I have got back my blog. I guess there won’t be any more problems form now on. I think it is time to resume my blogging work.

ODOC: lsb_release

lsb_release — Show Linux Standard Base and Distribution info.


If the installation is LSB compliant, the /etc/lsb-release file should contain the LSB_VERSION field and other optional fields like DISTRIB_ID, DISTRIB_RELEASE, DISTRIB_CODENAME, DISTRIB_DESCRIPTION.

lsb_release will read the above config file and show the details in different format. It is useful command to find your distribution informations.


$ lsb_release — Show the LSB version number.

$ lsb_release -i — Display the distributor ID or Name.

$ lsb_release -d — Display the single line text description of the distribution.

$ lsb_release -r — Display the release number of the distribution.

$ lsb_release -c — Display the distribution code-name.

$ lsb_release -a — Display all of the above information.

$ lsb_release -s — Show only field values, not the filed name.

$ lsb_release -ds — Show only field values, not the filed name.

$ lsb_release -as — Show in short format.

Read: man lsb_release
lsb_release, distribution, distro, linux+distro, linux, gnu/linux

ODOC: factor

factor — Print prime factors


Print the prime factors of each number.The algorithm it uses is not very sophisticated, so for some inputs `factor’ runs for a long time.


$ factor 25 — Print prime factors

$ factor 125 200 — Print prime factors for each number.

$ factor `echo ‘2^64-1’|bc` — Factors the largest 64-bit number.

$ factor `echo ‘4294967279 * 4294967291’|bc` — Factors the largest 32-bit prime numbers. (Warning: It take more time)

Read: man factor
odoc, factor, linux, gnu/linux

ODOC: sha1sum

sha1sum – Compute & Check Secure Hash Algorithm Std 1 message digest.


sha1sum computes a 160-bit checksum/fingerprint/message-digest for each specified file. `sha1sum’ can also determine whether a file & checksum are consistent. The sums are computed as described in FIPS-180-1.


$ sha1sum file — Compute and print the MD5 checksum of that file.

$ sha1sum -c input.txt — Read checksum and filename from the file and validate checksums.

$ sha1sum -w -c input.txt — Same as above and warn if the checksums format is wrong in the file.

$ sha1sum –status -c input.txt — Indicate the status in exit status code.

Read: man sha1sum

Format of input.txt :

2bff10a7855964335a86e84efb5f4ce9c40d4cfd file1
e62341664decd9f55896ab3635697de29ed1077f file2
9b088ddc22456233a76 file3
odoc, sha1sum, linux, gnu/linux

ODOC: logger

logger — Makes entries in the system log file.


Logger is a shell command interface to the syslog system log module. It can be used to makes entries in the system log from the shell scripts. By default, messages will be logged in /var/log/messages.


$ logger MyLog1 — Log the message in syslog.

$ logger -i MyLog2 — Log the message with PID.

$ logger -s MyLog3 — Log the message in stderr and syslog.

$ logger -t MYTAG MyLog4 — Log the message with specified Tag.

$ logger -p user.panic MyLog5 — Log the message with priority.

Read the man page for more priority Facility and Level details.

Read: man logger
logger, log, odoc, linux, gnu/linux

BarCamp at Chennai

BarCamp is an ad-hoc un-conference born from the desire for people to share and learn in an open environment. It is an intense event with discussions, demos, and interaction from attendees. BarCamp is happening right here in Chennai on April 8 and 9, 2006. The agenda for this BarCamp is the Next Generation Internet, Web 2.0, Ajax, Mobile Computing, Open Source and such.
barcamp, web, web+2.0, ajax, chennai, open+source, BarCampChennai

Bug in Ubuntu Breezy exposes root password

In actual there is no user account called root in Ubuntu. A normal user can become root by using the sudo command. But in Breezy, the first user’s password is can be easily found by any user reading the file /var/log/installer/cdebconf/questions.dat. This bug is present only in Breezy (5.10) and not in Dapper(6.04) the yet to be released version.
There are two packages – base-config and passwd which needs to be upgraded to prevent this problem. A standard system upgrade will fix this problem.
If you are upgrading from 5.10 to 6.04 then you need to upgrade your passwd package to the newest version.
ubuntu, breezy, dapper, root+user