Hp Ux Cheat Sheet

  



UNIX cheat sheet

Find/Zip/Move/Delete files older than x days
find ./ -name “*.ARC” -mtime +1 -exec ls -l {} ;
find ./ -name “*.ARC” -mtime +1 -exec ls -l {} ;

find ./ -name “*.ARC” -mtime +1 -exec rm {} ;
find ./ -name “*.ARC” -mtime +1 -exec rm {} ;

find ./ -name “*.ARC” -mtime +1 -exec gzip {} ;
find ./ -name “*.ARC” -mtime +1 -exec gzip {} ;

Sheet

find ./ -name “*.arch” -mtime +1 -exec mv {} /u01/andy/;
find ./ -name “*.arch” -mtime +1 -exec mv {} /u01/andy/;

HP-UX Cheat Sheet Kernel Kernel parms and Hardware. /usr/sbin/sysdef or ioscan –fn Major numbers (devices) lsdev Unix device messages dmesg Configuration files /etc/rc.config.d Unix. HP-UX Cheat Sheet This is a document that can be used for revision purposes for HP-UX. Geting a servers Serial number from HP-UX 11.11 and up6 HP-UX - Security Patch Check Configuring Bastille to Operate with Ignite-UX Ignite Recovery (C.6.2.241) Document Create a Bootable Archive Tape via the Network Common Problems with NFS How To create the GNUPlot depot How to mirror the root disk - Itanium Resize /stand online syncsort keys.

Delete the 500 oldest files
rm -f `ls -tr|head -500`
rm -f `ls -tr|head -500`

Find and grep
find ./ -grep {} ; -print 2>/dev/null
find ./ -grep {} ; -print 2>/dev/null

Or…

find ./ -exec grep -l “string” {} ;
find ./ -exec grep -l “string” {} ;

list all files opened by a process
lsof -p
lsof -p Disneyland adventures pc torrent.

ls -l sorted by size
ls -l |sort -k 5
ls -l |sort -k 5

du -sk *|sort -n
du -sk *|sort -n

cpio unzip syntax
cpio -idmv <
cpio -idmv <

man commands
man -k -displays the chapters containing the specified
man -shows the page
man -k -displays the chapters containing the specified
man -shows the page

pipes
mknod p
mknod p

Turn off auto indent and bracket matching in vi
:set noai nosm
:set noai nosm

Capture a control charater
ctl-v then press the control key (eg. backspace)

Configure ksh environment
To display the current settings

set -o
set -o

To set HP/UX stylee…

set -o vi
set -o vi-esccomplete
set -o vi
set -o vi-esccomplete

Show routing tables
netstat -r
netstat -r

Check all logs for ORA- errors
grep ^ORA- *log |cut -f2 -d”-“|cut -f1 -d:|awk ‘{print “ORA-” $1}’|sort -u

ssh: Ooga = OpenSSH, Booga = OpenSSH
First, generate a public/private DSA key pair on Ooga.
ooga% ssh-keygen -t dsa
When you are asked for a passphrase, leave it empty. Now send the public key to Booga.
ooga% cd .ssh Cheat
Hp ux cheat sheet ooga% scp id_dsa.pub user@booga:~/.ssh
CheatNext, log in to Booga and add the public key to the list of authorized keys.
ooga% ssh user@booga
booga% cd .ssh booga% cat id_dsa.pub >> authorized_keys2
booga% chmod 640 authorized_keys2
booga% rm -f id_dsa.pub
Note that the filename is authorized_keys2, not authorized_keys. That's it; you're ready to ssh from Ooga to Booga without having to enter a password.
ssh2: Ooga = OpenSSH, Booga = SSH2

First, generate a public/private DSA key pair on Ooga.
ooga% ssh-keygen -t dsa
When you are asked for a passphrase, leave it empty. This key is stored in a format that OpenSSH can use, but SSH2 cannot. You need to export the key to a format that SSH2 understands.
ooga% ssh-keygen -e -f .ssh/id_dsa.pub > id_dsa_ssh2_ooga.pub
Note: the exact flags you need to specify may differ in your case. Check the man pages if the line above doesn't work. Now send the exported public key to Booga.
ooga% scp id_dsa_ssh2_ooga.pub user@booga:~/.ssh2/
Note: the target directory is .ssh2, not .ssh. Next, log in to Booga and add the public key to the list of authorized keys.

Hp Ux Commands Cheat Sheet


ooga% ssh user@booga
booga% cd .ssh2
booga% cat >> authorization
Key id_dsa_ssh2_ooga.pub

Hp Ux Glance Cheat Sheet


booga% chmod 640 authorization
ssh2: Ooga = SSH2 , Booga = SSH2
First, generate a public/private DSA key pair on Ooga.
ooga% ssh-keygen -t dsa
When you are asked for a passphrase, leave it empty.
ooga% cat > .ssh2/identification
IdKey id_dsa_2048_a

Note: the exact flags you need to specify may differ in your case. Check the man pages if the line above doesn't work. Now send the exported public key to Booga.
ooga% scp id_dsa_ssh2_ooga.pub user@booga:~/.ssh2/
Note: the target directory is .ssh2, not .ssh. Next, log in to Booga and add the public key to the list of authorized keys.
ooga% ssh user@booga
booga% cd .ssh2
booga% cat >> authorization
Key id_dsa_ssh2_ooga.pub

booga% chmod 640 authorization
ssh2: Ooga = SSH2, Booga = OpenSSH
First, generate a public/private DSA key pair on Ooga.
ooga% ssh-keygen -t dsa
When you are asked for a passphrase, leave it empty. This key is stored in a format that SSH2 can use, but OpenSSH cannot. You need to export the key to a format that SSH2 understands.
ooga% cat > .ssh2/identification
IdKey id_dsa_2048_a

ooga% scp id_dsa_ssh2_ooga.pub user@booga:~/.ssh/
booga% ssh-keygen -i -f .ssh/id_dsa.pub > id_dsa_ssh_ooga.pub
booga% cat id_dsa.pub >> authorized_keys2
booga% chmod 640 authorized_keys2
booga% rm -f id_dsa.pub
If the target id is root then in /etc/ssh/sshd_config files rootlogin should be yes else it will not work.