Você está na página 1de 10

What We Do Custom Development For the Web Maintenance Testimonials Development Concepts Usability Metatags Anti-Virus Anti-Spam Business

Accounting Backup EDGE Digital Signage Linux Scalix Shop OnLine Document Management Applications Business Info Hardware Info Microsoft Info Linux 101 AIX 101 OnLine Help Help Desk Blog Backup EDGE Eudora mySQL PowerTerm uniBasic Business Pro & Yes I Can Analyze Your Needs Software Ownership Password Creation Effective Presentations Buses Cables Chips DVD Memory Monitors Networks Power Protection RAID SCSI Versions & LIcenses About Office Windows XP Access Excel Word Contact Us What's New Horizon Newsletter Our Customers Employment

Set-up & Status General Commands Shell Commands Other Tips File Info Networking Printing Backup

General Commands
id - displays the system identity of the user lslicense - list maximum number of users last - information about previous logins 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 information about the source file whatis - displays a short description of a function basename - returns the base file name ac - displays connect time date - displays or sets the date timex - displays the elapsed time errclear - deletes entries in the error log errpt - generates an error report diag - performs hardware problem determination trace - kernel debugging find - finds files with matching expressions grep - searches a file for a pattern cmp - compares two files diff - compares text files head or tail - display start or end of file 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 change text nl - produces an OUTPUT file by inserting the line number captoinfo - converts termcap to terminfo nvdmetoa - convert EBCDIC files to ASCII sum - displays checksum for a file

at - schedules jobs batch - run 1 or more jobs in the background nice - execute a command at a lower priority tee - used to preserve output from a pipeline

login logout su - switch user lsitab - list contents of the /etc/inittab file rmitab - removes an entry from the /etc/inittab telinit - forces the init process to re-read the /etc/inittab

kill - stop a process stopsrc - gracefully shuts down all subsystems shutdown - shutdown system fastboot - restarts the system without running fsck fasthalt - halts the system strip - removes symbol table top of page

xargs - constructs an argument list

ac

Displays connect time totals for users Example: ac root Outputs: total 52.80 seconds top of page

at
Schedules jobs to run at a later date Examples What it does

At 5:00 p.m., message CALL HOME is written to terminal tty0 1) at 17:00 2) banner CALL HOME > /dev/tty0 3) ^D 1) at 18:00 2) make -f /u/roger/makefile 3) ^D at -l Compiles files specified in /u/roger/makefile. Results of this compilation are sent to user's mailbox who initiated the 'at' request.

List jobs in at queue. root.686858340.a Mon Oct 07 12:59:00 1991

at -r root.686858340.a Removes a job from at queue. at file: root.686858340.a deleted top of page

basename
Returns the base file name of a string Example: echo `basename \`pwd\`` Returns the name of the current directory your in. Does not show the full pathname of that directory. top of page

batch
Run 1 or more jobs in the background. All output will be sent to the mail system. Jobs submitted are started immediately. Example: batch job1 job2 ^D Note: Once a batch job starts, it's job number can't be seen via the at -l because that job is no longer in the batch queue - it's a running process. Further, once a batch job is running, it can't be canceled by the at -r <job #> command since this only cancels jobs that are still pending in the batch/at queue. top of page

captoinfo
Converts a termcap source file to a terminfo source file Example: captoinfo Wyse150.tc > wyse150.ti Once the termcap file (*.tc) has been translated to a terminfo (*.ti) file, compile the .ti file with the tic compiler (tic wyse150.ti). top of page

cmp
Compares two files for differences

Compares two files for differences Example: cmp test1 test2 If the files are identical, no message is displayed, else the first difference is displayed. top of page

cut
Cuts out selected text from a file or environment variable Examples echo `date|cut -d' ' -f2` cat /etc/passwd|cut -d: -f1,3 Will output the 1st and 3rd field delimited by ':' from the /etc/passwd file: root:0 daemon:1 bin:2 lpd:104 What it does Oct (returns the month from the date command )

top of page

date
Displays or sets the date/time. Date format is: mmddHHMM.SSyy Example: date 02030830.0054 (This sets the date/time to Feb 03 08:30:00 CST 1954) top of page

