Categories
applications How to's Info

What is the command to invoke Adobe acrobat reader in Linux

If you have installed Adobe Reader in Linux and you need to invoke it from console ( for some reason you don’t want to go to menus). Just enter acroread  and you will see  Adobe reader opened.
to open a file enter

$acroread filename.pdf

enter acroread -help and you will find all the command line options available to you. Here is the list of options available

Usage: /usr/bin/acroread [options] [list of files]

Options:
    --display=
        This option specifies the host and display to use.
    --screen=
        X screen to use. Use this options to override the 
 screen part of the DISPLAY environment variable.
    --sync
        Make X calls synchronous. This slows down the program considerably.
    -geometry [x][{+|-}{+|-}]
        Size and/or location of the document windows.
        Note: this option is position dependent, and can be
        specified multiple times. The geometry specified only
        affects the list of files following it.
    -help
        Prints the common command-line options.
    -iconic
        Launches in an iconic state on the desktop.
    -setenv =
        Tells the main application to perform the equivalent of
        C-shell setenv  .
    -tempFile
        Indicates files listed on the command line are temporary files
        and should not be put in the recent file list.  The document
        title will be the title in the pdf document, instead of the
        filename.
    -tempFileTitle        Same as -tempFile, except the title is specified.    -toPostScript [options] pdf_file ... [ps_dir]    -toPostScript [options] -pairs pdf_file_1 ps_file_1 ...    -toPostScript [options]        Converts the given pdf_files to PostScript.        In the first form, if the last file specified is a directory,        then all preceding files will be converted to PostScript        and the generated PostScript files will be placed into ps_dir.        If a directory is not specified, then the PostScript files        will be placed in the same directory as the original file.        In the second form, the file list contains pairs, each        consisting of a PDF filename and a corresponding PostScript        filename.        The third form specifies a filter, reading a PDF file from        standard input and writing the PostScript file to standard        output.        Note: When using -toPostScript it must be the first argument        passed in on the command line.        The following are valid options for the conversion of PDF to        PostScript:        -binary - emit binary PostScript where possible        -start  - identify the first page in the document to be           converted (default is the first page of the document)        -end  - identify the last page in the document to be           converted (default is the last page of the document)        -optimizeForSpeed - emit PostScript such that all fonts are           emitted once at the beginning of the document.  This           results in faster transmission times and smaller           PostScript documents but requires more PostScript printer           virtual memory.        -landscape - rotate the pages to print landscape        -reverse - reverse the page order of the output        -odd - emit only odd-numbered pages        -even - emit only even-numbered pages        -commentsOff - don't print comments        -annotsOff - don't print annots        -stampsOff - don't print stamps        -markupsOn - print document and markups        -level2 - emit Level 2 PostScript  (level1 is not supported)        -level3 - emit Level 3 PostScript         -printerhalftones - use the printer default halftones.        -saveVM - download fonts as needed to preserve printer memory -size - Paper size (letter,tabloid,ledger,legal,a3,a4,a5,b4,b5)        -scale  - scale the pages according to the scale factor           (default is 100 percent)        -shrink - shrink the pages to fit the page size        -expand - expand the pages to fit the page size        -size  - set the page size.  The following page sizes           are recognized:              letter - letter size paper              tabloid - tabloid size paper              ledger - ledger size paper              legal - legal size paper              executive - executive size paper              a3 - ISO standard A3 size              a4 - ISO standard A4 size              a5 - ISO standard A5 size              b4 - ISO standard B4 size              b5 - ISO standard B5 size              wxh - custom size paper where w is the integer width                 in points and h is the integer height in points        -transQuality level - set the transparency flattening level            Value from 1-5, where 1 means rasterize everything, 5 means           rasterize as little as possible, default is 3.    -openInNewWindow        The application starts normally without checking if it        is already running.    -version        Print version information and quit.    -visual  [depth=]    -visual id=    -visual best    -visual default        Specifies a visual.        In the first form, the visual class (specified by either        its name or number) with an option depth determine the        visual to use.        In the second form, the visual id is specified. The prefix        0x must be used for hexadecimal numbers.        The third form uses an internal algorithm based on depth        and visual class.        The fourth form simply uses the default visual.        Note that PseudoColor visuals of depth greater than 8,        and DirectColor visuals are not supported.
Categories
commands Info

Files used by a program

how to find which process is using a file?

You can view the process using the file or filesystem using lsof  & grep  command.

lsof  lists all files in use in the system.

