UNIX Commands

6
-sCommand Description Appstat tells you the current level of tuxedo and the tuxedo daemons running on that server followed by the processes running on all the servers Bdf displays file sizes and space usage Useful to check to make sure we haven't filled up disk space or when we are tracing processes so that our log files have space to grow. acd <path> change directory checkStart all does a check of all processes running under tuxedo on all servers Used by dashboard every 10 minutes to tell us the status of the running processes. chexstate -a [add/delete/restart] -p <daemonname> starts/stops/restarts a daemon chmod 777 <filename> changes file privileges in this case (777), gives all access File privileges are displayed as follows when doing a ls –ltr (see below): drwxrwxrwx : d means it is a directory (it appears as a dash (-) if it’s a file), the first rwx is read, write, execute for the owner of the file, the second rwx is for the group, the third is for the user. If 1 of the 3 (owner, group, user) doesn’t have one of the privileges (r ead, w rite, ex ecute), that character will appear as a dash (-) (eg. -rwxrw---x). The 3-digit number that sets the privileges works as follows: each digit represents one of the 3 groups (owner, group, user in that order) and is the decimal representation of a 3-digit binary number. Each digit of the binary number represents whether or not each privilege is granted (r is the first digit, w is second digit, x is the third). Therefore, a 7 grants all access because 7 = 111 in binary, which sets all 3 privileges (rwx). A 5 grants read and execute privileges because 5 = 101 in binary,

Transcript of UNIX Commands

-sCommand DescriptionAppstat tells you the current level of tuxedo and the tuxedo daemons running on

that server followed by the processes running on all the serversBdf displays file sizes and space usage

Useful to check to make sure we haven't filled up disk space or when we are tracing processes so that our log files have space to grow.

acd <path> change directorycheckStart all does a check of all processes running under tuxedo on all servers

Used by dashboard every 10 minutes to tell us the status of the running processes.

chexstate -a [add/delete/restart] -p <daemonname>

starts/stops/restarts a daemon

chmod 777 <filename> changes file privileges in this case (777), gives all access File privileges are displayed as follows when doing a ls –ltr (see below): drwxrwxrwx : d means it is a directory (it appears as a dash (-) if it’s a file), the first rwx is read, write, execute for the owner of the file, the second rwx is for the group, the third is for the user. If 1 of the 3 (owner, group, user) doesn’t have one of the privileges (read, write, execute), that character will appear as a dash (-) (eg. -rwxrw---x).

The 3-digit number that sets the privileges works as follows: each digit represents one of the 3 groups (owner, group, user in that order) and is the decimal representation of a 3-digit binary number. Each digit of the binary number represents whether or not each privilege is granted (r is the first digit, w is second digit, x is the third). Therefore, a 7 grants all access because 7 = 111 in binary, which sets all 3 privileges (rwx). A 5 grants read and execute privileges because 5 = 101 in binary, which sets the privileges to r-x.

compress <filename> compresses the file filename the extenstion .Z will be added to the filename

crontab –e opens the file containing the schedules for jobs that scheduled to run at certain times for editing

crontab –l opens the file containing the schedules for jobs that scheduled to run at certain times

Demoncnfg used to browse the daemon config fileDemonstat list of daemons runningdu -ks * disk usageExit closes the connectionfind . -exec grep -l "<searchstring>" {} \;

searches through the files in the directory you are in and it’s subdirectories for the searchstring and returns a list of the files in which the search string was founds

find ./ -name <filename> searches for a file by filename starting at the root directoryGlance displays status of processesgrep -i <searchstring> searchs for the searchstring, the -i part makes the search not case-

sensitivegzip -c <filename> <filename.gz> compresses the file filename and renames it filename.gz. gzip will

provide better compression than the compress command. Usually we will do the following command after gzipping a file: > <filename> to

empty out the file we have gzipped and renamed.Ipcloop gives you status of usage on the server of communicating processes (ipc

= inter-process communication)logCat -t <#> -s /<searchstring>/ -a "<datetime>" -z "<datetime>"