iag
Performs hardware problem determination FORMAT & CERTIFY: Writes all of the ID fields and writes a bit pattern in all of the data fields. Also reassigns data blocks that are BAD during formatting. If too many BAD BLOCKS, a message is sent to alert operator. If data resides on the PV being formatted, it will be removed - lost forever. CERTIFY DISK Reads all ID and data fields. Checks for BAD DATA in the ID and data fields. If too many BAD BLOCKS, a message is sent to the alert operator that it's time to get another disk drive before this one fails. NOTE: The software defect map is written at block of the PV device. This map is 22 blocks in size (AIX 3.1 version) and has enough space to hold about 1400 defects. Hardware relocations are performed only on WRITE operations where a READ request will return an I/O error back to the requesting application. top of page

diff
Compares text files for differences Example: diff -wi filea fileb -w ignores all spaces and tab characters -i case insensitive top of page

errclear
Deletes entries in the error log Example: errclear 0 (Truncates the errlog to 0 bytes) top of page

errpt
Generates an error report from entries in the error log

Examples errpt -a|pg errpt -aN hdisk1

What it does Produces a detailed report for each entry in the error log Displays an error log for ALL errors occurred on this drive. If more than a few errors occur within a 24 hour period, execute the CERTIFY process under DIAGNOSTICS to determine if a PV is becoming marginal. Use this script to DETERMINE or JUSTIFY hard file REPLACEMENT. A message will be displayed on the CONSOLE device if a THRESHOLD value has been reached in regards to the number of hard file errors logged by the errpt utility. The following message may be seen: HDISKx : ERROR LOG ANALYSIS INDICATES A HARDWARE FAILURE. (x represents the hdisk number)

/etc/lpp/disagnostics/bin/run_ela

top of page

fastboot
Restarts the system without checking the file systems with the fsck command top of page

fasthalt
Halts the system top of page

find
Finds files with matching expressions. Note: If the following error message is generated find: 0652-081 cannot change directory to </transfer/printers>: file access permissions do not allow the specified action. This means that the user you are currently logged in as (even root) doesn't have the authority to READ that directory. Examples find / -name jan92.rpt -print find / -size +1000k -exec ls -l {} \; -print find / -size 0 -print What it does Search all file systems for any file named jan92.rpt Searches all file systems to report back those files larger than 1MB in size Find all files of ZERO length

find / -type f -exec grep bananas Searches all plain files to determine if the string 'bananas' is contained within it {} \; -print find /usr/lpp/FINANCIALS -print | Changes the ownership of all files under /usr/lpp/FINANACIALS to be owned by user roger and have a group ownership of staff. xargs chown roger.staff find / -user roger -print find / -nouser -print find / -group staff -print find / -nogroup staff -print find . -perm 600 -print | xargs chmod 666 find / -mtime +100 -print find . -mtime 0 -print Find all files owned by user roger Displays all unowned files in the system Find all files owned by group staff List all files that belong to a non-existent group not found in /etc/group Find all the files that have READ/WRITE permissions set for the owner of a file and change those permissions to READ/WRITE for everybody. Search all file systems for files that have not be modified in over 100 days. List all files in the current directory that have changed during the current 24 hour period.

find / -name /transfer -prune -o - List the name of all files from the / (root) directory except for the NFS file system named /transfer print find . -name PERSONAL -prune - List the name of all files in or below the current directory, except the directory named PERSONAL or files in that directory. o -print find / -fstype nfs -print find . -newer disk.log -print List the name of all the files that reside in an NFS file system Display all files that have been modified more recently than the file named

g p

p y disk.log

top of page

grep
Searches a file for a pattern. Grep stands for Global Regular Expression Printer Examples grep -i WhereIs * lsdev -C|grep lp grep [0-9][A-Z] *.doc grep [^0-5][A-Z] *.doc grep "^IBM" *.doc grep "IBM$" *.doc grep "^IBM is GREAT$" *.doc grep -v "^ *$" testfile > goodfile top of page What it does Search all files in current directory to determine if the string 'WhereIs' is contained within it. The -i option ignores the case of letters (WhereIs is same as whereis) List all configured printers List any file that has a .doc suffix that contains a number (0-9) followed by a capital letter (A-Z). List any file that has a .doc suffix that contains any number except 0 to 5 and is followed by a capital letter (A-Z) Displays lines that BEGIN with the word IBM Displays lines that END with the word IBM Displays only those lines that consist of the phrase 'IBM IS GREAT' Removes all the blank lines from the source file 'testfile' and redirects the output to a new file named 'goodfile'.

