Sunday, July 11, 2010

Man Page of rpm

NAME
       rpm - RPM Package Manager

SYNOPSIS
   QUERYING AND VERIFYING PACKAGES:
       rpm {-q|--query} [select-options] [query-options]



       rpm {-V|--verify} [select-options] [verify-options]



       rpm --import PUBKEY ...



       rpm {-K|--checksig} [--nosignature] [--nodigest]
           PACKAGE_FILE ...


   INSTALLING, UPGRADING, AND REMOVING PACKAGES:
       rpm {-i|--install} [install-options] PACKAGE_FILE ...



       rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...



       rpm {-F|--freshen} [install-options] PACKAGE_FILE ...



       rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts]
           [--notriggers] [--test] PACKAGE_NAME ...


   MISCELLANEOUS:
       rpm {--initdb|--rebuilddb}



       rpm {--addsign|--resign} PACKAGE_FILE ...



       rpm {--querytags|--showrc}



       rpm {--setperms|--setugids} PACKAGE_NAME ...


   select-options
        [PACKAGE_NAME] [-a,--all] [-f,--file FILE]
        [-g,--group GROUP] {-p,--package PACKAGE_FILE]
        [--fileid MD5] [--hdrid SHA1] [--pkgid MD5] [--tid TID]
        [--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME]
        [--whatprovides CAPABILITY] [--whatrequires CAPABILITY]


   query-options
        [--changelog] [-c,--configfiles] [-d,--docfiles] [--dump]
        [--filesbypkg] [-i,--info] [--last] [-l,--list]
        [--provides] [--qf,--queryformat QUERYFMT]
        [-R,--requires] [--scripts] [-s,--state]
        [--triggers,--triggerscripts]


   verify-options
        [--nodeps] [--nofiles] [--noscripts]
        [--nodigest] [--nosignature]
        [--nolinkto] [--nofiledigest] [--nosize] [--nouser]
        [--nogroup] [--nomtime] [--nomode] [--nordev]
        [--nocaps]


   install-options
        [--aid] [--allfiles] [--badreloc] [--excludepath OLDPATH]
        [--excludedocs] [--force] [-h,--hash]
        [--ignoresize] [--ignorearch] [--ignoreos]
        [--includedocs] [--justdb] [--nodeps]
        [--nodigest] [--nosignature] [--nosuggest]
        [--noorder] [--noscripts] [--notriggers]
        [--oldpackage] [--percent] [--prefix NEWPATH]
        [--relocate OLDPATH=NEWPATH]
        [--replacefiles] [--replacepkgs]
        [--test]