if you want to find the application which is using the file sag.pdf  use

$lsof |grep sag.pdf

and you will get the output as

ld-linux. 4220      nandam   30r      REG        3,1   869300    136163 /home/nandam/tldp books/sag.pdf

you can also use lsof with grep to find the files used by a process
like

$lsof|grep bash
Categories
commands Info

Counting words & lines in a File

wc is used to count no of words and lines in a text file
To count no of characters

$wc -m filename

To count no of words

$wc -w filename

to count no of lines in the file use

$wc -l filename

refer wc manual for more info on wc or

$man wc

Categories
commands Info

Taking screenshots in linux

Taking Screenshots in Gnome..
One can take screenshots using gnome-screenshot tool.
open console and enter
gnome-screenshot and it will take screenshot of whole screen. If you need to take a delayed screen show enter

$gnome-screenshot -d 10

The above command delays the screenshot by 10 secs.. This is useful if you
want to take a screenshot when the system menus are open. When you open
Applications menu and press on printscreen button the menu gets closed
or you cannot take a screenshot of the opened menu. If you use above
command you can take screenshot of the opened menu.

if you need to take screenshot of a window enter

$gnome-screenshot -w -d 5

and select the wind which you need to take a screenshot. Or you can press alt+printscreen.

You can also use gimp for taking screenshots. Open gimp and goto
 file–>acquire–>screenshot and you will see a small window
with options to take screenshot of an active window or to take
screenshot of full screen or of a selected area.. Select the option of your choice and click on snap button to take screen shot.

Categories
commands Info

The Sort Command

The sort Command in Linux is one of the most ignored(?) yet  powerful command.
Sort is used to sort data or records.
if you use with other utils like ls it can give  you a wide variety of data.
let’s say the ls -l output of a directory is

-rw-r--r-- 1 nandam nandam  785280 2008-05-27 22:26 gdocs-1.0.4.oxt
-rw-r--r-- 1 nandam nandam 4997184 2008-05-27 22:16 Sun_ODF_Template_Pack_en-US.oxt
-rwxr-xr-x 1 nandam nandam  360756 2008-01-18 19:30 WriterTemplates.oxt
-rwxr-xr-x 1 nandam nandam   48019 2008-01-18 19:30 WriterTools.oxt

Now if you want to sort the above data according to column five (size of each file) you have to enter

$ls -l |sort -k 5

and here is what you get

-rwxr-xr-x 1 nandam nandam  360756 2008-01-18 19:30 WriterTemplates.oxt
-rwxr-xr-x 1 nandam nandam   48019 2008-01-18 19:30 WriterTools.oxt
-rw-r--r-- 1 nandam nandam 4997184 2008-05-27 22:16 Sun_ODF_Template_Pack_en-US.oxt
-rw-r--r-- 1 nandam nandam  785280 2008-05-27 22:26 gdocs-1.0.4.oxt

-k —> instructs sort to sort records by column 5 in ascending order.
But, sort considers the fifth column as a text string. to sort the data considering it as a number we must pass -n as below

$ls -l|sort -k 5 -n

and now you will get the correct format as below

-rwxr-xr-x 1 nandam nandam   48019 2008-01-18 19:30 WriterTools.oxt
-rwxr-xr-x 1 nandam nandam  360756 2008-01-18 19:30 WriterTemplates.oxt
-rw-r--r-- 1 nandam nandam  785280 2008-05-27 22:26 gdocs-1.0.4.oxt
-rw-r--r-- 1 nandam nandam 4997184 2008-05-27 22:16 Sun_ODF_Template_Pack_en-US.oxt

But the size is in ascending order. If you want the listing in descending order use -r option

ls -l|sort -k 5 -n -r

or

ls -l|sort -k 5 -nr

now the output will be in descending order like this

-rw-r--r-- 1 nandam nandam 4997184 2008-05-27 22:16 Sun_ODF_Template_Pack_en-US.oxt
-rw-r--r-- 1 nandam nandam  785280 2008-05-27 22:26 gdocs-1.0.4.oxt
-rwxr-xr-x 1 nandam nandam  360756 2008-01-18 19:30 WriterTemplates.oxt
-rwxr-xr-x 1 nandam nandam   48019 2008-01-18 19:30 WriterTools.oxt

anyway the above is only for illustration.. the same can be obtained by command ls

$ls -lS

by default, it sort takes space as delimiter. to set another character as delimiter use -t

$sort -t : xxxxxx

