Você está na página 1de 14

Basic Unix Commands

After login to the UNIX system you get prompt like (# or $ or %)


# : prompt indicates you have root privileges or admin privileges
$ or % : prompt indicates you are not an admin user
In unix root is the super user or admin user and it is default
Commands
# pwd

(present working directory)


/home/rabindra
here /home/rabindra is my home directory or default directory
This directory is set by unix administrator

# pwd
/oracle/TBQ
# ls l

(list all the files in /oracle/TBQ directory)


total 144
drwxr-xr-x 44 oratbq dba
4096 Mar 09 11:28 920_64
drwxr-xr-x 3 oratbq dba
256 Mar 28 14:04 backup
drwxr-xr-x 2 oratbq dba
256 Apr 14 15:04 export
drwxr-xr-x 2 oratbq dba
256 Apr 14 10:23 mirrlogA
drwxr-xr-x 2 oratbq dba
256 Apr 14 10:23 mirrlogB
drwxr-xr-x 2 oratbq dba
40960 Apr 17 10:02 oraarch
drwxr-xr-x 3 oratbq dba
256 Apr 14 10:22 origlogA
drwxr-xr-x 2 oratbq dba
256 Apr 14 10:23 origlogB
drwxr-xr-x 3 oratbq dba
256 Apr 14 09:23 saparch
drwxr-xr-x 2 oratbq dba
4096 Apr 14 10:34 sapbackup
drwxr-xr-x 2 oratbq dba
4096 Apr 17 13:02 sapcheck
drwxr-xr-x 4 oratbq dba
256 Apr 14 09:29 sapdata1
drwxr-xr-x 3 oratbq dba
256 Apr 14 09:29 sapdata2
drwxr-xr-x 20 oratbq dba
4096 Apr 14 15:31 sapdata3
drwxr-xr-x 19 oratbq dba
4096 Apr 14 09:29 sapdata4
drwxr-xr-x 2 oratbq dba
256 Apr 12 12:05 sapreorg
drwxr-xr-x 4 oratbq dba
256 Mar 08 16:27 saptrace
-rw-r--r-- 1 oratbq dba
83 Mar 21 11:05 startsap_DVEBMGS10.log
-rw-r--r-- 1 oratbq dba
166 Apr 14 08:39 stopsap_DVEBMGS10.log

The d at the beginning of the line indicates Directory


Others represent files

Check the blue line one


This is directory with name 920_64
Its permissions are 755 ( owner=7, group=5 and others=5)
920_64 directory owned by oratbq
920_64 directory belongs to dba group
4096 shows the size of the derecotry
next it is createion /modification date
next is the directory name.
Now go inside 920_64 i.e called change directory
# cd 920_64
# pwd (check where you are now)
/oracle/TBQ/920_64
# cd ..
# pwd

(come one step back )


/oracle/TBQ

# cd / (go to root directory)


# pwd
/
#mkdir test
(below message shows that permission is not there to create)
mkdir: 0653-357 Cannot access directory ..
: The file access permissions do not allow the specified action.
# cd /oracle/TBQ
# mkdir test
# cd test
# pwd
/oracle/TBQ/test
# touch file1 file2 file3 file4 (touch command creates files with 0 bytes / blank file)
#ls -l
total 0
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file1
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file2
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file3
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file4
# mkdir dir1
#ls l
total 0

drwxr-xr-x 2 oratbq dba


-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
# cp file1 file5 (copy file1 to file2)
# cp file2 file6
# ls l
total 8
drwxr-xr-x 2 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba

256 Apr 17 14:26 dir1


0 Apr 17 14:26 file1
0 Apr 17 14:26 file2
0 Apr 17 14:26 file3
0 Apr 17 14:26 file4

256 Apr 17 14:26 dir1


0 Apr 17 15:11 fil3
43 Apr 17 15:12 file1
0 Apr 17 14:26 file2
0 Apr 17 14:26 file3
0 Apr 17 14:26 file4
0 Apr 17 15:11 file5
0 Apr 17 15:13 file6

# ls ltr (check file by time in recursive/descending order)


total 8
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file4
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file3
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file2
drwxr-xr-x 2 oratbq dba
256 Apr 17 14:26 dir1
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 fil3
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 file5
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:13 file6
-rw-r--r-- 1 oratbq dba
95 Apr 17 15:15 file1
check the blue highlighted file which is modified latest. It contains some data
inside. To check the content inside issue following command
# vi file1 ( you can view ,modify , add and delete the contents using vi editor)
# cat file1 (you can only display the contents)
This is a test file
This is my first file
First file will be deleted once my testing is done.
# rm file2 (removes file2 from system)
# ls l
total 8
drwxr-xr-x 2 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba

256 Apr 17 14:26 dir1


0 Apr 17 15:11 fil3
95 Apr 17 15:15 file1
0 Apr 17 14:26 file3

-rw-r--r-- 1 oratbq dba


-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba

0 Apr 17 14:26 file4


0 Apr 17 15:11 file5
0 Apr 17 15:13 file6

You can see there is no file2 in the list after using rm command above.
# man cp ( help for cp command)
# mv file1 file7 (this command renames the file1 to file7)
total 8
drwxr-xr-x 2 oratbq dba
256 Apr 17 14:26 dir1
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 fil3
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file3
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file4
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 file5
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:13 file6
-rw-r--r-- 1 oratbq dba
95 Apr 17 15:15 file7
now check below commands and watch the difference
# cp file7 file3
# ls -ltr
total 16
-rw-r--r-- 1 oratbq dba
drwxr-xr-x 2 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba

0 Apr 17 14:26 file4


256 Apr 17 14:26 dir1
0 Apr 17 15:11 fil3
0 Apr 17 15:11 file5
0 Apr 17 15:13 file6
95 Apr 17 15:15 file7
95 Apr 17 15:27 file3

Now file7 and file3 are same in size of 95 bytes because file3 is copied from file7
and file3 got overwritten. All the sizes are in bytes.
# pwd
/oracle/TBQ/test
You are doing everything under /oracle/TBQ/test directory.
# ps -ef|more (check the processes running in the system)
UID PID PPID C STIME TTY TIME CMD
root
1
0 0 Apr 09
- 0:02 /etc/init
nobody 90262
1 0 Apr 09
- 0:00 /teamquest/manager/httpd/tqhttpd -p
2780 -N 0 /teamquest/data/log/tqhttpd.pid /teamquest/manager/htdocs

root 110694
1 0 Apr 09
root 118926
1 0 Apr 09
root 282794
1 0 Apr 09
root 299154
1 0 Apr 09
root 303332
1 0 Apr 09
root 311518
1 0 Apr 09
-service
root 315610 360634 0 Apr 09
root 331806 360634 0 Apr 09
root 344294
1 0 Apr 09
root 348384 360634 0 Apr 09
root 352448 360634 0 Apr 09
root 356562 405712 0 Apr 09
/usr/lpp/OV/bin/OvSvcDiscAgent.sh
root 360634
1 0 Apr 09
root 364762 311518 0 Apr 09
root 368820 360634 0 Apr 09
root 372918 360634 0 Apr 09
root 377016 360634 0 Apr 09
root 381114 360634 0 Apr 09
root 385212 360634 0 Apr 09
root 389310 360634 0 Apr 09

5:46 /usr/sbin/syncd 60
0:00 /usr/lib/errdemon
0:01 /usr/sbin/cron
0:00 /usr/ccs/bin/shlap64
0:00 /usr/sbin/uprintfd
0:00 /teamquest/manager/bin/tqmgr
- 0:00 /usr/sbin/snmpmibd
- 0:00 /usr/sbin/qdaemon
1:13 /opt/dcelocal/bin/dced -b -t 1440
- 0:00 /usr/sbin/muxatmd
- 0:00 /usr/sbin/hostmibd
- 0:00 sh -0:00 /usr/sbin/srcmstr
- 0:00 /teamquest/manager/bin/tqtcpd
- 0:00 /usr/sbin/syslogd
- 0:00 sendmail: accepting connections
- 0:00 /usr/sbin/portmap
- 0:00 /usr/sbin/inetd
- 0:00 /usr/sbin/snmpd
- 0:01 /usr/sbin/aixmibd

I used more in this to display the process in page wise because it shows all the processes
running in the system. Heading of the display is highlighted in blue. You can try without
using more.
# ps ef|grep ora_ (checks all the process starts with ora_)
tbqadm 524300
tbqadm 549048
tbqadm 598160
tbqadm 610342
tbqadm 651272
tbqadm 659522
tbqadm 671882
tbqadm 1159328

1
1
1
1
1
1
1
1

0
0
0
0
0
0
0
0

Apr 14
Apr 14
Apr 14
Apr 14
Apr 14
Apr 14
Apr 14
Apr 14

- 1:59 ora_lgwr_TBQ
- 0:34 ora_smon_TBQ
- 0:39 ora_arc0_TBQ
- 0:14 ora_ckpt_TBQ
- 0:59 ora_dbw0_TBQ
- 0:05 ora_pmon_TBQ
- 0:00 ora_reco_TBQ
- 0:38 ora_arc1_TBQ

#ps ef|grep dw (cheks all the processes starting with dw)


tblusr17:oratbq 107> ps -ef|grep dw
tbqadm 413700 507966 0 15:00:06
pf=/usr/sap/TBQ/SYS/profile/T
BQ_DVEBMGS10_tblusr17

- 0:00 dw.sapTBQ_DVEBMGS10

tbqadm 467156 507966 0 Apr 14


pf=/usr/sap/TBQ/SYS/profile/T
BQ_DVEBMGS10_tblusr17
tbqadm 483468 507966 0 Apr 14
pf=/usr/sap/TBQ/SYS/profile/T
BQ_DVEBMGS10_tblusr17

- 9:11 dw.sapTBQ_DVEBMGS10
- 1:03 dw.sapTBQ_DVEBMGS10

grep --- looks for the string in the files and should be used with pipe | like above
command
# ls l
total 16
drwxr-xr-x 2 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba

256 Apr 17 14:26 dir1


0 Apr 17 15:11 fil3
95 Apr 17 15:27 file3
0 Apr 17 14:26 file4
0 Apr 17 15:11 file5
0 Apr 17 15:13 file6
95 Apr 17 15:15 file7

# chmod 754 file3 (change mode/permission of file3 to rwx,rx- ,r--)


total 16
drwxr-xr-x 2 oratbq dba
256 Apr 17 14:26 dir1
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 fil3
-rwxr-xr-- 1 oratbq dba
95 Apr 17 15:27 file3
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file4
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 file5
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:13 file6
-rw-r--r-- 1 oratbq dba
95 Apr 17 15:15 file7
read ( r ) = 4 , write ( w ) = 2 , execute ( x ) = 1 , Total = 4+2+1 = 7
# chmod 777 file6 (you are assigning full permission to file6)
total 16
drwxr-xr-x 2 oratbq dba
256 Apr 17 14:26 dir1
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 fil3
-rwxr-xr-- 1 oratbq dba
95 Apr 17 15:27 file3
-rw-r--r-- 1 oratbq dba
0 Apr 17 14:26 file4
-rw-r--r-- 1 oratbq dba
0 Apr 17 15:11 file5
-rwxrwxrwx 1 oratbq dba
0 Apr 17 15:13 file6
-rw-r--r-- 1 oratbq dba
95 Apr 17 15:15 file7
# cp /oracle/TBQ/oraarch/TBQarch1_99.dbf . (Copied file TBQarch1_99.dbf to
current directory)
# ls -l

