Beruflich Dokumente
Kultur Dokumente
Appendix
Appendix
Appendix
UNIX COMMAND - CD
USAGE
The cd command changes your current
working directory to the directory that you
specify
Appendix
[root@SHT_RBT_TB_SERVER:/]su - prbt
Sun Microsystems Inc.
SunOS 5.9
Generic May 2002
SHT_RBT_TB_SERVER:(prbt):/data/prbt> cd bin
SHT_RBT_TB_SERVER:(prbt):/data/prbt/bin> pwd
/data/prbt/bin
SHT_RBT_TB_SERVER:(prbt):/data/prbt/bin> cd
SHT_RBT_TB_SERVER:(prbt):/data/prbt>
Appendix
UNIX COMMAND - ls
USAGE
The ls command lists the files and subdirectories of the current directory you are in. You can also add some
arguments to the ls command to make it more meaningful
If you type "ls -F" it will append a forward slash to the subdirectory names so you can easily distinguish them from
file names.
If you type "ls -a" it will show all hidden files such as .htaccess files.
If you type "ls -l" it will show detailed information about each file and directory, including permissions, owners, size,
and when the file was last modified.
[root@SHT_RBT_TB_SERVER:/tmp] ls
hsperfdata_prbt hsperfdata_root
output.txt
[root@SHT_RBT_TB_SERVER:/tmp] ls -l
total 48
drwxr-xr-x
2 prbt
other
drwxr-xr-x
2 root
other
-rw-r--r-1 root
other
drwxr-xr-x
3 root
other
117
241
0
180
screens
[root@SHT_RBT_TB_SERVER:/tmp] ls -a
.
.X11-pipe
hsperfdata_prbt
..
.X11-unix
hsperfdata_root
[root@SHT_RBT_TB_SERVER:/] ls -F /tmp
hsperfdata_prbt/ hsperfdata_root/ output.txt
[root@SHT_RBT_TB_SERVER:/]
output.txt
screens
screens/
Appendix
UNIX COMMAND - ls
USAGE
The ls command lists the files and
subdirectories of the current directory you are
in. You can also add some arguments to the ls
command to make it more meaningful
other
sys
other
/tmp/screens/S-root:
total 32
drwx-----2 root
other
drwxr-xr-x
3 root
other
prw------1 root
other
prw------1 root
other
prw------1 root
other
[root@SHT_RBT_TB_SERVER:/]
18
19
18
18
21:09
03:30
17:28
19:03
.
..
26384
27245
1192
180
0
0
0
Jul
Sep
Mar
Jul
Mar
11
8
31
12
31
23:53
2008
10:31
03:21
10:32
.
..
23839.DB1
23884.DB2
23897.FE1
7
Appendix
test.d
test.d/
Appendix
Appendix
UNIX COMMAND - cp
USAGE
The cp command copies a file to a new location or filename.
Simply type "cp filename copyname" at a telnet command
prompt and replace filename with the name of the file you
want to copy, and copyname with the name of the new copy
Appendix
UNIX COMMAND - mv
USAGE
The mv command renames a file or moves it to a new location. Simply
type "mv oldfile newfile" at a telnet command prompt and replace
oldfile with the name of the file you want to rename or move, and
newfile with the new name of the new file
readme.txt readyou.txt
-l read*
0 Jul 19 16:24 readyou.txt
output.txt
-l
readyou.txt
screens
Appendix
UNIX COMMAND - rm
USAGE
Usage: The rm command deletes (removes) a file. Simply type
"rm filename" at a telnet command prompt and replace
filename with the name of the file you want to delete
117
241
0
0
180
Jul
Jul
Jul
Jul
Sep
18
18
10
19
8
14:41
21:09
11:53
16:24
2008
hsperfdata_prbt
hsperfdata_root
output.txt
readme.txt
screens
[root@SHT_RBT_TB_SERVER:/tmp] rm readme.txt
[root@SHT_RBT_TB_SERVER:/tmp]
[root@SHT_RBT_TB_SERVER:/tmp] ls -l
total 48
drwxr-xr-x
2 prbt
other
drwxr-xr-x
2 root
other
-rw-r--r-1 root
other
drwxr-xr-x
3 root
other
[root@SHT_RBT_TB_SERVER:/tmp]
117
241
0
180
Appendix
UNIX COMMAND - rm
USAGE
Usage: The rm command deletes (removes) a file. Simply type
"rm filename" at a telnet command prompt and replace
filename with the name of the file you want to delete
mkdir test.d
touch ./test.d/readme.txt
ls -l
117
241
0
180
184
rm test.d
Jul
Jul
Jul
Sep
Jul
18
18
10
8
19
14:41
21:09
11:53
2008
21:28
hsperfdata_prbt
hsperfdata_root
output.txt
screens
test.d
rm -r test.d
ls -l
117
241
0
180
Appendix
14
Appendix
15
Appendix
USAGE
The wc command - display a count of lines,
Words and characters in a file
Appendix
17
Appendix
Appendix
Appendix
OSMESSAGE () {
echo "(1). Systems"
echo "-----------------------------------------------------------------------------"
echo "[HOST NAME] hostname: "`hostname`
--More--(5%)
20
Appendix
21
Appendix
TIP!!!
Do not use full path for source directory,
when you create tar file.
22
Appendix
Appendix
Appendix
25
Appendix
The cat command concatenate and display files. The cat utility reads each file in
sequence and writes it on the standard output.
26
Appendix
27
Appendix
UNIX COMMAND du
USAGE
The du command summarize disk usage. The du utility writes to standard output the
size of the file space allocated to, and the size of the file space allocated to
each subdirectory of, the file hierarchy rooted in each of the specified files
TIP!!!
The result 7407 means 7407 Kbytes.
28
Appendix
29
Appendix
30
Appendix
TIP!!!
- mtime: True if the file's data was modified
n days ago
31
Appendix
UNIX COMMAND su
USAGE
The su command become super user or another user.
TIP!!!
-env: If you want to check what its different,
Please execute env command at your terminal
# su prbt
Example 2: Becoming User prbt and Changing to prbt's Login
Environment
To become user prbt but change the environment to what would
be expected if prbt had originally logged in, execute:
# su - prbt
32
Appendix
UNIX COMMAND su
USAGE
The su command become super user or another user.
33
Appendix
The split utility reads file and writes it in linecount-line pieces into a set of
output-files on your terminal.
split COMMAND Example
[EXAMPLE]
[root@SHT_RBT_TB_SERVER:/temp] ls -la temp_backup.tar
-rw-r--r-- 1 root other 2312192 Jul 19 23:53 temp_backup.tar
[root@SHT_RBT_TB_SERVER:/temp] split -b 1m ./temp_backup.tar temp_backup_
[root@SHT_RBT_TB_SERVER:/temp] ls -la temp_backup_*
-rw-r--r-- 1 root other 1048576 Jul 23 19:18 temp_backup_aa
-rw-r--r-- 1 root other 1048576 Jul 23 19:18 temp_backup_ab
-rw-r--r-- 1 root other 215040 Jul 23 19:18 temp_backup_ac
[root@SHT_RBT_TB_SERVER:/temp]
[root@SHT_RBT_TB_SERVER:/temp] ls -l temp_backup*
-rw-r--r-- 1 root other 1048576 Jul 23 19:18 temp_backup_aa
-rw-r--r-- 1 root other 1048576 Jul 23 19:18 temp_backup_ab
-rw-r--r-- 1 root other 215040 Jul 23 19:18 temp_backup_ac
[root@SHT_RBT_TB_SERVER:/temp] cat temp_backup_* > temp_backup.tar
[root@SHT_RBT_TB_SERVER:/temp] ls -la temp_backup*
-rw-r--r-- 1 root other 2312192 Jul 24 11:40 temp_backup.tar
-rw-r--r-- 1 root other 1048576 Jul 23 19:18 temp_backup_aa
-rw-r--r-- 1 root other 1048576 Jul 23 19:18 temp_backup_ab
-rw-r--r-- 1 root other 215040 Jul 23 19:18 temp_backup_ac
FILE SPLIT
FILE MERGE
34
Appendix
WARNING!!!
Do NOT edit these files directly!!!
For Solaris
crontab files: /var/spool/cron/crontabs/*
Log file: /var/cron/log
For Linux
crontab files: /var/spool/cron/*
35
Appendix
# touch /tmp/crontest.log
After two weeks, check the result.
# cat /tmp/crontest.log
TIP!!!
If crontab e does not show proper screen, check
EDITOR (echo $EDITOR) and set it vi as follows;
# EDITOR=vi
# export EDITOR
# echo $EDITOR
vi
36
Appendix
37
Appendix
38
Appendix
39
Appendix
SELECT all
Appendix
The following files are being installed with setuid and/or setgid
permissions:
/usr/local/bin/lsof <setgid sys>
/usr/local/bin/sparcv7/lsof <setgid sys>
/usr/local/bin/sparcv9/lsof <setgid sys>
Do you want to install these as setuid/setgid files [y,n,?,q] y
Installing lsof as <SMClsof>
## Installing part 1 of 1.
/usr/local/bin/lsof
/usr/local/bin/sparcv7/lsof
/usr/local/bin/sparcv9/lsof
/usr/local/doc/lsof/00.README.FIRST
/usr/local/doc/lsof/00CREDITS
/usr/local/doc/lsof/00DCACHE
/usr/local/doc/lsof/00DIALECTS
/usr/local/doc/lsof/00DIST
/usr/local/doc/lsof/00FAQ
/usr/local/doc/lsof/00LSOF-L
/usr/local/doc/lsof/00MANIFEST
/usr/local/doc/lsof/00PORTING
/usr/local/doc/lsof/00QUICKSTART
/usr/local/doc/lsof/00README
/usr/local/doc/lsof/00TEST
/usr/local/doc/lsof/00XCONFIG
/usr/local/doc/lsof/lsof.man
/usr/local/man/man8/lsof.8
[ verifying class <none> ]
Installation of <SMClsof> was successful.
SELECT Y = YES
Appendix
--------------------------------------------------------------system
system
system
system
application
system
application
system
system
application
system
SUNWzip
SUNWzlib
SUNWzlibx
SUNWzsh
SUNWzuluc
SUNWzulur
SUNWzuluw
SUNWzulux
TSIpgx
TSIpgxw
TSIpgxx
Appendix
[root@SHT_RBT_TB_SERVER:/temp]pkgadd -d
lsof-4.80-sol9-sparc-local
The following packages are available:
1 SMClsof
lsof
(sparc) 4.80
Appendix
/usr/local/doc/lsof/00CREDITS
/usr/local/doc/lsof/00.README.FIRST
/usr/local/doc/lsof
/usr/local/doc <shared pathname not removed>
/usr/local/bin/sparcv9/lsof
/usr/local/bin/sparcv9 <shared pathname not removed>
/usr/local/bin/sparcv7/lsof
/usr/local/bin/sparcv7 <shared pathname not removed>
/usr/local/bin/lsof
/usr/local/bin <shared pathname not removed>
## Updating system information.
Removal of <SMClsof> was successful.
Appendix
PID
154
154
177
177
16347
16482
20142
20145
20400
20400
23929
23930
23951
23952
23964
USER
root
root
root
root
root
root
root
drbt
drbt
drbt
root
root
root
root
root
FD
6u
7u
11u
13u
2u
0u
6u
4u
0u
1u
5u
5u
5u
5u
5u
TYPE
IPv4
IPv4
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
DEVICE
0x3000310f270
0x3000310f0f0
0x3000310ef70
0x3000310f870
0x300447c81b8
0x3092cd2edb8
0x30823ca5248
0x30823ca5248
0x30046898ac0
0x30046898ac0
0x309443e9270
0x309443e9270
0x309443e84f0
0x309443e84f0
0x300542e8058
Appendix
Type rup -h" to find out the status of all hosts on the network
in alphabetically order by host name.
[root@SHT_RBT_TB_SERVER:/]/usr/bin/rup -h
collecting responses...
172.18.98.33.12
up 449 days, 10:28,
load average: 0.02, 0.01, 0.01
172.18.98.34.12
up 449 days, 9:10,
load average: 0.07, 0.09, 0.11
172.18.98.52.12
up 449 days, 8:46,
load average: 0.09, 0.05, 0.05
172.18.98.53.12
up 449 days, 8:44,
load average: 0.01, 0.03, 0.04
LOCAL
up 10 days, 15:35,
load average: 0.30, 0.39, 0.50
SHT_MCP_IVR1
up 448 days, 9:05,
load average: 0.00, 0.00, 0.02
SHT_MCP_IVR2
up 448 days, 8:58,
load average: 0.00, 0.02, 0.03
SHT_RBT_CMS1
up 449 days, 8:46,
load average: 0.09, 0.05, 0.05
SHT_RBT_CMS2
up 449 days, 8:44,
load average: 0.01, 0.03, 0.04
SHT_RBT_IP1_A1
up 447 days, 11:05,
load average: 0.04, 0.04, 0.05
SHT_RBT_IP1_A2
up 447 days, 11:21,
load average: 0.07, 0.10, 0.12
SHT_RBT_IP2_A1
up 271 days, 10:52,
load average: 0.00, 0.01, 0.02
SHT_RBT_IP2_A2
up 447 days, 10:16,
load average: 0.03, 0.05, 0.05
SHT_RBT_MCP1_BG
up 449 days, 10:12,
load average: 0.06, 0.09, 0.09
SHT_RBT_MCP1_BG
up 449 days, 10:11,
load average: 0.16, 0.11, 0.10
SHT_RBT_MCP1_D1
up 4 days, 5:46,
load average: 0.33, 0.34, 0.35
SHT_RBT_MCP1_D2
up 4 days, 8:17,
load average: 0.00, 0.00, 0.00
S HT_RBT_SCP2_B
up 448 days, 10:41,
load average: 0.04, 0.04, 0.04
SHT_RBT_SCP2_O
up 448 days, 10:13,
load average: 0.21, 0.19, 0.19
SHT_RBT_TB_IP
up 782 days, 19:28,
load average: 0.02, 0.02, 0.02
TB-SERVER
up 10 days, 15:35,
load average: 0.30, 0.39, 0.50
Appendix
Appendix
Appendix
Type iostat " to display a single history since boot report for all
CPU and devices.
[root@JB_PRBT_IP1_O:/]iostat
tty
sd0
sd1
tin tout kps tps serv kps tps serv
0
73 611 35
2
0
0
0
sd30
kps tps serv
0
0
1
nfs1
kps tps serv
0
0
0
cpu
us sy wt id
1 1 4 94
nfs1
kps tps serv
0
0
0
0
0
0
0
0
0
0
0
0
Appendix
nfs1
kps tps serv
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Appendix
OK
[root@JB_PRBT_IP1_O:/]iostat -en
---- errors --s/w h/w trn tot
1 126 27 154 c1t0d0
0
0
0
0 c1t1d0
1
0
0
1 c0t0d0
0
0
0
0 OMP:vold(pid484)
NOT OK
sd30
kps tps serv
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
nfs1
kps tps serv
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
cpu
us sy wt
1 1 4
1 0 9
1 1 5
0 0 7
1 1 9
id
94
90
93
93
89
Appendix
faults
cpu
in
sy
cs us sy
670 626 531 1 1
810 739 621 2 1
565 537 468 0 0
id
98
97
100
disk
faults
cpu
s0 s1 s3 -in
sy
cs us sy id
35 0 0 0 670 626 531 1 1 98
2 0 0 0 566 604 477 0 0 100
312 0 0 0 1529 1433 1058 7 6 87
727 0 0 0 2770 2259 1886 10 10 81
631 0 0 0 2491 2134 1662 24 9 67
Appendix
PID
27659
27616
555
27651
315
325
18486
1616
313
317
319
261
23784
236
825
CPU
0.62%
0.46%
0.20%
0.20%
0.06%
0.05%
0.05%
0.02%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
14:39:45
% swap
COMMAND
oracle
oracle
SysAgent.exe
ssp
oracle
oracle
flexd
top
oracle
oracle
oracle
utmpd
sopagt
nscd
dtsession
Baixaki picture