DESCRIPTION
       rpm is a powerful Package Manager, which can be used to build, install,
       query, verify, update, and erase individual software packages.  A pack-
       age  consists  of an archive of files and meta-data used to install and
       erase the archive files. The meta-data includes  helper  scripts,  file
       attributes,  and  descriptive  information about the package.  Packages
       come in two varieties: binary packages, used to encapsulate software to
       be  installed,  and  source  packages,  containing  the source code and
       recipe necessary to produce binary packages.

       One of the following basic modes must be selected: Query, Verify,  Sig-
       nature  Check, Install/Upgrade/Freshen, Uninstall, Initialize Database,
       Rebuild Database, Resign, Add Signature, Set Owners/Groups, Show Query-
       tags, and Show Configuration.

   GENERAL OPTIONS
       These options can be used in all the different modes.

       -?, --help
              Print a longer usage message then normal.

       --version
              Print  a  single line containing the version number of rpm being
              used.

       --quiet
              Print as little as possible - normally only error messages  will
              be displayed.

       -v     Print  verbose  information - normally routine progress messages
              will be displayed.

       -vv    Print lots of ugly debugging information.

       --rcfile FILELIST
              Each of the files  in  the  colon  separated  FILELIST  is  read
              sequentially  by  rpm  for  configuration information.  Only the
              first file in the list must exist, and tildes will  be  expanded
              to    the   value   of   $HOME.    The   default   FILELIST   is
              /usr/lib/rpm/rpmrc:/usr/lib/rpm/red-
              hat/rpmrc:/etc/rpmrc:~/.rpmrc.

       --pipe CMD
              Pipes the output of rpm to the command CMD.

       --dbpath DIRECTORY
              Use  the  database  in  DIRECTORY  rather  than the default path
              /var/lib/rpm

       --root DIRECTORY
              Use the file system tree rooted at DIRECTORY for all operations.
              Note  that this means the database within DIRECTORY will be used
              for dependency checks  and  any  scriptlet(s)  (e.g.   %post  if
              installing, or %prep if building, a package) will be run after a
              chroot(2) to DIRECTORY.

   INSTALL AND UPGRADE OPTIONS
       In these options, PACKAGE_FILE can be either rpm binary file  or  ASCII
       package  manifest (see PACKAGE SELECTION OPTIONS), and may be specified
       as an ftp or http URL, in which case the  package  will  be  downloaded
       before  being  installed. See FTP/HTTP OPTIONS for information on rpm's
       internal ftp and http client support.

       The general form of an rpm install command is

       rpm {-i|--install} [install-options] PACKAGE_FILE ...

       This installs a new package.

       The general form of an rpm upgrade command is

       rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...

       This upgrades or installs the package currently installed  to  a  newer
       version.   This  is the same as install, except all other version(s) of
       the package are removed after the new package is installed.

       rpm {-F|--freshen} [install-options] PACKAGE_FILE ...

       This will upgrade packages, but only ones for which an earlier  version
       is installed.


       --aid  Add suggested packages to the transaction set when needed.

       --allfiles
              Installs  or  upgrades  all  the missingok files in the package,
              regardless if they exist.

       --badreloc
              Used with --relocate, permit relocations on all file paths,  not
              just  those  OLDPATH's included in the binary package relocation
              hint(s).

       --excludepath OLDPATH
              Don't install files whose name begins with OLDPATH.

       --excludedocs
              Don't install any files which are marked as documentation (which
              includes man pages and texinfo documents).

       --force
              Same as using --replacepkgs, --replacefiles, and --oldpackage.

       -h, --hash
              Print  50  hash  marks  as the package archive is unpacked.  Use
              with -v|--verbose for a nicer display.

       --ignoresize
              Don't check mount file systems for sufficient disk space  before
              installing this package.

       --ignorearch
              Allow installation or upgrading even if the architectures of the
              binary package and host don't match.

       --ignoreos
              Allow installation or upgrading even if the operating systems of
              the binary package and host don't match.

       --includedocs
              Install documentation files. This is the default behavior.

       --justdb
              Update only the database, not the filesystem.

       --nodigest
              Don't verify package or header digests when reading.

       --nomanifest
              Don't process non-package files as manifests.

       --nosignature
              Don't verify package or header signatures when reading.

       --nodeps
              Don't  do  a  dependency  check before installing or upgrading a
              package.

       --nosuggest
              Don't suggest package(s) that provide a missing dependency.

       --noorder
              Don't reorder the packages for an install. The list of  packages
              would normally be reordered to satisfy dependencies.

       --noscripts

       --nopre

       --nopost

       --nopreun

       --nopostun
              Don't  execute  the scriptlet of the same name.  The --noscripts
              option is equivalent to

              --nopre --nopost --nopreun --nopostun

              and turns off the execution of the  corresponding  %pre,  %post,
              %preun, and %postun scriptlet(s).

       --notriggers

       --notriggerin

       --notriggerun

       --notriggerpostun
              Don't  execute  any  trigger  scriptlet  of the named type.  The
              --notriggers option is equivalent to

              --notriggerin --notriggerun --notriggerpostun

              and turns off execution of the corresponding %triggerin,  %trig-
              gerun, and %triggerpostun scriptlet(s).

       --oldpackage
              Allow an upgrade to replace a newer package with an older one.

       --percent
              Print  percentages  as  files  are  unpacked  from  the  package
              archive.  This is intended to make rpm easy to  run  from  other
              tools.

       --prefix NEWPATH
              For  relocatable  binary packages, translate all file paths that
              start with the installation prefix  in  the  package  relocation
              hint(s) to NEWPATH.

       --relocate OLDPATH=NEWPATH
              For  relocatable  binary packages, translate all file paths that
              start with OLDPATH in the package relocation hint(s) to NEWPATH.
              This  option  can be used repeatedly if several OLDPATH's in the
              package are to be relocated.

       --replacefiles
              Install the packages even if  they  replace  files  from  other,
              already installed, packages.

       --replacepkgs
              Install  the packages even if some of them are already installed
              on this system.

       --test Do not install the package, simply check for and  report  poten-
              tial conflicts.

   ERASE OPTIONS
       The general form of an rpm erase command is


       rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts] [--notriggers]
       [--test] PACKAGE_NAME ...


       The following options may also be used:

       --allmatches
              Remove all versions of the  package  which  match  PACKAGE_NAME.
              Normally  an  error  is  issued if PACKAGE_NAME matches multiple
              packages.

       --nodeps
              Don't check dependencies before uninstalling the packages.

       --noscripts

       --nopreun

       --nopostun
              Don't execute the scriptlet of the same name.   The  --noscripts
              option during package erase is equivalent to

              --nopreun --nopostun

              and  turns  off  the  execution of the corresponding %preun, and
              %postun scriptlet(s).

       --notriggers

       --notriggerun

       --notriggerpostun
              Don't execute any trigger scriptlet  of  the  named  type.   The
              --notriggers option is equivalent to

              --notriggerun --notriggerpostun

              and  turns  off  execution  of the corresponding %triggerun, and
              %triggerpostun scriptlet(s).

       --test Don't really uninstall anything, just go  through  the  motions.
              Useful in conjunction with the -vv option for debugging.

   QUERY OPTIONS
       The general form of an rpm query command is


       rpm {-q|--query} [select-options] [query-options]


       You  may  specify the format that package information should be printed
       in. To do this, you use the

        --qf|--queryformat QUERYFMT

       option, followed by the QUERYFMT format string.  Query formats are mod-
       ified versions of the standard printf(3) formatting. The format is made
       up of static strings (which may include standard  C  character  escapes
       for  newlines,  tabs,  and other special characters) and printf(3) type
       formatters.  As rpm already knows the type to print, the type specifier
       must  be omitted however, and replaced by the name of the header tag to
       be printed, enclosed by {} characters. Tag names are case  insensitive,
       and the leading RPMTAG_ portion of the tag name may be omitted as well.

       Alternate output formats may be requested by  following  the  tag  with
       :typetag.  Currently, the following types are supported:

       :armor Wrap a public key in ASCII armor.

       :arraysize
              Display number of elements in array tags.

       :base64
              Encode binary data using base64.

       :date  Use strftime(3) "%c" format.

       :day   Use strftime(3) "%a %b %d %Y" format.

       :depflags
              Format dependency flags.

       :fflags
              Format file flags.

       :hex   Format in hexadecimal.

       :octal Format in octal.

       :perms Format file permissions.

       :pgpsig
              Display signature fingerprint and time.

       :shescape
              Escape single quotes for use in a script.

       :triggertype
              Display trigger suffix.

       :xml   Wrap data in simple xml markup.

       For example, to print only the names of the packages queried, you could
       use %{NAME} as the format string.  To print the packages name and  dis-
       tribution information in two columns, you could use %-30{NAME}%{DISTRI-
       BUTION}.  rpm will print a list of all of the tags it knows about  when
       it is invoked with the --querytags argument.

       There  are  two subsets of options for querying: package selection, and
       information selection.

   PACKAGE SELECTION OPTIONS:
       PACKAGE_NAME
              Query installed package named PACKAGE_NAME.

       -a, --all
              Query all installed packages.

       -f, --file FILE
              Query package owning FILE.

       --fileid MD5
              Query package that contains a given file  identifier,  i.e.  the
              MD5 digest of the file contents.

       -g, --group GROUP
              Query packages with the group of GROUP.

       --hdrid SHA1
              Query  package that contains a given header identifier, i.e. the
              SHA1 digest of the immutable header region.

       -p, --package PACKAGE_FILE
              Query an (uninstalled) package PACKAGE_FILE.   The  PACKAGE_FILE
              may  be specified as an ftp or http style URL, in which case the
              package header will be downloaded  and  queried.   See  FTP/HTTP
              OPTIONS  for  information  on rpm's internal ftp and http client
              support. The PACKAGE_FILE argument(s), if not a binary  package,
              will be interpreted as an ASCII package manifest unless --noman-
              ifest option is used.  In  manifests,  comments  are  permitted,
              starting  with  a  '#', and each line of a package manifest file
              may include white space separated  glob  expressions,  including
              URL's,  that  will  be expanded to paths that are substituted in
              place of the package manifest as additional  PACKAGE_FILE  argu-
              ments to the query.

       --pkgid MD5
              Query package that contains a given package identifier, i.e. the
              MD5 digest of the combined header and payload contents.

       --querybynumber HDRNUM
              Query the HDRNUMth database entry directly; this is useful  only
              for debugging.

       --specfile SPECFILE
              Parse  and  query SPECFILE as if it were a package. Although not
              all the information (e.g. file lists) is available, this type of
              query  permits  rpm  to be used to extract information from spec
              files without having to write a specfile parser.

       --tid TID
              Query package(s) that have a given TID transaction identifier. A
              unix  time  stamp is currently used as a transaction identifier.
              All package(s) installed or erased within a  single  transaction
              have a common identifier.

       --triggeredby PACKAGE_NAME
              Query packages that are triggered by package(s) PACKAGE_NAME.

       --whatprovides CAPABILITY
              Query all packages that provide the CAPABILITY capability.

       --whatrequires CAPABILITY
              Query  all packages that require CAPABILITY for proper function-
              ing.
              Note that this does not return what requires a given package.  A
              package usually provides multiple capabilities and file-names on
              which other packages may depend. To see the  complete  dependen-
              cies for a package, use -e --test PACKAGE_NAME

   PACKAGE QUERY OPTIONS:
       --changelog
              Display change information for the package.

       -c, --configfiles
              List only configuration files (implies -l).

       -d, --docfiles
              List only documentation files (implies -l).

       --dump Dump file information as follows (implies -l):


              path size mtime filedigest mode owner group isconfig isdoc rdev symlink


       --filesbypkg
              List all the files in each selected package.

       -i, --info
              Display   package  information,  including  name,  version,  and
              description.  This uses the --queryformat if one was  specified.

       --last Orders  the package listing by install time such that the latest
              packages are at the top.

       -l, --list
              List files in package.

       --provides
              List capabilities this package provides.

       -R, --requires
              List capabilities on which this package depends.

       --scripts
              List the package specific scriptlet(s) that are used as part  of
              the installation and uninstallation processes.

       -s, --state
              Display  the  states  of files in the package (implies -l).  The
              state of each file is one of normal, not installed, or replaced.

       --triggers, --triggerscripts
              Display  the trigger scripts, if any, which are contained in the
              package.

   VERIFY OPTIONS
       The general form of an rpm verify command is


       rpm {-V|--verify} [select-options] [verify-options]


       Verifying a package compares information about the installed  files  in
       the  package  with  information  about the files taken from the package
       metadata stored in the rpm database.   Among  other  things,  verifying
       compares  the size, MD5 sum, permissions, type, owner and group of each
       file.  Any discrepancies are displayed.  Files that were not  installed
       from  the package, for example, documentation files excluded on instal-
       lation using the "--excludedocs" option, will be silently ignored.

       The package selection options are the  same  as  for  package  querying
       (including  package manifest files as arguments).  Other options unique
       to verify mode are:

       --nodeps
              Don't verify dependencies of packages.

       --nodigest
              Don't verify package or header digests when reading.

       --nofiles
              Don't verify any attributes of package files.

       --noscripts
              Don't execute the %verifyscript scriptlet (if any).

       --nosignature
              Don't verify package or header signatures when reading.

       --nolinkto

       --nofiledigest (formerly --nomd5)

       --nosize

       --nouser

       --nogroup

       --nomtime

       --nomode

       --nordev
              Don't verify the corresponding file attribute.

       The format of the output is  a  string  of  8  characters,  a  possible
       attribute marker:

       c %config configuration file.
       d %doc documentation file.
       g %ghost file (i.e. the file contents are not included in the package payload).
       l %license license file.
       r %readme readme file.

       from  the  package  header,  followed  by the file name.  Each of the 8
       characters denotes the result of a comparison of  attribute(s)  of  the
       file  to  the  value of those attribute(s) recorded in the database.  A
       single "." (period) means the test passed, while a single "?" (question
       mark)  indicates the test could not be performed (e.g. file permissions
       prevent reading). Otherwise, the  (mnemonically  emBoldened)  character
       denotes failure of the corresponding --verify test:

       S file Size differs
       M Mode differs (includes permissions and file type)
       5 MD5 sum differs
       D Device major/minor number mismatch
       L readLink(2) path mismatch
       U User ownership differs
       G Group ownership differs
       T mTime differs
       P caPabilities differ


   DIGITAL SIGNATURE AND DIGEST VERIFICATION
       The general forms of rpm digital signature commands are



       rpm --import PUBKEY ...


       rpm {--checksig} [--nosignature] [--nodigest]
           PACKAGE_FILE ...


       The  --checksig  option checks all the digests and signatures contained
       in PACKAGE_FILE to ensure the integrity and origin of the package. Note
       that  signatures  are  now  verified  whenever  a  package is read, and
       --checksig is useful to verify all of the digests and signatures  asso-
       ciated with a package.

       Digital  signatures  cannot be verified without a public key.  An ASCII
       armored public key can be added to the rpm database using --import.  An
       imported  public key is carried in a header, and key ring management is
       performed exactly like package management. For example,  all  currently
       imported public keys can be displayed by:

       rpm -qa gpg-pubkey*

       Details about a specific public key, when imported, can be displayed by
       querying.  Here's information about the Red Hat GPG/DSA key:

       rpm -qi gpg-pubkey-db42a60e

       Finally, public keys can be erased after importing just like  packages.
       Here's how to remove the Red Hat GPG/DSA key

       rpm -e gpg-pubkey-db42a60e

   SIGNING A PACKAGE
       rpm --addsign|--resign PACKAGE_FILE ...


       Both of the --addsign and --resign options generate and insert new sig-
       natures for each package PACKAGE_FILE  given,  replacing  any  existing
       signatures.  There  are two options for historical reasons, there is no
       difference in behavior currently.

   USING GPG TO SIGN PACKAGES
       In order to sign packages using GPG, rpm must be configured to run  GPG
       and  be  able to find a key ring with the appropriate keys. By default,
       rpm uses the same conventions as GPG to  find  key  rings,  namely  the
       $GNUPGHOME  environment  variable.   If  your key rings are not located
       where GPG expects them to be, you will  need  to  configure  the  macro
       %_gpg_path to be the location of the GPG key rings to use.

       For  compatibility  with  older  versions of GPG, PGP, and rpm, only V3
       OpenPGP signature packets should be configured.  Either DSA or RSA ver-
       ification algorithms can be used, but DSA is preferred.

       If  you  want to be able to sign packages you create yourself, you also
       need to create your own public and secret key pair (see  the  GPG  man-
       ual). You will also need to configure the rpm macros

       %_signature
              The signature type.  Right now only gpg and pgp are supported.

       %_gpg_name
              The  name  of  the "user" whose key you wish to use to sign your
              packages.

       For example, to be able to use GPG to sign packages as the  user  "John
       Doe  "  from the key rings located in /etc/rpm/.gpg using
       the executable /usr/bin/gpg you would include

       %_signature gpg
       %_gpg_path /etc/rpm/.gpg
       %_gpg_name John Doe
       %__gpg /usr/bin/gpg

       in a macro configuration file. Use /etc/rpm/macros for per-system  con-
       figuration  and ~/.rpmmacros for per-user configuration. Typically it's
       sufficient to set just %_gpg_name.

   REBUILD DATABASE OPTIONS
       The general form of an rpm rebuild database command is


       rpm {--initdb|--rebuilddb} [-v] [--dbpath DIRECTORY] [--root DIRECTORY]


       Use  --initdb  to  create  a  new database if one doesn't already exist
       (existing database is not overwritten), use --rebuilddb to rebuild  the
       database indices from the installed package headers.

   SHOWRC
       The command

       rpm --showrc

       shows  the values rpm will use for all of the options are currently set
       in rpmrc and macros configuration file(s).

   FTP/HTTP OPTIONS
       rpm can act as an FTP and/or  HTTP  client  so  that  packages  can  be
       queried  or  installed  from  the internet.  Package files for install,
       upgrade, and query operations may be specified as an ftp or http  style
       URL:

       ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm

       If  the :PASSWORD portion is omitted, the password will be prompted for
       (once per user/hostname pair). If both the user and password are  omit-
       ted, anonymous ftp is used.  In all cases, passive (PASV) ftp transfers
       are performed.

       rpm allows the following options to be used with ftp URLs:

       --ftpproxy HOST
              The host HOST will be used as a proxy server for all ftp  trans-
              fers,  which allows users to ftp through firewall machines which
              use proxy systems. This option may also be specified by  config-
              uring the macro %_ftpproxy.

       --ftpport PORT
              The  TCP  PORT number to use for the ftp connection on the proxy
              ftp server instead of the default port. This option may also  be
              specified by configuring the macro %_ftpport.

       rpm allows the following options to be used with http URLs:

       --httpproxy HOST
              The host HOST will be used as a proxy server for all http trans-
              fers. This option may also be specified by configuring the macro
              %_httpproxy.

       --httpport PORT
              The  TCP PORT number to use for the http connection on the proxy
              http server instead of the default port. This option may also be
              specified by configuring the macro %_httpport.