Now you don’t want to sort already sorted data. Use -c to check for sorted data and -u to show only unique records.
-c options report the first line if the given data is not sorted. To stop it from displaying the first record use -C.

sample input files.txt

-rw-r--r-- 1 nandam nandam 4997184 2008-05-27 22:16 Sun_ODF_Template_Pack_en-US.oxt
-rw-r--r-- 1 nandam nandam 4997184 2008-05-27 22:16 Sun_ODF_Template_Pack_en-US.oxt
-rw-r--r-- 1 nandam nandam  785280 2008-05-27 22:26 gdocs-1.0.4.oxt
-rwxr-xr-x 1 nandam nandam  360756 2008-01-18 19:30 WriterTemplates.oxt
-rwxr-xr-x 1 nandam nandam   48019 2008-01-18 19:30 WriterTools.oxt

$sort -k 6,7 files.txt

sort the data first by column 6 and then by column 7
and the above command gives the files by last modified date and then by time.

Of course, if you want to list the files by last modification date you can use

$ls -lt

which gives the same output as above command
Let us use another command in conjugation with sort.
like df

$df

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1             19542436   4209216  15333220  22% /
tmpfs                   242092         0    242092   0% /lib/init/rw
udev                     10240       104     10136   2% /dev
tmpfs                   242092         0    242092   0% /dev/shm
/dev/hda6             58133024  53965408   4167616  93% /mnt/win
/dev/sdb1              3936736    897564   3039172  23% /media/KINGSTON
/dev/hdc               4588298   4588298         0 100% /media/cdrom0
/dev/sda1            488384000 270011588 218372412  56% /media/disk

$df |sort -k 2 -n

gives the size of partitions in ascending order.

Filesystem           1K-blocks      Used Available Use% Mounted on
udev                     10240       104     10136   2% /dev
tmpfs                   242092         0    242092   0% /dev/shm
tmpfs                   242092         0    242092   0% /lib/init/rw
/dev/sdb1              3936736    897564   3039172  23% /media/KINGSTON
/dev/hdc               4588298   4588298         0 100% /media/cdrom0
/dev/hda1             19542436   4209228  15333208  22% /
/dev/hda6             58133024  53965408   4167616  93% /mnt/win
/dev/sda1            488384000 270011588 218372412  56% /media/disk

Suppose if I want to know which drive have largest percent of space used I have to enter

$df | sort -k 5 -n

Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   242092         0    242092   0% /dev/shm
tmpfs                   242092         0    242092   0% /lib/init/rw
udev                     10240       104     10136   2% /dev
/dev/hda1             19542436   4209228  15333208  22% /
/dev/sdb1              3936736    897568   3039168  23% /media/KINGSTON
/dev/sda1            488384000 270011588 218372412  56% /media/disk
/dev/hda6             58133024  53965408   4167616  93% /mnt/win
/dev/hdc               4588298   4588298         0 100% /media/cdrom0

and for disk with most free space

$df | sort -k 4 -n

if you want to see processes using large memory use

$ps -A v |sort -k 9 -nr|more

3341 ?        S      0:08     76  1001 81054 35696  7.3 python /usr/bin/comix
2674 ?        S      0:17     83  1154 79481 32204  6.6 nautilus –no-default-window –sm-client-id default2
3325 ?        Sl     0:07    152    58 96405 30412  6.2 /usr/bin/../lib/kompozer/kompozer-bin
2671 ?        S      0:07     58   459 36640 20896  4.3 gnome-panel –sm-client-id default1
3141 ?        Sl     0:02     56   226 41329 19844  4.0 gnome-terminal
2487 tty7     Ss+    0:53     65  1591 54696 16044  3.3 /usr/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
2766 ?        Sl     0:00      3    37 35430 14420  2.9 /usr/lib/gnome-applets
--More--

Anyway, you know now how sort is helpful.

above examples are on piping the output of one tool to other tool using ‘ | ‘References

Categories
cheat sheets commands Info

Dpkg Cheat Sheet


Dpkg Cheat Sheet.

Dpkg is used to manage software management in debian or to install .deb packages. One can view what packages are installed on the system or get information about a package using dpkg. It is very simple and straight forward. Dpkg is like rpm (redhat package manager ) but used in debian like systems. Here is a small list of useful options that make you life peaceful while dealing with installation of .deb packages.


Dpkg Cheat Sheet.