total 102424
-rw-r----- 1 oratbq dba
drwxr-xr-x 2 oratbq dba
-rw-r--r-- 1 oratbq dba
-rwxr-xr-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rwxrwxrwx 1 oratbq dba
-rw-r--r-- 1 oratbq dba

52427776 Apr 17 15:51 TBQarch1_99.dbf


256 Apr 17 14:26 dir1
0 Apr 17 15:11 fil3
95 Apr 17 15:27 file3
0 Apr 17 14:26 file4
0 Apr 17 15:11 file5
0 Apr 17 15:13 file6
95 Apr 17 15:15 file7

The file TBQarch1_99.dbf is 52.4MB in size .


The (.) in above command represent current directory)
# compress TBQarch1_99.dbf
# ls -ltr
total 24624
-rw-r--r-- 1 oratbq dba
drwxr-xr-x 2 oratbq dba
-rw-r--r-- 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rwxrwxrwx 1 oratbq dba
-rw-r--r-- 1 oratbq dba
-rwxr-xr-- 1 oratbq dba
-rw-r----- 1 oratbq dba

0 Apr 17 14:26 file4


256 Apr 17 14:26 dir1
0 Apr 17 15:11 fil3
0 Apr 17 15:11 file5
0 Apr 17 15:13 file6
95 Apr 17 15:15 file7
95 Apr 17 15:27 file3
12597371 Apr 17 15:51 TBQarch1_99.dbf.Z