LEGACY ISSUES
   Executing rpmbuild
       The  build  modes of rpm are now resident in the /usr/bin/rpmbuild exe-
       cutable.  Install the package containing rpmbuild  (usually  rpm-build)
       and see rpmbuild(8) for documentation of all the rpm build modes.

FILES
   rpmrc Configuration
       /usr/lib/rpm/rpmrc
       /usr/lib/rpm/redhat/rpmrc
       /etc/rpmrc
       ~/.rpmrc

   Macro Configuration
       /usr/lib/rpm/macros
       /usr/lib/rpm/redhat/macros
       /etc/rpm/macros
       ~/.rpmmacros

   Database
       /var/lib/rpm/Basenames
       /var/lib/rpm/Conflictname
       /var/lib/rpm/Dirnames
       /var/lib/rpm/Filemd5s
       /var/lib/rpm/Group
       /var/lib/rpm/Installtid
       /var/lib/rpm/Name
       /var/lib/rpm/Packages
       /var/lib/rpm/Providename
       /var/lib/rpm/Provideversion
       /var/lib/rpm/Pubkeys
       /var/lib/rpm/Removed
       /var/lib/rpm/Requirename
       /var/lib/rpm/Requireversion
       /var/lib/rpm/Sha1header
       /var/lib/rpm/Sigmd5
       /var/lib/rpm/Triggername

   Temporary
       /var/tmp/rpm*