Syntax Description example
dpkg
-i package-name.deb
Install
a new package or upgrade an existing package
dpkg
-i AdobeReader.deb
dpkg -r package-name remove/delete a package
leaving configuration files
dpkg -r d4x
dpkg -P package-name remove/delete a package
and all the configuration files
dpkg -P d4x
dpkg
-R directory
Install
packages from a particular directory recursively.
dpkr
-R /root/debpackages/
dpkg -l lists all packages
installed with description and version information
dpkg -l

dkpg -l|more

dpkg -l|less

dpkg -l *d4x*

dpkg -l package-name List individual installed
packages, along with package version,status of the package and short
description. The output format is same as dpkg -l
dpkg -l d4x
dpkg -L package-name Lists where the files that
come with the package are installed.
dpkg
-L d4x
dkpg -c package.deb List all the files that
are copied or installed in the system with the place where they are
installed
dpkg -c gimp-1.1_i386.deb
dpkg
-S /path-to-file
Lists which package owns
the file.
dpkg
-S /usr/bin/acroread
dpkg -s package-name

or

dpkg -s package| grep Status

gives the status of the
package and other information like

Package, Status, Priority, Section (category of package),
Installed-Size, Maintainer, Architecture, Version, Dependencies
& Description

dpkg -s d4x

or

dpkg -s d4x|grep Status

dpkg -p package-name Gives the information about a package.Package,
Priority, Section (category of package),
Installed-Size, Maintainer, Architecture, Version, Dependencies
&
Description

dpkg -p d4x

Output for dkpg -l|more

Desired=Unknown/Install/Remove/Purge/Hold

|
Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend

|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)

||/
Name               Version            Description

+++-==============-================================-=============================

ii 
acpi              
0.09-4             displays
information on ACPI devices

ii 
acpid             
1.0.6-8            Utilities
for using ACPI power management

ii 

adduser           
3.107              add
and remove users and groups

ii  adobereader-enu   
8.1.2              Adobe
Reader allows you to view navigate and

ii 
alacarte         

 0.11.3-1           easy
GNOME menu editing tool

ii 
alsa-base          1.0.16-1.1        
ALSA driver configuration files

ii 
alsa-utils         1.0.16-1           ALSA
utilities

Return to top

Output for dpkg -l *d4x*
the output for dpkg -l d4x also will be like below but only
information for d4x package is displayed

Desired=Unknown/Install/Remove/Purge/Hold

|
Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend

|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)

||/
Name       
   

 Version       Description

+++-===========-======================-===================================

ii 
d4x              2.5.7.1-5     graphical
download manager

ii 
d4x-common       2.5.7.1-5     graphical
download manager - common files

Return to top

Output for dpkg -L d4x
will be like

/.

/usr

/usr/share

/usr/share/pixmaps

/usr/share/pixmaps/nt.xpm

/usr/share/pixmaps/nt.png

/usr/share/locale

/usr/share/locale/ca

/usr/share/locale/ca/LC_MESSAGES

/usr/share/locale/ca/LC_MESSAGES/d4x.mo

/usr/share/locale/zh_CN

/usr/share/locale/zh_CN/LC_MESSAGES

/usr/share/locale/zh_CN/LC_MESSAGES/d4x.mo

/usr/share/locale/de

/usr/share/locale/de/LC_MESSAGES

/usr/share/locale/de/LC_MESSAGES/d4x.mo

/usr/share/locale/ru

/usr/share/locale/ru/LC_MESSAGES

/usr/share/locale/ru/LC_MESSAGES/d4x.mo

/usr/share/locale/bg

/usr/share/locale/bg/LC_MESSAGES

–More–

Return to top

output for dpkg -S
/usr/bin/acroread

adobereader-enu:
/usr/bin/acroread

output for dpkg
-s d4x
 

Package: d4x
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 2028
Maintainer: Debian QA Group Architecture: i386
Version: 2.5.7.1-5
Depends:
libao2 (>= 0.8.8), libatk1.0-0 (>= 1.20.0), libc6 (>=
2.6.1-1), libcairo2 (>= 1.4.0), libfontconfig1 (>= 2.4.0),
libgcc1 (>= 1:4.2.1), libglib2.0-0 (>= 2.14.0), libgtk2.0-0
(>= 2.12.0), libpango1.0-0 (>= 1.18.2), libssl0.9.8 (>=
0.9.8f-1), libstdc++6 (>= 4.2.1), libx11-6, libxcomposite1 (>=
1:0.3-1), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1),
libxext6, libxfixes3 (>= 1:4.0.1), libxi6, libxinerama1, libxrandr2
(>= 2:1.2.0), libxrender1, d4x-common (= 2.5.7.1-5)
Description: graphical download manager
 Downloader for X is a powerful graphical download manager.
 It supports both HTTP(S) and FTP protocols and has nice graphical
 user interface, though some actions can also be performed using
 the command line.
 .
 Among others, its key features include proxy and SOCKS5 support,
 recursive downloading, wildcard matching, download scheduler,
 multiple download queues and more…
 .
 Homepage: http://www.krasu.ru/soft/chuchelo/