check the filename after compress. TBQarch1_99.dbf.Z


.Z denotes that file is a compressed file
Check the filesize after compress in red. It reduced to 12.5 MB
The above copy command also can be written as below.
# cp /oracle/TBQ/oraarch/TBQarch1_99.dbf /oracle/TBQ/test
This is required when you are copying from one location to another location.
Here the file TBQarch1_99.dbf is located in /oracle/TBQ/oraarch/
You are copying the file to /oracle/TBQ/test
Source = /oracle/TBQ/oraarch
Target = /oracle/TBQ/test
Check the filesystem size
# pwd
/oracle/TBQ/oraarch
(now I am in /oracle/TBQ/oraarch directory)
# df k (check disk filesystem in Kilobytes)
Filesystem 1024-blocks
Free %Used Iused %Iused Mounted on

/dev/hd4
131072 108076 18% 2178 9% /
/dev/hd2
2097152 119604 95% 35718 54% /usr
/dev/hd9var
524288 366856 31%
506 1% /var
/dev/hd3
1048576 957880 9%
520 1% /tmp
/dev/fwdump
262144 261776 1%
4 1% /var/adm/ras/platform
/dev/hd1
131072 130488 1%
38 1% /home
/proc
- - - /proc
/dev/hd10opt
131072 100896 24%
729 4% /opt
/dev/orasource 6291456 1092456 83% 28052 11% /orasource
/dev/teamquestlv
917504 684396 26% 8360 6% /teamquest
/dev/sapinstlv 2097152 1364728 35%
748 1% /usr/sap
/dev/sapmntlv 2097152 1604188 24%
490 1% /sapmnt
/dev/patcheslv 5242880 2604672 51% 1653 1% /patches
/dev/openview
262144 215072 18%
983 3% /openview
/dev/oraclelv 209977344 18999628 91% 20525 1% /oracle
/dev/recovery 78643200 52207208 34%
102 1% /recovery
The left most starts with /dev are the filesystem from hardisk at system level
The rightmost name like /oracsource, / , /usr , /oracle are mounted to the
corresponding filesystem to our understanding.
Check /oracle is mounted on /dev/oraclelv and its size equal to 210GB.
91% is used from 210GB and left with 18.99 GB which is 9% free.
Disk usage
# pwd
/recovery/DDB/041006 ( I am in /recovery/DDB/041006 directory)
# ls l
total 24
drwxr-xr-x 2 oratbq dba
4096 Apr 10 14:27 DDB
drwxr-xr-x 2 oratbq dba
4096 Apr 11 08:57 archbackup
drwxr-xr-x 2 oratbq dba
4096 Apr 10 15:55 bdsitkwv
there are 3 directories in this location
# du k . (check the disk usage for each of the directories)
24955960
96
556008
25512068