SEE ALSO
       popt(3),
       rpm2cpio(8),
       rpmbuild(8),

       rpm  --help  - as rpm supports customizing the options via popt aliases
       it's impossible to  guarantee  that  what's  described  in  the  manual
       matches what's available.


       http://www.rpm.org/

AUTHORS
       Marc Ewing
       Jeff Johnson
       Erik Troan



Red Hat, Inc.                    09 June 2002                           RPM(8)

Man Page of lsusb

NAME
       lsusb - list USB devices

SYNOPSIS
       lsusb [ options ]

DESCRIPTION
       lsusb  is  a  utility for displaying information about USB buses in the
       system and the devices connected to them.


OPTIONS
       -v, --verbose
              Tells lsusb to be verbose and display detailed information about
              the  devices shown.  This includes configuration descriptors for
              the device's current speed.  Class descriptors  will  be  shown,
              when  available,  for  USB  device classes including hub, audio,
              HID, communications, and chipcard.

       -s [[bus]:][devnum]
              Show only devices in specified bus and/or devnum.  Both ID's are
              given in decimal and may be omitted.

       -d [vendor]:[product]
              Show  only  devices  with  the  specified vendor and product ID.
              Both ID's are given in hexadecimal.

       -D device
              Do not scan the /dev/bus/usb  directory,  instead  display  only
              information  about  the  device whose device file is given.  The
              device file should be something like /dev/bus/usb/001/001.  This
              option displays detailed information like the v option; you must
              be root to do this.

       -t     Tells lsusb to dump the physical USB device hierarchy as a tree.
              This overrides the v option.

       -V, --version
              Print   version  information  on standard output, then exit suc-
              cessfully.


RETURN VALUE
       If the specified device is not found, a non-zero exit code is returned.


FILES
       /usr/share/usb.ids
              A  list  of all known USB ID's (vendors, products, classes, sub-
              classes and protocols).


SEE ALSO
       lspci(8), usbview(8).


AUTHOR
       Thomas Sailer, .



usbutils-0.73                   25 January 2005                       lsusb(8)

Man Page of lspci

NAME
       lspci - list all PCI devices

SYNOPSIS
       lspci [options]

DESCRIPTION
       lspci  is  a  utility for displaying information about PCI buses in the
       system and devices connected to them.

       By default, it shows a brief list of devices. Use the options described
       below  to  request  either a more verbose output or output intended for
       parsing by other programs.

       If you are going to report bugs in  PCI  device  drivers  or  in  lspci
       itself,  please  include  output  of "lspci -vvx" or even better "lspci
       -vvxxx" (however, see below for possible caveats).

       Some parts of the output, especially in the highly verbose  modes,  are
       probably  intelligible only to experienced PCI hackers. For exact defi-
       nitions of the fields, please consult either the PCI specifications  or
       the header.h and /usr/include/linux/pci.h include files.

       Access  to  some  parts of the PCI configuration space is restricted to
       root on many operating systems, so the features of lspci  available  to
       normal  users  are limited. However, lspci tries its best to display as
       much as available and mark all other information with 
       text.


