Unix Blog

Wednesday, April 13, 2011

du

List total size of current directory (in KB)
df -s

List total size of current directory (in MB+)
df -sh

List size of all directories in current directory
du -sh *

posted by Jayanthi Krishnamurthy @ 9:41 PM   0 Comments

Friday, April 8, 2011

Who is using the port?

Find which process is using tcp port

Linux
netstat -anp | grep LISTEN

AIX
lsof -i:portnumber
The above command will list the processes and pids.
grep using the pid to know the config
ex: ps -ef | grep httpd | grep pid

Windows
netstat -an |find /i "listening"
netstat -an |find /i "9443"

netstat -no
netstat -ao
netstat -a

posted by Jayanthi Krishnamurthy @ 11:57 AM   0 Comments

SSH

Problem
Address 1xx.xx.xx.xx maps to hostname, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

Solution
check /etc/hosts file and make sure ip address is in the first

posted by Jayanthi Krishnamurthy @ 11:31 AM   0 Comments

Thursday, April 7, 2011

tar

tar commands:
Create a tar file
tar -cvf out.tar dirname/*

Extract a tar file
tar -xvf dirname/*

Extract a tar file inside .tgz
gunzip file.tgz
tar -xvf file.tar
  or
gzip -dc file.tgz | tar xf -

Create a tar excluding a sub-directory
tar -cvf output.tar --exclude sub-dir-name *

Problem

tar: directory checksum error

Solution
Native tar is located at /usr/bin/tar.
Try using GNU tar located at /usr/local/bin/tar

posted by Jayanthi Krishnamurthy @ 3:13 PM   0 Comments

Newer›  ‹Older

About Me

Name: Jayanthi Krishnamurthy

View my complete profile

Posts

  • du
  • Who is using the port?
  • SSH
  • tar

Older Posts Newer Posts

Archives

  • December 2008
  • January 2009
  • March 2009
  • April 2009
  • August 2009
  • September 2009
  • October 2009
  • November 2009
  • March 2010
  • April 2010
  • October 2010
  • November 2010
  • December 2010
  • January 2011
  • March 2011
  • April 2011
  • June 2011
  • July 2011
  • August 2011
  • November 2011
  • January 2012
  • September 2012
  • October 2013
  • November 2013
  • January 2014
  • April 2014
  • September 2014
  • December 2014
  • March 2015
  • April 2015
  • July 2015
  • Current Posts

Subscribe to
Posts [Atom]