Return to top

Output for dpkg -p comix

Package: comix
Priority: optional
Section: x11
Installed-Size: 1416
Maintainer: Emfox Zhou
Architecture: all
Version: 3.6.4-1.1
Depends: gconf2 (>= 2.10.1-2), python (>= 2.3), python-gtk2 (>= 2.8), python-imaging (>= 1.1.4)
Suggests: libjpeg-progs, unrar
Size: 234988
Description: GTK Comic Book Viewer
 Comix is a comic book viewer. It reads zip, rar, tar, tar.gz and
 tar.bz2 archives (often called .cbz, .cbr and .cbt) as well as
 normal image files. It is written in Python and has a simple user
 interface using PyGTK.
 .
 Main Features:
 .
   * Fullscreen mode.
   * Double page mode.
   * Fit-to-screen mode.
   * Zooming and scrolling.
   * Rotation and mirroring.
   * Magnification lens.
   * Changeable image scaling quality.
   * Image enhancement.
   * Can read right-to-left to fit manga etc.
   * Caching for faster page flipping.
   * Bookmarks support.
   * Customizable GUI.
   * Archive comments support.
   * Archive converter.
   * Thumbnail browser.
   * Standards compliant.
   * Translated to English, Swedish, Simplified Chinese, Spanish,
     Brazilian Portuguese and German.
   * Reads the JPEG, PNG, TIFF, GIF, BMP, ICO, XPM and XBM image formats.
   * Reads ZIP and tar archives natively, and RAR archives through the unrar
     program.
   * Runs on Linux, FreeBSD, NetBSD and virtually any other UNIX-like OS.
   * More!

Return to top

Categories
Info

Nautilus Scripts for making Small Utilities

Making Custom Utilites using nautilus scripts.

Gnome provides a convenient way to pass input from nautilus to command line or scripts. Using Nautilus scripts you can make custom utlities that save your time and energy.

you make custom scripts and place them in ~/.gnome2/nautilus-scripts directory.
then logout and login you will see a menu in right click dropdown menu named scripts.

All executable files in ~/.gnome2/nautilus-scripts will appear in the Scripts menu. Choosing a script from the menu will run that script.
When executed from a local folder, scripts will be passed the selected file names. When executed from a remote folder (e.g. a folder showing web or ftp content), scripts will be passed no parameters. In all cases, the following environment variables will be set by Nautilus, which the scripts may use: NAUTILUS_SCRIPT_SELECTED_FILE_PATHS: newline-delimited paths for selected files (only if local) NAUTILUS_SCRIPT_SELECTED_URIS: newline-delimited URIs for selected files NAUTILUS_SCRIPT_CURRENT_URI: URI for current location NAUTILUS_SCRIPT_WINDOW_GEOMETRY: position and size of current window

well that explains it briefly.

coming for examples of scripts like to open a gnome terminal in current window place a script named open-terminal in the scripts folder.

#!/bin/sh gnome-terminal

when you choose this script from scripts menu it will open a gnome-terminal in current folder.
I have been using a script (play_all_files) that plays all the audio files in current directory with an audioplayer.

#/bin/sh mplayer *.mp3

as mentioned above you can pass the names or the paths of selected files to scripts. Suppose if you want to make a copy of file to desktop use this script (copy_to_desktop).

#/bin/sh
cp $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS ~/Desktop

when you run this script the selected file is copied to Desktop.
you can also do the same trick to copy the selected files to your removable drives like USB drive.

Here are more useful Nautilus Scripts

Categories
Info system monitoring

Disk Monitoring and reporting Utilities in linux

Disk monitoring utilities for LINUX

du and df are most commonly used tools for monitoring disk space

Contents

DF

df is used to get and overview of disk space in partitions and du for
directories.

df will give you output in KB.