OPTIONS
   Basic display modes
       -m     Dump  PCI  device data in a backward-compatible machine readable
              form.  See below for details.

       -mm    Dump PCI device data in a machine readable form for easy parsing
              by scripts.  See below for details.

       -t     Show  a tree-like diagram containing all buses, bridges, devices
              and connections between them.


   Display options
       -v     Be verbose and display detailed information about all devices.

       -vv    Be very verbose and display more details.  This  level  includes
              everything deemed useful.

       -vvv   Be  even  more  verbose  and  display  everything we are able to
              parse, even if it doesn't look interesting at all  (e.g.,  unde-
              fined memory regions).

       -k     Show kernel drivers handling each device and also kernel modules
              capable of handling it.  Turned on by default when -v  is  given
              in  the  normal  mode of output.  (Currently works only on Linux
              with kernel 2.6 or newer.)

       -x     Show hexadecimal dump of the standard part of the  configuration
              space (the first 64 bytes or 128 bytes for CardBus bridges).

       -xxx   Show  hexadecimal  dump of the whole PCI configuration space. It
              is available only to root as several PCI devices crash when  you
              try to read some parts of the config space (this behavior proba-
              bly doesn't violate the PCI standard, but  it's  at  least  very
              stupid).  However,  such  devices are rare, so you needn't worry
              much.

       -xxxx  Show hexadecimal dump of the extended (4096-byte) PCI configura-
              tion space available on PCI-X 2.0 and PCI Express buses.

       -b     Bus-centric  view. Show all IRQ numbers and addresses as seen by
              the cards on the PCI bus instead of as seen by the kernel.

       -D     Always show PCI domain numbers.  By  default,  lspci  suppresses
              them on machines which have only domain 0.


   Options to control resolving ID's to names
       -n     Show  PCI  vendor and device codes as numbers instead of looking
              them up in the PCI ID list.

       -nn    Show PCI vendor and device codes as both numbers and names.

       -q     Use DNS to query the central PCI ID database if a device is  not
              found  in the local pci.ids file. If the DNS query succeeds, the
              result is cached in ~/.pciids-cache and it is recognized in sub-
              sequent  runs  even if -q is not given any more. Please use this
              switch inside automated scripts only with caution to avoid over-
              loading the database servers.

       -qq    Same as -q, but the local cache is reset.

       -Q     Query the central database even for entries which are recognized
              locally.  Use this if you suspect that the  displayed  entry  is
              wrong.


   Options for selection of devices
       -s [[[[]:]]:][][.[]]
              Show  only devices in the specified domain (in case your machine
              has several host bridges, they can either  share  a  common  bus
              number  space  or  each  of them can address a PCI domain of its
              own; domains are numbered from 0 to ffff), bus (0 to  ff),  slot
              (0  to  1f) and function (0 to 7).  Each component of the device
              address can be omitted or set to "*", both meaning "any  value".
              All  numbers  are  hexadecimal.  E.g., "0:" means all devices on
              bus 0, "0" means all functions of device 0  on  any  bus,  "0.3"
              selects  third  function of device 0 on all buses and ".4" shows
              only the fourth function of each device.

       -d []:[]
              Show only devices with specified vendor and device ID. Both ID's
              are  given  in  hexadecimal  and may be omitted or given as "*",
              both meaning "any value".


   Other options
       -i
              Use as the PCI ID list instead of /usr/share/pci.ids.

       -p
              Use as the map of PCI ID's handled by kernel modules.  By
              default,  lspci uses /lib/modules/kernel_version/modules.pcimap.
              Applies only to Linux systems with recent enough module tools.

       -M     Invoke bus mapping mode which performs a thorough  scan  of  all
              PCI  devices, including those behind misconfigured bridges, etc.
              This option gives meaningful results only with a direct hardware
              access  mode,  which  usually  requires root privileges.  Please
              note that the bus mapper only scans PCI domain 0.

       --version
              Shows lspci version. This option should be used stand-alone.


   PCI access options
       The PCI utilities use the PCI library  to  talk  to  PCI  devices  (see
       pcilib(7)  for details). You can use the following options to influence
       its behavior:

       -A
              The library supports a variety of  methods  to  access  the  PCI
              hardware.   By  default,  it uses the first access method avail-
              able, but you can use this option to override this decision. See
              -A  help for a list of available methods and their descriptions.

       -O

=
              The behavior of the  library  is  controlled  by  several  named
              parameters.   This  option allows to set the value of any of the
              parameters. Use -O help for a list of known parameters and their
              default values.

       -H1    Use  direct hardware access via Intel configuration mechanism 1.
              (This is a shorthand for -A intel-conf1.)

       -H2    Use direct hardware access via Intel configuration mechanism  2.
              (This is a shorthand for -A intel-conf2.)

       -F
              Instead of accessing real hardware, read the list of devices and
              values of their configuration registers from the given file pro-
              duced  by  an  earlier run of lspci -x.  This is very useful for
              analysis of user-supplied bug reports, because you  can  display
              the  hardware configuration in any way you want without disturb-
              ing the user with requests for more dumps.

       -G     Increase debug level of the library.


