General Commands of Aix
-
Upload
wimaxaaabgl -
Category
Documents
-
view
220 -
download
0
Transcript of General Commands of Aix
-
8/10/2019 General Commands of Aix
1/17
id- displays the system identity of theuser
lslicense- list maximum number ofusers
last- information about previouslogins
w- lists summary of current users who- displays information about all
current users uname- displays system info
type- shows path location
whereis- shows path location
what- displays header informationabout the source file
whatis- displays a short description ofa function
basename- returns the base filename
ac- displays connect time date- displays or sets the date
timex- displays the elapsed time
cmp- compares two files
diff- compares text files
heador tail- display start or end offile
od- dumps the contents of a file
split- makes smaller files from a large
one cut- cuts out selected text
tr- translates characters
sed- stream edit command to changetext
nl- produces an OUTPUT file byinserting the line number
captoinfo- converts termcap toterminfo
nvdmetoa- convert EB!" files to#$""
sum- displays checksum for a file
errclear- deletes entries in the errorlog
errpt- generates an error report
diag- performs hardware problemdeterminatio
trace- kernel debugging
at- schedules %obs
batch- run & or more %obs in thebackground
nice- execute a command at a lowerpriority
tee- used to preserve output from apipeline
find- finds f iles with matchingexpressions
grep- searches a file for a pattern
login logout
su- switch user
kill- stop a process
stopsrc- gracefully shuts down allsubsystems
shutdown- shutdown system
fastboot- restarts the system withoutrunning fsck
fasthalt- halts the system
lsitab- list contents of the 'etc'inittabfile
rmitab- removes an entry from the'etc'inittab
telinit- forces the init process to re-read the 'etc'inittab
strip- removes symbol table xargs- constructs an argument list
top of page
ac
http://www.ahinc.com/aix/general.htm#idhttp://www.ahinc.com/aix/general.htm#lslicensehttp://www.ahinc.com/aix/general.htm#lasthttp://www.ahinc.com/aix/general.htm#lasthttp://www.ahinc.com/aix/general.htm#whttp://www.ahinc.com/aix/general.htm#whohttp://www.ahinc.com/aix/general.htm#unamehttp://www.ahinc.com/aix/general.htm#unamehttp://www.ahinc.com/aix/general.htm#typehttp://www.ahinc.com/aix/general.htm#whereishttp://www.ahinc.com/aix/general.htm#whereishttp://www.ahinc.com/aix/general.htm#whathttp://www.ahinc.com/aix/general.htm#whatishttp://www.ahinc.com/aix/general.htm#basenamehttp://www.ahinc.com/aix/general.htm#basenamehttp://www.ahinc.com/aix/general.htm#achttp://www.ahinc.com/aix/general.htm#achttp://www.ahinc.com/aix/general.htm#datehttp://www.ahinc.com/aix/general.htm#datehttp://www.ahinc.com/aix/general.htm#timexhttp://www.ahinc.com/aix/general.htm#cmphttp://www.ahinc.com/aix/general.htm#diffhttp://www.ahinc.com/aix/general.htm#headhttp://www.ahinc.com/aix/general.htm#headhttp://www.ahinc.com/aix/general.htm#tailhttp://www.ahinc.com/aix/general.htm#tailhttp://www.ahinc.com/aix/general.htm#odhttp://www.ahinc.com/aix/general.htm#splithttp://www.ahinc.com/aix/general.htm#cuthttp://www.ahinc.com/aix/general.htm#cuthttp://www.ahinc.com/aix/general.htm#trhttp://www.ahinc.com/aix/general.htm#sedhttp://www.ahinc.com/aix/general.htm#nlhttp://www.ahinc.com/aix/general.htm#captoinfohttp://www.ahinc.com/aix/general.htm#nvdmetoahttp://www.ahinc.com/aix/general.htm#sumhttp://www.ahinc.com/aix/general.htm#errclearhttp://www.ahinc.com/aix/general.htm#errpthttp://www.ahinc.com/aix/general.htm#errpthttp://www.ahinc.com/aix/general.htm#diaghttp://www.ahinc.com/aix/general.htm#tracehttp://www.ahinc.com/aix/general.htm#athttp://www.ahinc.com/aix/general.htm#athttp://www.ahinc.com/aix/general.htm#batchhttp://www.ahinc.com/aix/general.htm#batchhttp://www.ahinc.com/aix/general.htm#nicehttp://www.ahinc.com/aix/general.htm#nicehttp://www.ahinc.com/aix/general.htm#teehttp://www.ahinc.com/aix/general.htm#findhttp://www.ahinc.com/aix/general.htm#grephttp://www.ahinc.com/aix/general.htm#loginhttp://www.ahinc.com/aix/general.htm#logouthttp://www.ahinc.com/aix/general.htm#suhttp://www.ahinc.com/aix/general.htm#killhttp://www.ahinc.com/aix/general.htm#killhttp://www.ahinc.com/aix/general.htm#stopsrchttp://www.ahinc.com/aix/general.htm#shutdownhttp://www.ahinc.com/aix/general.htm#fastboothttp://www.ahinc.com/aix/general.htm#fastboothttp://www.ahinc.com/aix/general.htm#fasthalthttp://www.ahinc.com/aix/general.htm#lsitabhttp://www.ahinc.com/aix/general.htm#lsitabhttp://www.ahinc.com/aix/general.htm#rmitabhttp://www.ahinc.com/aix/general.htm#telinithttp://www.ahinc.com/aix/general.htm#telinithttp://www.ahinc.com/aix/general.htm#striphttp://www.ahinc.com/aix/general.htm#xargshttp://www.ahinc.com/aix/general.htm#xargshttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#idhttp://www.ahinc.com/aix/general.htm#lslicensehttp://www.ahinc.com/aix/general.htm#lasthttp://www.ahinc.com/aix/general.htm#whttp://www.ahinc.com/aix/general.htm#whohttp://www.ahinc.com/aix/general.htm#unamehttp://www.ahinc.com/aix/general.htm#typehttp://www.ahinc.com/aix/general.htm#whereishttp://www.ahinc.com/aix/general.htm#whathttp://www.ahinc.com/aix/general.htm#whatishttp://www.ahinc.com/aix/general.htm#basenamehttp://www.ahinc.com/aix/general.htm#achttp://www.ahinc.com/aix/general.htm#datehttp://www.ahinc.com/aix/general.htm#timexhttp://www.ahinc.com/aix/general.htm#cmphttp://www.ahinc.com/aix/general.htm#diffhttp://www.ahinc.com/aix/general.htm#headhttp://www.ahinc.com/aix/general.htm#tailhttp://www.ahinc.com/aix/general.htm#odhttp://www.ahinc.com/aix/general.htm#splithttp://www.ahinc.com/aix/general.htm#cuthttp://www.ahinc.com/aix/general.htm#trhttp://www.ahinc.com/aix/general.htm#sedhttp://www.ahinc.com/aix/general.htm#nlhttp://www.ahinc.com/aix/general.htm#captoinfohttp://www.ahinc.com/aix/general.htm#nvdmetoahttp://www.ahinc.com/aix/general.htm#sumhttp://www.ahinc.com/aix/general.htm#errclearhttp://www.ahinc.com/aix/general.htm#errpthttp://www.ahinc.com/aix/general.htm#diaghttp://www.ahinc.com/aix/general.htm#tracehttp://www.ahinc.com/aix/general.htm#athttp://www.ahinc.com/aix/general.htm#batchhttp://www.ahinc.com/aix/general.htm#nicehttp://www.ahinc.com/aix/general.htm#teehttp://www.ahinc.com/aix/general.htm#findhttp://www.ahinc.com/aix/general.htm#grephttp://www.ahinc.com/aix/general.htm#loginhttp://www.ahinc.com/aix/general.htm#logouthttp://www.ahinc.com/aix/general.htm#suhttp://www.ahinc.com/aix/general.htm#killhttp://www.ahinc.com/aix/general.htm#stopsrchttp://www.ahinc.com/aix/general.htm#shutdownhttp://www.ahinc.com/aix/general.htm#fastboothttp://www.ahinc.com/aix/general.htm#fasthalthttp://www.ahinc.com/aix/general.htm#lsitabhttp://www.ahinc.com/aix/general.htm#rmitabhttp://www.ahinc.com/aix/general.htm#telinithttp://www.ahinc.com/aix/general.htm#striphttp://www.ahinc.com/aix/general.htm#xargshttp://www.ahinc.com/aix/general.htm#top -
8/10/2019 General Commands of Aix
2/17
!isplays connect timetotals for users
Example:ac rootOutputs:total ()*+, seconds
top of page
at
Schedules jobsto run at a later date
Examples What it does
1) at 17:002) banner CALL !"E# $de%$tt&0
') (
#t (,, p*m*. message #// 0O1E is written to terminal tty,
1)at 1*:002) ma+e ,-
$u$ro.er$ma+e-ile') (
ompiles files specified in 'u'roger'makefile* 2esults of thiscompilation are sent to user3s mailbox who initiated the 3at3 re4uest*
at ,l /ist %obs in at 4ueue*root*5+5+(+67,*a 1on Oct ,8 &)(9,, &99&
at ,r root/***'0/a 2emoves a %ob from at 4ueue*at file root*5+5+(+67,*a deleted
top of page
basename
2eturns the base file name of a string
Exampleecho 3basename 43p5d4332eturns the name of the current directory your in* !oes not show the full pathname of thatdirectory*
top of page
batch
2un & or more %obs in the background* #ll output will be sent to the mail system* :obs submittedare started immediately*
http://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#top -
8/10/2019 General Commands of Aix
3/17
Example
batchjob1job2(
;ote Once a batch %ob starts. it3s %ob number can6tbe seen via the at ,lbecause that %ob is nolonger in the batch 4ueue - it3s a running process*
-
8/10/2019 General Commands of Aix
4/17
file
root,daemon&bin)lpd&,7
top of page
date
!isplays or sets the date'time* !ate format is mmdd""/SS&&
Example:date 020'0*'0/00=This sets the date'time to
-
8/10/2019 General Commands of Aix
5/17
top of page
errclear
!eletes entries in the error log
Exampleerrclear 0=Truncates the errlog to , bytes?
top of page
errpt
Generates an error report from entries in the error log
Examples What it does
errpt ,a9p. Produces a detailed report for each entry in the error log
errpt ,a; hdis+1 !isplays an error log for #// errors occurred on this drive* "fmore than a few errors occur within a )7 hour period. executethe E2T"
-
8/10/2019 General Commands of Aix
6/17
0alts the system
top of page
-ind
-
8/10/2019 General Commands of Aix
7/17
top of page
.rep
$earches a file for a pattern* Grep stands for Global 2egular Expression Printer
Examples What it does
.rep ,i Where=s $earch all files in current directory to determine if the string 3@here"s3is contained within it* The -i option ignores the case of letters =@here"sis same as whereis?
lsde% ,C9.rep lp /ist all configured printers
.rep M0,NMA,ON /doc /ist any file that has a *doc suffix that contains a number =,-9? followedby a capital letter =#-H?*
.rep M(0,NMA,ON /doc /ist any file that has a *doc suffix that contains any number except , to
( and is followed by a capital letter =#-H?
.rep P(=Q"P /doc !isplays lines that BEG"; with the word "B1
.rep P=Q"RP /doc !isplays lines that E;! with the word "B1
.rep P(=Q" is @?EABRP/doc
!isplays only those lines that consist of the phrase 3"B1 "$ G2E#T3
.rep ,% P( RP test-ile #
.ood-ile2emoves all the blank lines from the source file 3testfile3 and redirectsthe output to a new file named 3goodfile3*
top of page
head
!isplays the first &, lines =default? of a file*
Example:head ,2 $tmp$phase2/out=!isplays the first )( lines of the file 'tmp'phase)*out*?
top of page
id
!isplays the system identity of the user
Examples What it does
id uidI,=root? gidI,=system?
http://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#top -
8/10/2019 General Commands of Aix
8/17
id ,ru !isplays the U"! of the current login process ,
top of page
last
!isplay information about previous logins stored in the 'usr'adm'wtmp accounting file
Examples What it does
last reboot9head , /ist last ( times systems has been rebooted
last ro.er !isplay times user roger has logged in'out of the system
last tt&0 !isplay times users have logged in'out of port tty,
top of page
lo.in
"nitiates a new user session*
Example:lo.in ,h rs000 root/ogin to the root account on a machine whose hostname is rs5,,,
top of page
lo.out
Terminates all processes on the port your logged in on. including your login shell* ;ote exitwillperform the same action as lo.out*
Examplelo.out/ogs you off the system* /ogin prompt will reappear*?
top of page
lsitab
/ist contents of the 'etc'inittab file
Example:lsitab ,a
http://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#top -
8/10/2019 General Commands of Aix
9/17
top of page
lslicense
/ist maximum number of users that can be concurrently logged in
Example:lslicenseOutputs: 1aximum number of concurrent users J6)
top of page
+ill
$ends a signal to stop or suspend a process from running
Example:+ill ,l/ists valid signals to use with the kill command*?
top of page
nl
Produces an output file by inserting the line number of each line of an input file at the beginning ofeach line
Example:nl $etc$pass5d # $tmp$user/list
top of page
nice
Execute a command at a lower priority* $uper-user may run commands with a higher priority byusing a negative number* 0igher numbers mean lower priorities =base priority is &,?
Examples What it does
nice ,n 1 ma+e 2un the 3make3 command at the low priority of &(
nice ,10 $usr$bin$m%ie5 2un the 3mview3 application at a high priority of &,
top of page
http://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#top -
8/10/2019 General Commands of Aix
10/17
n%dmetoa
onvert EB!" files to #$""
Examples What it does
n%dmetoa AS00/dat#A=T%er'/dat
onverts an EB!" file taken off an #$7,, and converts to an #$""file for the 2$'5,,,
n%dmetoa 1'2AS00/txt #A=T%er'/txt
onverts an EB!" file with a record length of &6) characters to an#$"" file with &6) bytes per line P/U$ & byte for the linefeedcharacter*
top of page
od
!umps the contents of a file in the re4uested format =#$"".octal. hex. or extended character set?
Examples What it does
od ,c $tmp$rc/net/out ,cdisplays bytes as ascii characters
1) od ,cd2)4D;CB=!; >E#')4S=B#D;CB=!; >E#)4ALB#D;CB=!; >E#
By typing in this command. one may check the controlcodes being generated by function keys*
-
8/10/2019 General Commands of Aix
11/17
Examples What it does
cat $tmp$m&test 9 sed ,ePs$reports$report$P # $tmp$m&test
#ll instances of the string LreportsL is replaced with thestring LreportL for the file named 'tmp'mytest
sed ,e 6s$ R$$6 S!D?CE
-
8/10/2019 General Commands of Aix
12/17
strip
2emoves symbol table and other Extended ommon Ob%ect
-
8/10/2019 General Commands of Aix
13/17
!isplays the last &, lines =default? of a file*
Example:tail $tmp$phase2/out
top of page
tee
Used to preserve intermediate outputfrom within a pipeline to a file for later processing or review
Example:-ind / ,cpio $de%$-d0 ,print 9 tee $tmp$QAC>DK/L!@# list of the files backed up by the cpio command will be saved by the tee utility in a file named'tmp'B#CUP*/OG
top of page
telinit
Examples What it does
telinit U
-
8/10/2019 General Commands of Aix
14/17
Examples What it does
tr 6V6 640126 $tmp$!S=LE #$tmp$D;=T=LE
2eplace the tilde as a !E/"1"TE2 character in file !O$
-
8/10/2019 General Commands of Aix
15/17
command
SS$ubmodel number* #lways ,,
uname ,r% -rIrelease. -vIversion/ 2esults ) 6 =Dersion 6 2elease )?
uname ,S
3hostname3
$ince the system name can be set in two places =hostname and uname -$?.
%ust set them to the same string*
top of page
5
/ists summary of current user activity
top of page
5hat
!isplays header information about the source files re4uired to build the executable file yourreviewing. timestamps as to when the source files where compiled. their build level. and so on*
Example:5hat $unix
top of page
5hatis
!isplays a short description of the function a command performs
Example:5hatis %mstatOutputs: vmstat=&? - 2eports virtual memory statistics*
top of page
5hereis
$hows path location of the specified command
Example:5hereis motdOutputs: motd 'etc'motd
http://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#top -
8/10/2019 General Commands of Aix
16/17
top of page
5ho
!isplays information about all users currently on local system* @hen you log in. the login programwrites a record in the 'etc'utmp file* This record includes your user name. date. time of login. andthe login tty'pts device* The 5hocommand checks this file to find out which users are currentlylogged in. along with the hostname and display terminal they are logged under*
Examples What it does
5ho ,b !isplays date system was last booted system boot ;ov&8 &6(+
5ho ,r !isplays run-level of machine
5ho ,u !isplays information about users currently logged in*
The line activity field will E"T0E2 have***
a dot =*? if there has been activity on theterminal within the past minute O2
the number of hours'minutes since activity lastoccurred O2
is marked with 3old3 if the line has been 4uietfor more than )7 hours*
5ho ,a $usr$adm$5tmp !isplays the name. terminal. and date users loggedinto the system
5ho ,u $etc$securit&$-ailedlo.in !isplays the account. terminal and date that a failed
login was attempted*
$usr$lib$acct$-5tmp $usr$adm$5tmp# $tmp$ACCB/=;!
reates an #$"" version of the 'usr'adm'wtmp file thatcan be read by the system administrator
top o- pa.e
xar.s
onstructs an argument list and executes a command
Examples What it does
-ind $u$netinst ,print 9 xar.s chmod 00
-
8/10/2019 General Commands of Aix
17/17
top of page
http://www.ahinc.com/aix/general.htm#tophttp://www.ahinc.com/aix/general.htm#top