$df

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1 19542436 7709984 11832452 40% /
tmpfs 242092 0 242092 0% /lib/init/rw
udev 10240 104 10136 2% /dev
tmpfs 242092 0 242092 0% /dev/shm
/dev/hda6 58133024 54084416 4048608 94% /mnt/win
/dev/hdc 4455234 4455234 0 100% /media/cdrom0
/dev/sda1 488384000 264882404 223501596 55% /media/disk
/dev/sdb1 3936736 1897172 2039564 49% /media/KINGSTON_


$df -h
the output will be in human readable form, like MB and GB

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1 19G 7.4G 12G 40% /
tmpfs 237M 0 237M 0% /lib/init/rw
udev 10M 104K 9.9M 2% /dev
tmpfs 237M 0 237M 0% /dev/shm
/dev/hda6 56G 52G 3.9G 94% /mnt/win
/dev/hdc 4.3G 4.3G 0 100% /media/cdrom0
/dev/sda1 466G 253G 214G 55% /media/disk
/dev/sdb1 3.8G 1.9G 2.0G 49% /media/KINGSTON_

Return to Contents

Monitoring system using DF

By the way how do you monitor disk size?
use ‘watch’ to run this evey 10 sec or any no of second you want like
enter

 
$watch -n 600 df -h

you will see a screen on terminal like
df -h command will be run every 600 seconds. and you can monitor the
disk space in case of critical systems.

 
 
Every 600.0s: df -h                                     Sat Jul 12 00:51:08 2008

Filesystem Size Used Avail Use% Mounted on
/dev/hda1 19G 7.4G 12G 40% /
tmpfs 237M 0 237M 0% /lib/init/rw
udev 10M 104K 9.9M 2% /dev
tmpfs 237M 0 237M 0% /dev/shm
/dev/hda6 56G 52G 3.9G 94% /mnt/win
/dev/hdc 4.3G 4.3G 0 100% /media/cdrom0
/dev/sda1 466G 253G 214G 55% /media/disk
/dev/sdb1 3.8G 1.9G 2.0G 49% /media/KINGSTON_




Return to Contents

DU

du is used to find the size of current directory.

du will give you the list of directories present in current directory
and their size in kB or MB or Gb recursively
suppose my current directory has following folders

drwxrwxrwx 3 root root  32K 2008-07-03 23:54 ak.buy.com
-rwxrwxrwx 1 root root 4.2K 2008-07-03 23:54 backblue.gif
-rwxrwxrwx 1 root root 324 2008-07-03 23:54 cookies.txt
drwxrwxrwx 2 root root 32K 2008-07-03 23:54 edge.quantserve.com
-rwxrwxrwx 1 root root 828 2008-07-03 23:54 fade.gif
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 fp.buy.com
drwxrwxrwx 2 root root 32K 2008-07-03 23:54 hts-cache
-rwxrwxrwx 1 root root 16K 2008-07-03 23:54 hts-log.txt
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 img.tradepub.com
-rwxrwxrwx 1 root root 5.2K 2008-07-03 23:54 index.html
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 pagead2.googlesyndication.com
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 pixel.quantserve.com
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 tags.expo9.exponential.com
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 www.hauppauge.com
drwxrwxrwx 2 root root 32K 2008-07-03 23:54 www.netlingo.com
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 www.paypal.com
drwxrwxrwx 3 root root 32K 2008-07-03 23:54 www.smallclaim.info
drwxrwxrwx 2 root root 32K 2008-07-03 23:54 www.submitexpress.com
drwxrwxrwx 6 root root 32K 2008-07-03 23:54 www.yolinux.com

