Tag Archives: Linux

check the content of zip file in linux

On linux server, you can run either “unzip -l” or “zipinfo”

e.g $ zipinfo data.zip
Archive:  data.zip   363181 bytes   10 files
-rw-r–r–  2.3 unx      404 tx defN 26-Aug-14 02:51 auser.xml
-rw-r–r–  2.3 unx   206354 tx defN 18-Jul-13 08:12 full_test.xml
-rw-r–r–  2.3 unx     2212 bx defN 13-Oct-14 07:28 identity.jks
-rw-r–r–  2.3 unx      846 tx defN  4-Feb-14 06:00 a2-.xml
-rw-r–r–  2.3 unx    22624 tx defN 19-Feb-15 07:35 list
-rwxrwxrwx  2.3 unx    15327 tx defN 19-Aug-14 05:58 l.sh
-rwxr-x—  2.3 unx   364982 bx defN  6-Mar-15 04:08 d.jar
-rw-r–r–  2.3 unx     1197 tx defN 19-Aug-14 10:00 l.ldif
-rw-r–r–  2.3 unx     2173 tx defN 10-Mar-15 03:26 1.properties
-rw-r–r–  2.3 unx      372 tx defN 19-Aug-14 09:55 5.ldif
10 files, 616491 bytes uncompressed, 361679 bytes compressed:  41.3%

$ unzip -l data.zip
Archive:  data.zip
Length     Date   Time    Name
——–    —-   —-    —-
404  08-26-14 02:51   auser.xml
206354  07-18-13 08:12   full_test.xml
2212  10-13-14 07:28   identity.jks
846  02-04-14 06:00   a2.xml
22624  02-19-15 07:35   list
15327  08-19-14 05:58   l.sh
364982  03-06-15 04:08   d.jar
1197  08-19-14 10:00   l.ldif
2173  03-10-15 03:26   1.properties
372  08-19-14 09:55   5.ldif
——–                   ——-
616491                   10 files

Advertisements

Leave a comment

Filed under Linux

Receiving error “ping: unknown host “

I was trying to ping google.com on my linux test box and was receiving the

ping: unknown host http://www.google.com

I was able to ping the ip address, so I started troubleshooting looking for hostname, ip address, resolv.conf. I found that DNS was wrong and changed the nameserver ip address in /etc/resolv.conf to fix the issue.

Leave a comment

Filed under Linux

Linux – (RHEL 4 or 5) : unable to login to machine, as grub is corrupt and you are in grub prompt

You have dual operating systems on your laptop: Windows 7/XP and Linux on the same machine, you choose GRUB as boot loader while installation.

Some day, you may reinstall the windows or change the partition on your machine, grub gets corrupted and you find difficulty in resolving this issue.

But the solution is to simple and you need to follow below steps:
1. Run “find /boot/grub/stage1” in grub prompt:
(Remember that for grub (hd0,1) means hda (primary controller master), second partition.)

grub> find /boot/grub/stage1

you may receive the output something like below:
hd0,7

Then run “setup (hd0,7)” and “reboot” commands

grub> setup (hd0,7)
grub> reboot

System will reboot and you will be redirected to list page.

If you want to make some changes to the boot menu, press “e” to edit you must edit the file: /boot/grub/menu.lst

A sample file on my machine:
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Linux (2.6.9-78)
root (hd0,7)
kernel /boot/vmlinuz-2.6.9-78.ELsmp ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-78.ELsmp.img
title Red Hat Linux (2.6.9-78)
root (hd0,7)
kernel /boot/vmlinuz-2.6.9-78.EL ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-78.EL.img
title Other
rootnoverify (hd0,0)
chainloader +1

It will change the page for temporarily so that you can login.
Once you login edit /boot/grub/menu.lst to change it permanently.

That should fix it.

Leave a comment

Filed under Linux