Feeds:
Posts
Comments

Posts Tagged ‘hpux’

*nix command collection.

Useful *nix commands collections.

Read Full Post »

Example find command usage

The Unix/Linux find searches the directory tree rooted at each give file name by evaluating the given expression from left to right, according to the rules of precedence, until the output is known, at which point find moves to the next file name. The following is some example usage of find command:

  • find /home -user kevin
    • Find every file under the directory /home owned by kevin
  • find /home -name *kevin
    • find every file under the directory /home ending in kevin
  • find /home -mtime +60
    • find every file under the directory /home that was modified more than 60 days ago
  • find /home -name core -type f -print | xargs /bin/rm -f
    • find file named core in or below the directory /home and delete them. Note that this will not work if there are any file names containing newline, single or double quotes, or spaces
  • find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f
    • Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing single or double quotes, spaces or newlines are correctly handled. The -name test comes before the -type test in order to avoid having to call stat(2) on every file.
  • find . -type f -exec file ‘{}’ \;
    • Runs `file’ on every file in or below the current directory. Notice that the braces are enclosed in single quote marks to protect them from interpretation as shell script punctuation. The semicolon is similarly protected by the use of a backslash, though ‘;’ could have been used in that case also.

Read Full Post »

These files, which contains user and accounting information for such commands as last, who, write and login.

  • File utmp contains a record of all users logged onto the system.
  • File wtmp contains a record of all logins and logouts.
  • File btmp contains bad login entries for each invalid logon attempts.

Note that, wtmp and btmp tend to grow without bound, and should be checked regularly. Information that is no longer useful should be deleted periodically to prevent it from being too large. Also note that wtmp and btmp are not created by the program that maintain them. Thus, if these files are removed, record-keeping is turned off.

————————————————————————————————————–

Read Full Post »

HPUX SD command accumulations

Software Distributor Commands collection

swlist -d @ /tmp/depot_location :::::: Verify if depot exists in depot location

swverify Prod :::::: Verify if Prod correctly installed

swlist -a state -l fileset Prod :::::: Verify if Prod correctly configured

swremove -d \* @ /tmp/MyDepot :::::: Remove MyDepot from the system

swcopy-s /source_depot product @ /tmp/location :::::: Copy product into /tmp/location

swpackage -d /target_depot -x target_type=tape -s /source_depot product :::::: re-package the product from the source_depot into target_depot

swpackage -s /depot/psf_file/ -d /tmp/my.depot :::::: Create an unregistered depot

Read Full Post »