VMS -> Unix
common vms commands unix lookalike furthermore ...
------------------- -------------- -------------------------
dir/date/siz/own ls -al owner,group,others
/date=mod ls -alc -rwxrwxrwx
dir/date/siz *.dir ls -Fal | grep -v '\->' | grep /
logout exit
monitor sar
search grep
set password passwd
set process/priority nice
show cpu uname -p[amnrsv]
show default pwd
show device du*... admpdisk -o list ["administer physical disks"]
/files fuser -u fname
show logicals? env
show users who [-u] | grep username
ps -fuxxx [where xxx = user name, eg: ps -fugah]
finger username
show process ps -f
/id=pid ps
/priority ps -l
show system ps -ef
- system uptime last reboot ['uptime', 'w']
who -r
ps -p 1
show terminal echo $TERM
stop/id=pid kill -9 pid [-9 ain't in man pages, => 'fer sure']
-----------------------------------------------------------------------------
ls display: (use chmod, chown, chgrp to modifiy)
% ls -al
file size in blocks
| protection (owner, group, others)
| |
| | links
| | | owner file size in # bytes
| | | | | date modified
| | | | group | |
| | | | | | | file name
| | | | | | | |
80 -rw-r--r-- 1 gah root 35818 Feb 12 14:29 pst_dly.c
-----------------------------------------------------------------------------
setting aliases:
When you login, .profile is "executed"
on-the-fly: source .profile
-----------------------------------------------------------------------------
# example bash stuff - keep in home dir as ".profile" (gets exec'd at login or
# "source .profile"
#
umask 022
TERM=vt320; export TERM
#
# keep current working dir at front of path?
PATH=.:$HOME/bin:$ORACLE_HOME/bin:${PATH:-/usr/bin:.}:/usr/local/bin
export PATH
#
# Oracle stuff
ORACLE_TERM=vt320; export ORACLE_TERM
BANNER_ROOT=/sct; export BANNER_ROOT
# Set Oracle database
# run script to tweak/set various Oracle junk, like ORACLE_SID
# notes - keep this after path is set; without ORACLE_SID being set before the
# call to this, it will default to equal user name (eg, ghuckabone)
# - this differs from saturn
ORACLE_SID=TEST; export ORACLE_SID
. /usr/local/bin/oraenv
#
# various shell variables
export MYID=`id -un`
export HOSTNAME=`hostname`
#
# PS1 determines prompt (in bash)
# generic ITC setting:
# PS1="`hostname -s`-$USER> "
# displays too much for one line
# export PS1='[$HOSTNAME:$MYID] $PWD\$ '
# changes prompt to current working directory
export PS1='$PWD> '
#
# aliases; sure would be nice to combine csh aliases somehow
alias display='setenv DISPLAY \!*\:0.0;echo DISPLAY now $DISPLAY'
alias l='ls -al'
alias lo=exit
alias ldir="ls -Fal | grep -v '\->' | grep /"
alias sd="cd $1"
alias ty=more
-----------------------------------------------------------------------------
typical compression file combination: something.tar.gz
- to uncompress a .gz file; eg:
% gunzip libg++-2.7.2.tar.gz
- to 'untar' some file
% tar vxf libg++-2.7.2.tar
- view obj files
nm ( print name list of common object file); eg:
% nm -o /usr/local/lib/libiberty.a
ar (ARchive files: object, ...); eg:
% ar -tv /usr/local/lib/libiberty.a
'source' forces execution of a shell script, eg:
% source .exrc
Oracle stuff
------------
Execute an sql script from unix command line:
% sqlplus [-s] [username] / [password] @filename [> output-filename] [&]
Display current Oracle SID (database name):
% echo $ORACLE_SID
- or -
sql> host echo $ORACLE_SID
sqlplus on pc:
to connect to diff dbase - user/pwd@dbase-alias
eg: gm_inv/dev7@g-dev7
Unix Manuals - nice link
VI information
Suggestion: Don't use it