Tuesday, July 15, 2014

how to see file size linux

Use ls -s to list file size, or if you prefer ls -sh for human readable sizes.
For directories use du, and again, du -h for human readable sizes.

  input  : ls -sh (Location of Directory)
  Example: (ls -lh /home/es/Downloads/)

  input  : ls -sh  /home/es/Downloads/
  output : total 2.3G
 -rwxrwxr-x 1 es   es    66M 2013-02-27 23:39 jdk-6u41-linux-i586-rpm.bin
 -rw-r--r-- 1 root root 1.2G 2013-02-28 01:32 linux_11gR2_database_1of2.zip
 -rw-r--r-- 1 root root 950M 2013-02-28 01:24 linux_11gR2_database_2of2.zip
 -rw-rw-r-- 1 es   es    44M 2013-04-03 21:26 luntbuild-1.6.2.zip

Output in putty:


                                                                                                                                                         

input: du -sh /home/es/Downloads/

Output in putty




Wednesday, July 9, 2014

Linux and Unix cd command

Quick Links

About cd
Syntex
Options
Examples


About cd
Changes the shells working directory.

Syntex
cd [-L|-P] directory

Options
-L Force symbolic links to be followed.
-P use the physical directory structure without following the symbolic links.

Examples
cd linuxreading.
The above example would change the working directory to the hope subdirectory if it exists.

cd ../home/users/linuxreading 
The above example would traverse up directory and then down into the
/home/users/linuxreading subdirectory.

cd ../..
Traverse two directory up the directory tree.