If you run du on this folder the output will be

 
 
 
64 ./www.hauppauge.com/html
96 ./www.hauppauge.com
64 ./tags.expo9.exponential.com/tags/YoLinuxcom/ros
96 ./tags.expo9.exponential.com/tags/YoLinuxcom
128 ./tags.expo9.exponential.com/tags
160 ./tags.expo9.exponential.com
2208 ./hts-cache
64 ./img.tradepub.com/free/bsm/images
96 ./img.tradepub.com/free/bsm
64 ./img.tradepub.com/free/ddj/images
96 ./img.tradepub.com/free/ddj
64 ./img.tradepub.com/free/orm/images
96 ./img.tradepub.com/free/orm
64 ./img.tradepub.com/free/inft/images
96 ./img.tradepub.com/free/inft
64 ./img.tradepub.com/free/proc/images
96 ./img.tradepub.com/free/proc
64 ./img.tradepub.com/free/w_nf03/images
96 ./img.tradepub.com/free/w_nf03
64 ./img.tradepub.com/free/w_swm02/images
96 ./img.tradepub.com/free/w_swm02
704 ./img.tradepub.com/free
736 ./img.tradepub.com
64 ./www.submitexpress.com
64 ./pixel.quantserve.com/pixel
96 ./pixel.quantserve.com
6528 ./www.yolinux.com/books
160 ./www.yolinux.com/MIME-EXAMPLES
128 ./www.yolinux.com/awebdap
3168 ./www.yolinux.com/TUTORIALS/src
9408 ./www.yolinux.com/TUTORIALS/images
24384 ./www.yolinux.com/TUTORIALS
31232 ./www.yolinux.com
64 ./ak.buy.com/db_assets/prod_images/077
64 ./ak.buy.com/db_assets/prod_images/129
64 ./ak.buy.com/db_assets/prod_images/141
64 ./ak.buy.com/db_assets/prod_images/323
64 ./ak.buy.com/db_assets/prod_images/343
64 ./ak.buy.com/db_assets/prod_images/426
64 ./ak.buy.com/db_assets/prod_images/518
64 ./ak.buy.com/db_assets/prod_images/521
64 ./ak.buy.com/db_assets/prod_images/594
64 ./ak.buy.com/db_assets/prod_images/637
64 ./ak.buy.com/db_assets/prod_images/720
64 ./ak.buy.com/db_assets/prod_images/748
64 ./ak.buy.com/db_assets/prod_images/769
64 ./ak.buy.com/db_assets/prod_images/801
64 ./ak.buy.com/db_assets/prod_images/816
992 ./ak.buy.com/db_assets/prod_images
1024 ./ak.buy.com/db_assets
1056 ./ak.buy.com
64 ./pagead2.googlesyndication.com/pagead
96 ./pagead2.googlesyndication.com
64 ./www.netlingo.com
32 ./fp.buy.com/buy_assets/affiliate/01
64 ./fp.buy.com/buy_assets/affiliate
96 ./fp.buy.com/buy_assets
128 ./fp.buy.com
64 ./www.paypal.com/en_US/i/icon
96 ./www.paypal.com/en_US/i
128 ./www.paypal.com/en_US
160 ./www.paypal.com
64 ./edge.quantserve.com
128 ./www.smallclaim.info/cyberdata
160 ./www.smallclaim.info
36512 .

But everything is in kilobytes by default. To get a human readable
output you have to use -h and to summarize the size of directory use -s
du -h gives you the output as

64K ./www.hauppauge.com/html
96K ./www.hauppauge.com
64K ./tags.expo9.exponential.com/tags/YoLinuxcom/ros
96K ./tags.expo9.exponential.com/tags/YoLinuxcom
128K ./tags.expo9.exponential.com/tags
160K ./tags.expo9.exponential.com
2.2M ./hts-cache
64K ./img.tradepub.com/free/bsm/images
96K ./img.tradepub.com/free/bsm
64K ./img.tradepub.com/free/ddj/images
96K ./img.tradepub.com/free/ddj
64K ./img.tradepub.com/free/orm/images
96K ./img.tradepub.com/free/orm
64K ./img.tradepub.com/free/inft/images
96K ./img.tradepub.com/free/inft
64K ./img.tradepub.com/free/proc/images
96K ./img.tradepub.com/free/proc
64K ./img.tradepub.com/free/w_nf03/images
96K ./img.tradepub.com/free/w_nf03
64K ./img.tradepub.com/free/w_swm02/images
96K ./img.tradepub.com/free/w_swm02
704K ./img.tradepub.com/free
736K ./img.tradepub.com
64K ./www.submitexpress.com
64K ./pixel.quantserve.com/pixel
96K ./pixel.quantserve.com
6.4M ./www.yolinux.com/books
160K ./www.yolinux.com/MIME-EXAMPLES
128K ./www.yolinux.com/awebdap
3.1M ./www.yolinux.com/TUTORIALS/src
9.2M ./www.yolinux.com/TUTORIALS/images
24M ./www.yolinux.com/TUTORIALS
31M ./www.yolinux.com
64K ./ak.buy.com/db_assets/prod_images/077
64K ./ak.buy.com/db_assets/prod_images/129
64K ./ak.buy.com/db_assets/prod_images/141
64K ./ak.buy.com/db_assets/prod_images/323
64K ./ak.buy.com/db_assets/prod_images/343
64K ./ak.buy.com/db_assets/prod_images/426
64K ./ak.buy.com/db_assets/prod_images/518
64K ./ak.buy.com/db_assets/prod_images/521
64K ./ak.buy.com/db_assets/prod_images/594
64K ./ak.buy.com/db_assets/prod_images/637
64K ./ak.buy.com/db_assets/prod_images/720
64K ./ak.buy.com/db_assets/prod_images/748
64K ./ak.buy.com/db_assets/prod_images/769
64K ./ak.buy.com/db_assets/prod_images/801
64K ./ak.buy.com/db_assets/prod_images/816
992K ./ak.buy.com/db_assets/prod_images
1.0M ./ak.buy.com/db_assets
1.1M ./ak.buy.com
64K ./pagead2.googlesyndication.com/pagead
96K ./pagead2.googlesyndication.com
64K ./www.netlingo.com
32K ./fp.buy.com/buy_assets/affiliate/01
64K ./fp.buy.com/buy_assets/affiliate
96K ./fp.buy.com/buy_assets
128K ./fp.buy.com
64K ./www.paypal.com/en_US/i/icon
96K ./www.paypal.com/en_US/i
128K ./www.paypal.com/en_US
160K ./www.paypal.com
64K ./edge.quantserve.com
128K ./www.smallclaim.info/cyberdata
160K ./www.smallclaim.info
36M .