./bdsitkwv
./DDB
./archbackup
.
(indicates Total size)

# who (Who has logged in in this window).


oratbq
pts/0
Apr 14 09:21 (172.17.22.160)
oratbq
pts/1
Apr 17 16:08 (172.17.22.175)

oratbq has logged in from two systems whose IP addresses are 172.17.22.160
and 172.17.22.175.
# passwd <username> (change password for a specified user. If nothing is specified in
username field then system will prompt you to change the current user password)
Example.
% passwd
Changing password for "rabindra"
rabindra's Old password:
rabindra's New password:
Enter the new password again:
# ps ef|grep lsnr (searching for a service with name lsnr)
oratbq 647262 540858 0 16:39:11 pts/0 0:00 grep lsnr
oratbq 1147128
1 0 Apr 14 - 0:00 /oracle/TBQ/920_64/bin/tnslsnr
LISTENER inherit
lsnr process runs with PID 1147128
# kill -9 1147218 (kills lsnr process by killing its PID number 1147128)
# vmstat 2 ( Shows virtual memory status in the system)
System configuration: lcpu=4 mem=7936MB
kthr memory
page
faults
cpu
----- ----------- ------------------------ ------------ ----------r b avm fre re pi po fr sr cy in sy cs us sy id wa
0 0 1100426 34955 0 0 0 0 0 0 3 145 240 0 0 99 0
0 0 1100427 34954 0 0 0 0 0 0 2 436 223 0 0 99 0
0 0 1100427 34954 0 0 0 0 0 0 2 147 218 0 0 99 0
0 0 1100427 34954 0 0 0 0 0 0 30 119 281 0 1 99 1
0 0 1100427 34954 0 0 0 0 0 0 4 75 221 0 0 99 0
# env