searches through log files

-t = show that last # of errors -s = for a certain string the search string must be between /’s-a = start datetime-z = end datetime

Ls displays a list of files and sub-directoriesls –ltr displays a list of files and sub-directories with more information (eg. file

privileges)ls -ltr |grep Jan | awk ' {print "rm " $9} '

this is an example of a command we run to remove log files on the TWI servers from time to time.

man <command> manual: gives you details on the usage of any commandmkdir <dirname> creates a directory (unix is case-sensitive and does NOT allow spaces)netstat –an gives you a list of everyone connected to the server you are onparse deconfig not exactly sure what this does but you’re suppose to run this on all

machines after the boot & everything is upps -ef |grep -i <filename> process search: displays a list of processes running for all users

|grep -i <searchstring> grep searchs for the searchstring, the -i part makes the search not case-sensitive

ps -fu <username> process search: displays a list of processes running for a specific userps -fu <username> |wc -l # of processes running under the asset (user) username (dm, gw, fa)Qmadmin queue admin tool (we mostly use this for gw)

see table below for commands available in this toolrcp -p <filename> <asset>@<server>:</path/filename>

remote copy: used to copy a file to a different server

remsh <servername> “<command>” remote shell: allows you to execute a command on a different machine without having to log in to that machine

rlogin <machinename> allows you to go from one machine to another without retyping the password

Set lists all the config files (you can pipe grep to set to search for a specific file)

set -o vi sets the unix command line to be able to recognize commands used in vi (eg. esc+j and esc+k to browse previous commands used)

showTasks [-v] <workitemid> displays a list of task already done for a workitemid

-v = if included, sorts by timesu - <username> switch user: changes the user on the same serverswinstall tool used by IBM to install the new packagetail -f <filename> allows you to see changes in the file filename as they are happeningTar another way to compress filestmadmin tuxedo admin tool used if a tux server is down

see table below for commands available in this tooltmboot -s <processname > -l <lmid> -i <srvid>

starts a process

-s = service

-l = local machine id (DM_LMID1, DM_LMID2...)-i = server id

tmloadcf compiles the ubbconfig file run before boottmshutdown -s <processname > -l <lmid> -i <srvid>

stops a process

see tmboot for argumentsTop displays status of cpus: the load & user taking the most resourcesTracestat trace status: display status of process tracing (which processes are & are

not being traced)

*lucent developed tooltracestop -n <processname> trace stop: stops the trace on the process processname

*lucent developed toolTracestrt trace start: follow on screen steps to start a trace

*lucent developed toolTracestrt -c n -l 5 -n <processname> trace start: shortcut to force the process processname to start a trace with

trace level 5

*lucent developed toolview <filename> view the file filename

Like vi, but you can't edit the file. To get out use the command: :q!

qmadmin CommandsCommand Description

Livtoc live table of contents: provides a list of queue’sQdltm queue deletion: deletes a processQinfo queue info: provides a list of queue typesQlist queue list: list processesqopen <qname> queue open: opens the queue qnameqscan -i <corelId> queue scan: filter for a specific corelIdqscan none queue scan: removes filters (ie. scan all)qset <qtype> queue set: sets the queue-type

for gw: qtype = METROfor dm: qtype = ?for fa: qtype = METRO

Quit quit qmadminV verbose mode

NEVER use qmadmin from a session on your own machine. ALWAYS use VNC to remotely access dmoctf:1 first.

tmadim CommandsCommand Description

migg <service> migrates services (all servers will have updated info so that the services are still reachable)

pclean <machinename> process clean: tells tuxedo that the server machinename is not available (could have been removed)

Bbc cleans all bulletin boardspsc [-s servicename | -g group] lists services advertised (there may be more options available)psr [-g group | -i srvid] lists tuxedo servers (there are more options available)

*this list is incomplete – updates to come as time permits.