Category Archives: Linux

Linux related

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

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

How to check/verify if perl is installed on linux?

on the command prompt, you can run the below command:
perl -v

If perl is installed, the above command will report the version that was installed.

Leave a comment

Filed under Linux

how to install oracle linux packages for oracle 11g installation in RHEL5, if not registered to redhat

I have seen people struggling to install oracle linux packages on RHEL 5. You can install all the rpm required for oracle installation without getting registered on redhat website. You just need to install yum package and replace the configuration file and then install the packages.

Install the rpm package from  RHEL 5 DVD. Then,, download and copy the appropriate yum configuration file in place, by running the following commands as root:
Navigate to below directory as root:
cd /etc/yum.repos.d

Then run the below command:
wget http://public-yum.oracle.com/public-yum-el5.repo

Note: If you have any other repository file in /etc/yum.repos.d directory, then remove that file or move it to another directory.

Then, enable the appropriate repository by editing the yum configuration file
-> Open the yum configuration file in a text editor
-> Locate the section in the file for the repository you plan to update from, e.g. [el5_oracle_addons, el5_addons]
-> Change enabled=0 to enabled=1

and save the file.

Then run the below command:

yum update binutils elfutils elfutils-libelf gcc gcc-c++ glibc glibc-common glibc-devel compat-libstdc++-33 cpp make compat-db sysstat libaio libaio-devel unixODBC unixODBC-devel

This will update all the packages you need for oracle 11g installation on RHEL5.

Leave a comment

Filed under Linux, Oracle

wget command getting timed out – while trying to update rpm for oracle on linux server

Wget timed out usually indicates that you’re using an HTTP proxy to access the outside world. If so, you will need to configure the http_proxy environment variable for wget to use the same proxy. Add the below settings and it should resolve the issue.

export http_proxy=http://server-ip:port/
E.g: export http_proxy=http://101.10.19.27:8080

This should fix the wget time out issue.

Note: similarly you can do this for ftp_proxy as well.

Leave a comment

Filed under Linux, Oracle

Receiving error “Useradd: unable to lock password file” on linux

I got the below error when running the useradd command on  linux.

“Useradd: unable to lock password file

This issue occurs if there is passwd.lock or passwd-  or passwd~ file in the /etc/directory. You can remove it or move to some other directory to fix the issue and restart the server. Sometimes you will not be able to move as well and if that’s the case, then you need to restart linux server to fix the issue.

 

5 Comments

Filed under Linux

Transferring files from Windows to Linux using pscp command (PuTTY need to be installed)

we have seen most of them find it difficult to transfer files from Windows to Linux. It’s not because they don’t know how to transfer, but due to the restrictions made on the servers for installing software like Filezilla or others.

Most of the IT companies allow to install PuTTY. Using PuTTY, you can transfer files with pscp command:

PSCP Usage:

Usage: pscp [options] [user@]host:source target
      pscp [options] source

 [user@]host:target
      pscp [options] -ls user@host:filespec
Options:
  -p        preserve file attributes
  -q        quiet, don't show statistics
  -r        copy directories recursively
  -v        show verbose messages
  -P port   connect to specified port
  -pw passw login with specified password

Install PuTTY installer on your Windows system.  It will create PuTTY folder in Program Files directory in the Windows machine. Open command prompt and navigate to the folder where PuTTY has been installed(for eg: C:\Program Files\PuTTY\) and run the pscp command as shown below:

C:\>

C:\> cd “Program Files\PuTTY”

C:\Program File\PuTTY> pscp  <file-name> <destination address:/location”

Eg: C:\Program File\PuTTY> pscp c:\a.zip admin@action.test.com:/home/cpadmin

You will be prompted for the destination server password. Once you give the correct password, it will transfer the files

Leave a comment

Filed under Linux