(check environment variable for current user)


TERM=ansi
AUTHSTATE=compat
SHELL=/bin/csh
HOME=/oracle/TBQ
USER=oratbq
PATH=/oracle/TBQ/920_64/bin:/oracle/TBQ:/usr/sap/TBQ/SYS/exe/runU:/usr/sa
p/TBQ/SYS/exe/run:/usr/bin:
/etc:/usr/sbin:/usr/ucb:/oracle/TBQ/bin:/usr/bin/X11:/sbin:.
TZ=EST5EDT

LANG=en_US
LOCPATH=/usr/lib/nls/loc
LC__FASTMSG=true
ODMDIR=/etc/objrepos
DCE_USE_WCHAR_NAMES=1
LOGNAME=oratbq
LOGIN=oratbq
SAPSYSTEMNAME=TBQ
DIR_LIBRARY=/usr/sap/TBQ/SYS/exe/run
THREAD=NOPS
dbms_type=ORA
dbs_ora_tnsname=TBQ
dbs_ora_schema=SAPTBQ
ORACLE_PSRV=TBQ
ORACLE_SID=TBQ
DB_SID=TBQ
ORACLE_HOME=/oracle/TBQ/920_64
ORACLE_BASE=/oracle
ORA_NLS33=/oracle/TBQ/920_64/ocommon/nls/admin/data
NLS_LANG=AMERICAN_AMERICA.UTF8
SAPDATA_HOME=/oracle/TBQ
MAIL=/var/spool/mail/oratbq
MAILMSG=[YOU HAVE NEW MAIL]
LIBPATH=/usr/lib:/lib:/usr/sap/TBQ/SYS/exe/run:/usr/sap/TBQ/SYS/exe/runU
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
# vi .profile (set environment variable in a file and know as .profile)
#pwd
/oracle/TBQ
# ls la (list the hidden files. Hidden files are denoted by . at the beginning of file. We
use option a to list these hidden files. Check the files/dirs highlighted in blue.)
drwxr-xr-x 20 oratbq dba
4096 Apr 17 14:25 .
drwxrwxr-x 16 oratbq dba
4096 Apr 09 23:26 ..
-rw-r-xr-x 1 oratbq dba
1085 Mar 09 10:03 .cshrc
-rw-r-xr-x 1 oratbq dba
4054 Mar 09 10:03 .dbenv_tblusr17.csh
-rw-r-xr-x 1 oratbq dba
4049 Mar 09 10:03 .dbenv_tblusr17.sh
-rw-r-xr-x 1 oratbq dba
250 Jun 24 2004 .dbsrc_tblusr17.csh
-rw-r-xr-x 1 oratbq dba
232 Jun 24 2004 .dbsrc_tblusr17.sh
-rw-r-xr-x 1 oratbq dba
1312 Mar 09 10:03 .login
-rw-r-xr-x 1 oratbq dba
919 Mar 09 10:03 .profile
-rw-r-xr-x 1 oratbq dba
8555 Mar 09 10:03 .sapenv_tblusr17.csh
-rw-r-xr-x 1 oratbq dba
7847 Mar 09 10:03 .sapenv_tblusr17.sh
-rw-r-xr-x 1 oratbq dba
834 Jun 24 2004 .sapsrc_tblusr17.csh
-rw-r-xr-x 1 oratbq dba
687 Jun 24 2004 .sapsrc_tblusr17.sh

-rw------- 1 oratbq dba