head
Displays the first 10 lines (default) of a file. Example: head -25 /tmp/phase2.out (Displays the first 25 lines of the file /tmp/phase2.out.) top of page

id
Displays the system identity of the user Examples id id -ru top of page uid=0(root) gid=0(system) Displays the UID of the current login process 0 What it does

last
Display information about previous logins stored in the /usr/adm/wtmp accounting file Examples last reboot|head -5 last roger last tty0 top of page What it does List last 5 times systems has been rebooted Display times user roger has logged in/out of the system Display times users have logged in/out of port tty0

login
Initiates a new user session. Example: login -h rs6000 root Login to the root account on a machine whose hostname is rs6000 top of page

logout

logout
Terminates all processes on the port your logged in on, including your login shell. Note: exit will perform the same action as logout. Example: logout (Logs you off the system. Login prompt will reappear.) top of page

lsitab
List contents of the /etc/inittab file Example: lsitab -a top of page

lslicense
List maximum number of users that can be concurrently logged in Example: lslicense Outputs: Maximum number of concurrent users: >32 top of page

kill
Sends a signal to stop or suspend a process from running Example: kill -l (Lists 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 of each line Example: nl /etc/passwd > /tmp/user.list top of page

nice
Execute a command at a lower priority. Super-user may run commands with a higher priority by using a negative number. Higher numbers mean lower priorities (base priority is 10) Examples nice -n 15 make nice -10 /usr/bin/mview top of page What it does Run the 'make' command at the low priority of 15 Run the 'mview' application at a high priority of 10

nvdmetoa
Convert EBCDIC files to ASCII Examples nvdmetoa <AS400.dat >AIXver3.dat What it does Converts an EBCDIC file taken off an AS400 and converts to an ASCII file for the RS/6000

Converts an EBCDIC file with a record length of 132 characters to an ASCII file with 132 nvdmetoa 132 <AS400.txt >AIXver3.txt bytes per line PLUS 1 byte for the linefeed character. top of page

od

Dumps the contents of a file in the requested format (ASCII,octal, hex, or extended character set) Examples od -c /tmp/rc.net.out 1) od -cd 2) \<FUNCTION KEY> 3) \<SHIFT><FUNCTION KEY> 4) \<ALT><FUNCTION KEY> top of page What it does -c displays bytes as ascii characters By typing in this command, one may check the control codes being generated by function keys. From the command line, you press the '\' (backslash) character, then press a function key which results in the escape sequence for that key to be displayed.

rmitab
Removes an entry from the /etc/inittab file Example: rmitab ice (Removes the ice stanza from the /etc/inittab file) top of page

sed
Stream edit command to change text. Examples cat /tmp/mytest | sed -e "s/reports/report/" > /tmp/mytest sed -e 's/ *$//' < SOURCE_FILE > DESTINATION_FILE sed '/total/d' /tmp/report > /tmp/report1 sed '/^$/d' /tmp/report > /tmp/report1 sed 's/[ ]//g' /ibm/report > /tmp/report top of page What it does All instances of the string "reports" is replaced with the string "report" for the file named /tmp/mytest Removes trailing blanks, not internal blanks, from each line in a file Delete all lines that contains the word total Delete all blank lines from file Delete all tabs from file

shutdown
Shutdown system operations Examples shutdown +0 shutdown -Fr shutdown -Fm Shuts down a system immediately. Shuts down the system cleanly, followed by rebooting the system. Shuts down the system into maintenance mode. When using the 'm' option, make sure you are at the console, because thats where control will be returned to. What it does

top of page

split
Makes smaller files from a large one. Each of the new files can be up to a specified number of lines long. The smaller files are each named with the input filename or a specified name, followed by an 'x' and an increasing two letter sequence (xaa, xab, etc). top of page

stopsrc
Example: stopsrc -a Gracefully shuts down all subsystems controlled by the SRC - System Resource Controller. top of page

strip
Removes symbol table and other Extended Common Object File Format (XCOFF) data from an executable image.

Example: strip /usr/bin/uniplex Reduces the storage overhead required by an executable file. This translates to less real memory usage required to have program run. top of page