MACHINE READABLE OUTPUT
       If you intend to process the output of lspci automatically, please  use
       one of the machine-readable output formats (-m, -vm, -vmm) described in
       this section. All other formats are likely to change  between  versions
       of lspci.


       All  numbers  are always printed in hexadecimal. If you want to process
       numeric ID's instead of names, please add the -n switch.


   Simple format (-m)
       In the simple format, each device is described on a single line,  which
       is  formatted  as  parameters  suitable  for passing to a shell script,
       i.e., values separated by whitespaces, quoted and escaped if necessary.
       Some  of the arguments are positional: slot, class, vendor name, device
       name, subsystem vendor name and subsystem name (the last two are  empty
       if  the  device  has no subsystem); the remaining arguments are option-
       like:


       -rrev  Revision number.


       -pprogif
              Programming interface.


       The relative order of positional arguments and  options  is  undefined.
       New  options can be added in future versions, but they will always have
       a single argument not separated from the option by any spaces, so  they
       can be easily ignored if not recognized.


   Verbose format (-vmm)
       The  verbose  output is a sequence of records separated by blank lines.
       Each record describes a single device by a sequence of lines, each line
       containing  a single `tag: value' pair. The tag and the value are sepa-
       rated by a single tab character.  Neither the  records  nor  the  lines
       within  a record are in any particular order.  Tags are case-sensitive.


       The following tags are defined:


       Slot   The   name   of   the   slot   where    the    device    resides
              ([domain:]bus:device.function).  This tag is always the first in
              a record.


       Class  Name of the class.


       Vendor Name of the vendor.


       Device Name of the device.


       SVendor
              Name of the subsystem vendor (optional).


       SDevice
              Name of the subsystem (optional).


       PhySlot
              The physical slot where  the  device  resides  (optional,  Linux
              only).


       Rev    Revision number (optional).


       ProgIf Programming interface (optional).


       Driver Kernel  driver  currently  handling  the device (optional, Linux
              only).


       Module Kernel module reporting that  it  is  capable  of  handling  the
              device (optional, Linux only).


       New tags can be added in future versions, so you should silently ignore
       any tags you don't recognize.


   Backward-compatible verbose format (-vm)
       In this mode, lspci tries to be perfectly compatible with its old  ver-
       sions.   It's  almost  the  same as the regular verbose format, but the
       Device tag is used for both the slot and the device name, so it  occurs
       twice  in  a  single  record. Please avoid using this format in any new
       code.


FILES
       /usr/share/pci.ids
              A list of all known PCI ID's (vendors, devices, classes and sub-
              classes).  Maintained at http://pciids.sourceforge.net/, use the
              update-pciids utility to download the most recent version.

       /usr/share/pci.ids.gz
              If lspci is compiled with support for compression, this file  is
              tried before pci.ids.

       ~/.pciids-cache
              All ID's found in the DNS query mode are cached in this file.


BUGS
       Sometimes, lspci is not able to decode the configuration registers com-
       pletely.  This usually happens when not enough documentation was avail-
       able to the authors.  In such cases, it at least prints the mark to
       signal that there is potentially something more to say. If you know the
       details, patches will be of course welcome.

       Access  to the extended configuration space is currently supported only
       by the linux_sysfs back-end.


SEE ALSO
       setpci(8), update-pciids(8), pcilib(7)


AUTHOR
       The PCI Utilities are maintained by Martin Mares .



pciutils-3.1.3                   04 July 2009                         lspci(8)

Man Page of lsmod

NAME
       lsmod - program to show the status of modules in the Linux Kernel

SYNOPSIS
       lsmod

DESCRIPTION
       lsmod  is  a  trivial  program which nicely formats the contents of the
       /proc/modules, showing what kernel modules are currently loaded.

COPYRIGHT
       This manual page Copyright 2002, Rusty Russell, IBM Corporation.

SEE ALSO
       modprobe(8), modinfo(8)



                                  2002-12-27                          LSMOD(8)

Man Page of modprobe

MODPROBE(8)                                                        MODPROBE(8)



NAME
       modprobe - program to add and remove modules from the Linux Kernel

SYNOPSIS
       modprobe [ -v ] [ -V ] [ -C config-file ] [ -n ] [ -i ] [ -q ] [ -b ] [
       -o modulename ] [ modulename ] [ module parameters ... ]


       modprobe [ -r ] [ -v ] [ -n ] [ -i ] [ modulename ... ]


       modprobe [ -l ] [ -t dirname ] [ wildcard ]


       modprobe [ -c ]


       modprobe [ --dump-modversions ] [ filename ... ]


DESCRIPTION
       modprobe intelligently adds or removes a module from the Linux  kernel:
       note  that  for  convenience, there is no difference between _ and - in
       module  names.   modprobe  looks  in  the  module  directory  /lib/mod-
       ules/`uname  -r`  for  all  the modules and other files, except for the
       optional  /etc/modprobe.conf  configuration  file  and  /etc/modprobe.d
       directory (see modprobe.conf(5)). modprobe will also use module options
       specified on the kernel command line in the form of  ..

       Note  that  this version of modprobe does not do anything to the module
       itself: the work of resolving symbols and understanding  parameters  is
       done  inside the kernel.  So module failure is sometimes accompanied by
       a kernel message: see dmesg(8).

       modprobe expects an up-to-date modules.dep file, as generated by depmod
       (see  depmod(8)).  This file lists what other modules each module needs
       (if any), and modprobe uses this to add or  remove  these  dependencies
       automatically.  See modules.dep(5)).

       If any arguments are given after the modulename, they are passed to the
       kernel (in addition to any options listed in the configuration file).

OPTIONS
       -v --verbose
              Print messages about what the program is  doing.   Usually  mod-
              probe only prints messages if something goes wrong.

              This  option  is  passed  through  install or remove commands to
              other modprobe  commands  in  the  MODPROBE_OPTIONS  environment
              variable.

       -C --config
              This  option  overrides the default configuration directory/file
              (/etc/modprobe.d or /etc/modprobe.conf).

              This option is passed through  install  or  remove  commands  to
              other  modprobe  commands  in  the  MODPROBE_OPTIONS environment
              variable.

       -c --showconfig
              Dump out the effective configuration from the  config  directory
              and exit.

       -n --dry-run --show
              This  option  does  everything but actually insert or delete the
              modules (or run the install or remove commands).  Combined  with
              -v, it is useful for debugging problems.

       -i --ignore-install --ignore-remove
              This  option  causes  modprobe to ignore install and remove com-
              mands in the configuration file (if any) for the  module  speci-
              fied  on  the command line (any dependent modules are still sub-
              ject to commands set for them in the configuration  file).   See
              modprobe.conf(5).

       -q --quiet
              Normally  modprobe  will report an error if you try to remove or
              insert  a  module  it  can't  find  (and  isn't  an   alias   or
              install/remove  command).   With this flag, modprobe will simply
              ignore any bogus names (the kernel uses  this  to  opportunisti-
              cally probe for modules which might exist).

       -r --remove
              This  option causes modprobe to remove rather than insert a mod-
              ule.  If the modules it depends on  are  also  unused,  modprobe
              will  try  to  remove them too.  Unlike insertion, more than one
              module can be specified on the command line (it  does  not  make
              sense to specify module parameters when removing modules).

              There  is  usually  no  reason to remove modules, but some buggy
              modules require it.  Your kernel may not support removal of mod-
              ules.

       -V --version
              Show version of program and exit.

       -f --force
              Try  to  strip  any versioning information from the module which
              might otherwise stop it from loading: this is the same as  using
              both  --force-vermagic and --force-modversion.  Naturally, these
              checks are there for your protection, so using  this  option  is
              dangerous.

              This applies to any modules inserted: both the module (or alias)
              on the command line and any modules it on which it depends.

       --force-vermagic
              Every module contains a small string containing important infor-
              mation,  such  as the kernel and compiler versions.  If a module
              fails to load and the kernel complains that the "version  magic"
              doesn't match, you can use this option to remove it.  Naturally,
              this check is there for your protection, so this using option is
              dangerous.

              This applies to any modules inserted: both the module (or alias)
              on the command line and any modules on which it depends.

       --force-modversion
              When modules are compiled with CONFIG_MODVERSIONS set, a section
              detailing  the versions of every interfaced used by (or supplied
              by) the module is created.  If a module fails to  load  and  the
              kernel  complains  that  the module disagrees about a version of
              some interface, you can use "--force-modversion" to  remove  the
              version  information altogether.  Naturally, this check is there
              for your protection, so using this option is dangerous.

              This applies any modules inserted: both the module (or alias) on
              the command line and any modules on which it depends.

       -l --list
              List all modules matching the given wildcard (or "*" if no wild-
              card is given).  This option is provided for backwards  compati-
              bility: see find(1) and basename(1) for a more flexible alterna-
              tive.

       -a --all
              Insert all module names on the command line.

       -t --type
              Restrict -l to  modules  in  directories  matching  the  dirname
              given.  This option is provided for backwards compatibility: see
              find(1) and basename(1) for a more flexible alternative.

       -s --syslog
              This option causes any error messages to go through  the  syslog
              mechanism  (as  LOG_DAEMON with level LOG_NOTICE) rather than to
              standard error.  This is also automatically enabled when  stderr
              is unavailable.

              This  option  is  passed  through  install or remove commands to
              other modprobe  commands  in  the  MODPROBE_OPTIONS  environment
              variable.

       -S --set-version
              Set  the kernel version, rather than using uname(2) to decide on
              the kernel version (which dictates where to find the modules).

       --show-depends
              List the dependencies of a module (or alias), including the mod-
              ule  itself.   This  produces  a  (possibly empty) set of module
              filenames, one per line, each starting with  "insmod".   Install
              commands  which  apply are shown prefixed by "install".  It does
              not run any of the install commands.  Note that  modinfo(8)  can
              be  used  to  extract  dependencies  of a module from the module
              itself, but knows nothing of aliases or install commands.

       -o --name
              This option tries to rename the module which is  being  inserted
              into  the kernel.  Some testing modules can usefully be inserted
              multiple times, but the kernel refuses to have  two  modules  of
              the  same  name.   Normally, modules should not require multiple
              insertions, as that would make them useless  if  there  were  no
              module support.

       --first-time
              Normally,  modprobe  will  succeed  (and  do nothing) if told to
              insert a module which is already present or to remove  a  module
              which isn't present.  This is ideal for simple scripts; however,
              more complicated scripts often want  to  know  whether  modprobe
              really  did  something: this option makes modprobe fail for that
              case.

       --dump-modversions
              Print out a list of module versioning information required by  a
              module.  This  option is commonly used by distributions in order
              to package up a Linux  kernel  module  using  module  versioning
              deps.

       -b --use-blacklist
              This  option  causes modprobe to apply the blacklist commands in
              the configuration files (if any) to module names as well.  It is
              usually used by udev(7).

       -d --dirname
              Directory  where  modules  can be found, /lib/modules/RELEASE by
              default.

       --allow-unsupported-modules
              Load unsupported modules even if disabled in configuration.

RETURN VALUE
       modprobe returns 0 on success, 1 on an unspecified error and 2  if  the
       module  is not supported. Use the --allow-unsupported-modules option to
       force using an unsupported module.

ENVIRONMENT
       The MODPROBE_OPTIONS environment variable can  also  be  used  to  pass
       arguments to modprobe.

COPYRIGHT
       This manual page Copyright 2002, Rusty Russell, IBM Corporation.

SEE ALSO
       modprobe.conf(5), lsmod(8), modinfo(8)



                               15 September 2009                   MODPROBE(8)

Friday, June 25, 2010

Windows Internet Share through WIFI ad hoc


  • Open the Network and Sharing Center from windows control panel

  • Make sure the "Network discovery" is on on the active Internet connection and click "Manage wireless network" on the top left of the window.

  • Click "Add" button in the "Manage Wireless Network" window and then select "Create an ad hoc network" in the popped window

  • Press "Next" button and input the network name and at least 8 characters for password in then next pop up window, then press "Next".After waiting windows create the ad hoc press "Close" button to finish the ad hoc network creatation

  • Go back to "Network Connection" window either by click "Manage Network Connection" on the top left of "Network and Sharing Center" or execute ncpa.cpl in the DOS command line.

  • Right click the active Internet connection and go to "sharing" tab

  • Tick "Allow other network users to connect through this computer's Internet connection" and "Establish a dial-up connection whenever a computer on my network attempts to access the Internet".

  • Select the network connection which you want to share Internet through in the "Select a private network connection" drop down menu. In this case select "Wireless Network Connection". Finally press "ok" button. 

  • Now connect other devices to this ad hoc and use DHCP for IP and DNS address to connect to Internet  
  • Monday, June 21, 2010

    Linux File Commond

    • Display the absolutly path of the current directory
      pwd
    • Display the contained files and sub directories in the current directory
      ls [option] [filenamePattern]
      Most used options include -a for displaying all files, -l for displaying all the informations for each file,
    • Create one/more files
      touch file name or file name pattern
      eg: touch {report,draft}_{AUG,SEP,NOV}{1,2,3}
    • Create directory
      mkdir
    • Remove directory
      rmdir
    • Copy files
      cp
    • Move files
      mv
    • Link files
      ln -s originalFile linkFile
      ln originalFile linkFile
    • Display information, display all the matches of the wildcard pattern, that usefull to avoid operation on wrong files when use echo before use wildcard pattern delete or move files.
      echo [wildcard pattern]
    • Change the file permissions
      chmod permission fileName
      Owner                     Group                    Others
      execute write read    execute write read   execute write read
               1      2     4             1      2     4            1      2     4
    • Change the file owner
      chown username filename
    • Change the file owner group
      chown username:groupName fileName
    • Search files
    • wildcard * ? ~
    • Display file content
      • cat filename display the contents of the file
      • less fileName1 [fileName 2 …fileName n] view one or more files at the same time :n(to view next page) :p(to view previous page) to navigate from pages and automaticaly paginates the file.
      • head -number fileName  view the fist number of lines in the file
      • tail -number fileName  view the last number of lines in the file

    Linux User Mangement Command

    • Display current user information
      • w display who is logged on and what they are doing.
      • whoami display the current user’s username
      • groups display the current user’s group
      • id display the uid,gid and groups of the current user
    • Create a user
      useradd username
    • Switch between users
      su username  Note: su - change user to root user and current directory to root’s home directory. su root   change user to root user without changing current directory.

    Search files in Linux

    There are couples of tools used to find things in Linux.
    • find [where] [search patterns][actions]
      search patterns include:
      • -name fileNamePattern  match is case sensitive
      • -iname fileNamePattern  match is case insensitive
      • -size [+,-]size (b,c,w,k,M,G) + means great than -means less than
      • -user  username  username is the owner of the files
      • -mmin n  searching files which be modified n mins ago
      • -amin n  searching files which be accessed n mins ago
      • -and/-or/!  are the boolean operator which connect two or more patterns
      actions include:
      • -delete
      • exec command
      examples:
      • $ find / -name ‘*.c’ 2>/dev/null
        find any .c files under the root directory and discard the error message. 2 indicates the error stream in Linux, and /dev/null is the device where anything you send simply disappears. So 2>/dev/null in this case means that while finding for the files, in case any error messages pop up simply send them to /dev/null i.e. simply discard all error messages.
      • $ find /etc -name ‘*.conf’ -exec ls -l {} \;
        find any .conf files under /etc directory and execute ls -l on the search result. {} indicate the search result \ indicate the end of the command.

    Linux LVM Snapshot

    LVM Snapshot use smaller logic volume to represent the whole data on the large logic volume and only save the data writing to the original LV when the snapshot LV is mounted. The snapshot LV will be automatically unmount when it is full. Thus the size of the snapshot LV must be larger than the possible data may changed during the time of the snapshot LV mount on the system.It is usfull when execute some script on the live system. For exmple back a database drive when the database still running.

    To create a snapshot LV use following command:
    # lvcreate -L10G -s -n snapshotName /dev/volgroupName/LVname

    To mount a snapshot LV use following command:
    # mkdir /mnt/locationName/snapshotLVName
    # mount /dev/volgroupName/snapshotLVName /mnt/locationName/snapshotLVName
    To backup a LV
    tar -pczf /backups/root.tar.gz /mnt/locationName/snapshotLVName
    
    To remove a snapshot LV use following command:
    # umount /mnt/locationName/LVName
    # lvremove /dev/ops/dbbackup 

    Backup with tar

    tar [operation] [option] target source
    There are three commonly used operations `—create’, `—list’, and `—extract’ or ‘-c’, ‘-t’ and ‘-x’
    And there are six commonly used options ‘-C’, ‘-f’, ‘-j’, ‘-p’, ‘-v’ and ‘-z’.
    • ‘-C’, change to directory 
    • ‘-f’, use archive file or device F (default “-“, meaning stdin/stdout)
    • ‘-j’, filter archive through bzip2, use to decompress *.bz2 files
    • ‘-p’, extract all protection information
    • ‘-v’, verbosely list files processed
    • ‘-z’, filter the archive through gzip
    Examples:
    • Verbosely create a tar archive name.tar from sourceFiles or sourceDirectory
      tar -cvf name.tar sourceFiles
      tar -cvf sourceDirectory/
    • Verbosely create a tar file name.tar.gz from souceFiles and compress it use gzip
      tar -czf name.tar.gz sourceFiles
    • Extract name.tar.gz from name.tar.gz
      tar -xzf name.tar.gz
    • Extract one file test.txt from name.tar.gz
      tar -xzf name.tar.gz test.txt
    • List archive members from name.tar
      tar -tvf name.tar

    Customize Linux Bash Envirenment

    Configure .bashrc to customize user’s bash environment.
    .bashrc file is locate in the user’s home directory. It contain lots of configurable items which can customize how the bash looks like and how user interactive with bash.
    • Aliases could be configured under ‘#User specific aliases and functions’ in the .bashrc file. After add aliases item in the .bashrc file, user need log-off and log-in the system or restart bash by execute ‘bash’ command in the terminal to active the newly added aliases.
      Aliases example: alias cls=’clear’
    • Bash Prompt could be configured under ‘# Source global definitions’ in the .bashrc file. Environment variable $PS1 which could be change by PS1=’optionsPlusAnything’ is represent the bash prompt. The available options are as following
      • \a an ASCII bell character (07)
      • \d the date in “Weekday Month Date” format
      • (e.g., “Tue May 26”)
      • \e an ASCII escape character (033)
      • \h the hostname up to the first `.’
      • \H the hostname
      • \n newline
      • \r carriage return
      • \s the name of the shell, the basename of $0
      • (the portion following the final slash)
      • \t the current time in 24-hour HH:MM:SS format
      • \T the current time in 12-hour HH:MM:SS format
      • \@ the current time in 12-hour am/pm format
      • \u the username of the current user
      • \v the version of bash (e.g., 2.00)
      • \V the release of bash, version + patchlevel
      • (e.g., 2.00.0)
      • \w the current working directory
      • \W the basename of the current working direc-
      • tory
      • \! the history number of this command
      • \# the command number of this command
      • \$ if the effective UID is 0, a #, otherwise a
      • $
      • \nnn the character corresponding to the octal
      • number nnn
      • \ a backslash
      • \[ begin a sequence of non-printing characters,
      • which could be used to embed a terminal con-
      • trol sequence into the prompt
      • \] end a sequence of non-printing characters
    • Configure bash shell options with set/shopt
      set -o check the current bash shell option setting
      set -o bashOption to enable the bashOption
      set +o bashOptioon to disable the bashOption

    F-port Anti Virus for Linux

    • Download F-port for Linux workstation from http://www.f-prot.com/products/home_use/linux/ 
    • Extract the downloaded file to the user’s home folder use tar -xvf filename 
    • Enter the extracted folder execute ./install-f-prot.pl then type yes if system ask ln -fs /home/username/f-port/fpscan /usr/sbin/fpscan 
    • Preform a scan by execute fpscan /filepath/to/scan

    Monday, June 07, 2010

    Restore Ubuntu gnome panel

    In the terminal execute following command to restore gnome panel to default setting.
    $ gconftool-2 --shutdown
    $ rm -rf .gconf/apps/panel
    $ pkill gnome-panel

    Friday, June 04, 2010

    Linux Permission and Owernship

    File Permission
    chmod permissionNumber fileName
    Owner Group Other Users
    ExecuteWriteRead ExecuteWriteRead ExecuteWriteRead
    124124124


    File Ownership
    chown userName fileName
    chown userName.groupName fileName

    Monday, May 24, 2010

    Uninstall VMWare Player3.0 on Fedora 12

    [root@MyPC resources]# vmware-uninstall
    You have gotten this message because you are either downgrading VMware
    Workstation, Player, or VIX, or because you attempted to run either
    vmware-uninstall or vmware-uninstall-vix.

    If you are downgrading, please uninstall all newer versions first, then
    install again.

    The vmware-uninstall* scripts have been deprecated. Instead, please use
    the vmware-installer.

    Long form:
    vmware-installer --uninstall-product PRODUCT
    Short form:
    vmware-installer -u PRODUCT

    Where PRODUCT is one of vmware-workstation, vmware-player, or vmware-vix.

    For a list of which products are installed, you may run:
    vmware-installer --list-products
    or:
    vmware-installer -l


    [root@MyPC resources]# vmware-installer -l
    Product Name Product Version
    ====================== ====================
    vmware-player 3.0.1.227600
    [root@MyPC resources]# vmware-installer --uninstall-product vmware-player

    Wednesday, May 19, 2010

    Linux LVM Snapshot

    LVM Snapshot use smaller logic volume to represent the whole data on the large logic volume and only save the data writing to the original LV when the snapshot LV is mounted. The snapshot LV will be automatically unmount when it is full. Thus the size of the snapshot LV must be larger than the possible data may changed during the time of the snapshot LV mount on the system.It is usfull when execute some script on the live system. For exmple back a database drive when the database still running.

    To create a snapshot LV use following command:
    # lvcreate -L10G -s -n snapshotName /dev/volgroupName/LVname

    To mount a snapshot LV use following command:
    # mkdir /mnt/locationName/snapshotLVName
    # mount /dev/volgroupName/snapshotLVName /mnt/locationName/snapshotLVName
    To backup a LV
    tar -pczf /backups/root.tar.gz /mnt/locationName/snapshotLVName


    To remove a snapshot LV use following command:

    # umount
    /mnt/locationName/LVName
    # lvremove /dev/ops/dbbackup

    Monday, May 10, 2010

    Install Mac4Lin on Ubuntu 10.1

    • Download Mac4Lin from http://sourceforge.net/projects/mac4lin/
    • unzip it to a temp folder
    • Make sure you have ~/.themes and ~/.icons if you not install Mac4Lin on Ubuntu 10.1
    • Install Emerald Theme Manager
    • Install Tracker
    • execute Mac4Lin_Install_v1.0.sh
    • Type 'y' and enter when system popup "Do you want to enable Metacity Compositor?"
    • Type 'y' and enter when system popup "The following componenets require root access. You can opt out of installing them as they can be manually installed as well. Would you like to install these components?"
    • Install Avant Window Navigator