2768 Apr 05 11:17 .sh_history
drwxr-xr-x 44 oratbq dba
4096 Mar 09 11:28 920_64
drwxr-xr-x 3 oratbq dba
256 Mar 28 14:04 backup
drwxr-xr-x 2 oratbq dba
256 Apr 14 15:04 export
drwxr-xr-x 2 oratbq dba
256 Apr 14 10:23 mirrlogA
drwxr-xr-x 2 oratbq dba
256 Apr 14 10:23 mirrlogB
# ifconfig a (This command is used to check the IP address of the system)
en0:
flags=5e080863,1<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MU
LTICAST,GROUPRT,64BIT,CHECKSUM_OFFLO
AD(ACTIVE),PSEG>
inet 172.17.14.101 netmask 0xffffff00 broadcast 172.17.14.255
tcp_sendspace 131072 tcp_recvspace 65536
lo0:
flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTIC
AST,GROUPRT,64BIT>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
# hostname (used to display hostname of the system).
tblusr17
# vi /etc/passwd (To check all the users in the system)
root:!:0:0::/:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:
guest:!:100:100::/home/guest:
nobody:!:4294967294:4294967294::/:
lpd:!:9:4294967294::/:
lp:*:11:11::/var/spool/lp:/bin/false
invscout:*:6:12::/var/adm/invscout:/usr/bin/ksh
snapp:*:200:13:snapp login user:/usr/sbin/snapp:/usr/sbin/snappd
nuucp:*:7:5:uucp login user:/var/spool/uucppublic:/usr/sbin/uucp/uucico
ipsec:*:201:1::/etc/ipsec:/usr/bin/ksh
oracle9:!:225:225:Oracle9i User Account:/home/oracle9:/usr/bin/ksh
tbqadm:!:204:202:SAP System Administrator:/home/tbqadm:/bin/csh
oratbq:!:205:201:SAP Database Administrator:/oracle/TBQ:/bin/csh
opc_op:*:777:77:OpC operator:/home/opc_op:/bin/ksh

# vi /etc/shadow
system:!:0:root
staff:!:1:ipsec,opc_op
bin:!:2:root,bin
sys:!:3:root,bin,sys
adm:!:4:bin,adm
uucp:!:5:uucp,nuucp
dba:!:201:oracle9,tbqadm,oratbq
oinstall:!:225:oracle9
sapsys:!:202:tbqadm
oper:!:203:tbqadm,oratbq
opcgrp:!:77:opc_op
File Transfer command (ftp)
C:\source> ftp tblusrusr17 (tblusr17 is the target hostname. You can also type IP
address if you are not sure about hostname or hostname is not working over network.

Check the files in target system i.e. in TBLUSR17 system.


# pwd
/oracle/TBQ/target
# ls -l
total 32
-rw-r----- 1 oratbq dba
548 Apr 19 10:09 admcheck.sh
-rw-r----- 1 oratbq dba
8008 Apr 19 10:09 perm.sh
-rw-r----- 1 oratbq dba
313 Apr 19 10:09 sidlist.sh
#telnet <target hostname/IP address) (To work from remote in target system/server)
Provide your username and password at the prompt for target system.
If you dont have userid in target system then contact System admin/Unix admin.
# rm rf target ( To remove a directory forcefully which is not empty)
here I removed the directory target which I created earlier to ftp files.

What are the frequently used UNIX commands in SAP?


By: Manish Gupta
Top 10 fundamental commands which are commanly used in Unix OS.
1. stopsap/startsap for stopping/starting SAP+ DB, stopsap r3/startsap r3 for
stopping/starting R3
2. cdpro for checking the profiles path SAPMNT/<SID>/profile
3. cdexe for checling the kernel folder
4. find . -name filename -print for checking the file in the present directory
5. dpmon pf= <Instance profile path>, jcmon pf=<instance profile path>
6. df -k, bdf for checking all file system usages; df -k ., bdf. for individual file usages
7. ls -lrt for listing of files according to the date modified
8. du -a | sort -k 1n,1 for sorting the files in a recursive manner.
9. h for listing previous used commands.
10. rm < file> for removing file, gzip <file> for zipping the file.
----1. VI and Gedit is an Editor, just like to write any programme save it and go to command
and compile through through GCC -o .cpp
2. Ps -ef is to check the how many running process and Kill any running process

3. gunzip to unzip file


4. tar -xvzf file name to run the zip folder of file content
5. mv mo from one path to another
6. Rf remove forcifully any file
7. Make command to effect any coading content
8. make clean to clean the effect of make command
9. cp coppy from one location to another
10. pwd check the current directory
----Check these commands.
su - production-admin
stopsap all -> make sure that the R/3 Instance and Oracle Database stopped
startsap all -> make sure that the R/3 Instance and Oracle Database started
If the Oracle Database is not started, tried using SAPDBA
su - oracle-admin
sapdba
Options a - Startup / Shutdown Database instance

Você também pode gostar