su
Runs a sub-shell with the effective user ID of the username passed in as a parameter to this command (root if no parameter is passed). Type in 'exit', or 'logout' to return to previous user's session. Examples su roger su - root What it does Sets up environment as if you had logged in as user roger WITHOUT executing /etc/environment, $HOME/.profile or changing directories to $HOME for user roger. Initializes the user environment from attributes set in the /etc/security/user database and /etc/environment file, followed by executing the $HOME/.profile and changing directories to $HOME. Basically sets up the environment as if you had logged in as root.

top of page

sum
Displays a checksum for a file. Often used to validate if a file has been corrupted by comparing the suspect file's checksum to that of a known good file. Used to verify if a file has been corrupted or a file transfer was sent/received properly. Example: sum /unix Outputs: 13042 1253 /unix top of page

tail
Displays the last 10 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: find . -cpio /dev/fd0 -print | tee /tmp/BACKUP.LOG A list of the files backed up by the cpio command will be saved by the tee utility in a file named /tmp/BACKUP.LOG top of page

telinit
Examples telinit q telinit 1 top of page What it does Forces the init process to re-read the /etc/inittab Brings the operating system into maintenance (single-user) mode. Same as typing in init 1

timex
Displays the elapsed time it took for a command to execute. Real time is amount of time user waited for the process to execute. CPU time is amount of time that the process actually used the cpu. Example: timex find /tmp -print|backup -ivqf/dev/null top of page

tr

tr
Translates characters in a file. Handy for translating files from uppercase (DOS files) to lowercase (UNIX files). Examples tr '~' '\012' </tmp/DOSFILE > /tmp/UNIXFILE tr -d '\15' < file1 > file2 top of page What it does Replace the tilde as a DELIMITER character in file DOSFILE with a NEWLINE character in file UNIXFILE. Remove CR from file1 and creates a new file named file2

trace
Kernel debugging to trace the events associated with the device your are monitoring. Examples traceon traceoff top of page turns trace on turns trace off What it does

type
Shows path location of the specified command Example: type basename Outputs: basename is /usr/bin/basename top of page

uname
Displays attributes relating to hardware/software. Examples uname -a uname -m XXYYYYYYMMSS (machine ID) where... XX=Feature of operating system. Always 00 YYYYYY=CPU ID. Value stored in ROM on processor board MM=Model number. Set to 7th & 8th digits returned by lscfg -v command SS=Submodel number. Always 00 uname -rv uname -S `hostname` top of page -r=release, -v=version. Results: 2 3 (Version 3 Release 2) Since the system name can be set in two places (hostname and uname -S), just set them to the same string. What it does Displays system name, operating system version, LAN network number, type of hardware running and so on.

w
Lists summary of current user activity top of page

what
Displays header information about the source files required to build the executable file your reviewing, timestamps as to when the source files where compiled, their build level, and so on. Example: what /unix top of page

whatis

whatis
Displays a short description of the function a command performs Example: whatis vmstat Outputs: vmstat(1) - Reports virtual memory statistics. top of page

whereis
Shows path location of the specified command Example: whereis motd Outputs: motd: /etc/motd top of page

who
Displays information about all users currently on local system. When you log in, the login program writes a record in the /etc/utmp file. This record includes your user name, date, time of login, and the login tty/pts device. The who command checks this file to find out which users are currently logged in, along with the hostname and display terminal they are logged under. Examples who -b who -r who -u Displays information about users currently logged in. The line activity field will EITHER have... a dot (.) if there has been activity on the terminal within the past minute OR the number of hours/minutes since activity last occurred OR is marked with 'old' if the line has been quiet for more than 24 hours. who -a /usr/adm/wtmp who -u /etc/security/failedlogin Displays the name, terminal, and date users logged into the system Displays the account, terminal and date that a failed login was attempted. Creates an ASCII version of the /usr/adm/wtmp file that can be read by the system administrator What it does Displays date system was last booted system boot Nov 17 13:58 Displays run-level of machine

/usr/lib/acct/fwtmp < /usr/adm/wtmp > /tmp/ACCT.INFO top of page

xargs
Constructs an argument list and executes a command Examples find /u/netinst -print | xargs chmod 500 find /u/netinst -print | xargs chown netinst find /u/netinst -print | xargs chgrp staff top of page What it does Files under /u/netinst will have permissions changed to 500 Files under /u/netinst will have ownership changed to netinst Files under /u/netinst will have group changed to staff

Services | Products | Support | About Us | Privacy Policy | Legal Stuff

Email us at Info@AHinc.com Advanced Horizons, Inc. All Rights Reserved

Você também pode gostar