To know the size of whole directory enter

$du -s
36512    .

$du -sh
36M    .



Same way if you have a important directory whose size is always in
changing you can use watch command to monitor it like

$watch -n 60 du -sh /path-to-your-directory


Above disk monitoring utilities are used extensively by IT
professionals like UNIX admins and Linux admins.
Indeed they are quite powerful and easy way to know your system

Return to Contents

References

watch manual
DF manual
du manual

Categories
Info

Gnome Shortcuts

Things can be done faster using a keyboard rather than a mouse.
Here are the general shortcuts for GNOME environment.

Global Shortcut Keys
Global
shortcut keys enable you to use the keyboard to perform tasks related
to your desktop, rather than tasks on the currently selected
window or application.

Alt +F1 Open Applications Menu
Alt+ F2 Open Run dialog
print screen Take a screenshot of entire desktop
Alt + print screen Take a screenshot of the currently focused window.
Ctrl + Alt + arrow keys Switch to the workspace to the specified direction of the current workspace
Ctrl+Alt+D Minimize all windows and give focus to the desktop.
Alt + tab Switch
between windows.  A list of windows that you can select is
displayed. Release the keys to select a window.  You can press the
Shift key to cycle through the windows in reverse order.

Ctrl+Alt+Tab
Switch the focus between the panels and the desktop. A list of items that you can select is displayed.  Release the
keys to select an item.  You can press the Shift key to cycle through the items in reverse order.

Window Shortcut Keys
Window shortcut keys allow you to use the keyboard to perform tasks on the currently focused window.

Alt +F4 Closes the currently focused window
Alt +F5 Unmaximize the current window, if it is maximized.
Alt+F7 Move
the currently focused window.  After pressing this shortcut, you
can move the window using either the mouse or the arrow keys.  To
finish the move, click the mouse or press any key on the keyboard.
Alt+F8 Resize
the currently focused window.  After pressing this shortcut, you
can resize the window using either the mouse or the arrow
keys.  To finish the resize, click the mouse or press any key on the keyboard.
Alt+F9 Minimize the current window.
Alt+F10 Maximize the current window.
Alt+spacebar Open
the window menu for the currently selected window.  The window
menu allows you to perform actions on the window, such as minimizing, moving between workspaces, and closing.
Shift+Ctrl+Alt+Arrow keys Move the current window to another workspace in the specified direction

Application Keys
Application
shortcut keys enable you to perform application tasks. You can use
shortcut keys to perform application tasks more quickly than if you use
a mouse

Ctrl+N Create a new document or window.
Ctrl+X Cut the selected text or region and place it on the clipboard.
Ctrl+C Copy the selected text or region onto the clipboard.
Ctrl+V Paste the contents of the clipboard.
Ctrl+Z Undo the last action.
Ctrl+S Save the current document to disk.
F1 Load the online help document for the application.
Categories
Info

Linux Sites

I will post popular linux sites here

Vi Tutorials

Vi tutorial at Purdue Univ

A very elaborate tutorial on VI covers many aspects and shows what is going on in the system when you execute each command in VI.

Linux Tutorials

Quick Linux Tutorial
A quick reference to basic commands of linux.

Advance Linux Tutorials
These are some advance tutorials in linux like taking backup of your hard disk, partitioning your hard disk.