Sei sulla pagina 1di 8

AIX Command Reference AIX (Advanced Interactive eXecutive)

$ - the Dollar Prompt Basic Commands $ ls -l -al To list the files shows the permissions set for the file shows all hidden files with their respective permissions

$ pwd - Displays your current directory $ cd -> Change Directory $ oslevel Displays the version of the operating system $ whereis ( program name ) displays the path of the program Eg : $ whereis cron cron: /etc/cron /usr/sbin/cron /usr/lib/cron $ who -> displays the users logged into the system $ hostname shows the hostname of the system $ ifconfig a shows all the ipaddress associated with the system $ lsps a displays the paging space $ prtconf Displays the entire system information $ ps ef Displays the running process in the system $ mkdir (folder name ) Creates a new folder $ rmdir ( foldername ) Deletes a folder

Find Command
One of the commands that everyone should master is the find command. The first, and most obvious, use is find's ability to locate old, big, or unused files, or files that you forgot where they are $ find < directory to search > -name ( name of the file ) Eg : $ find / name racv.doc In the above example the system would search for any file named racv.doc on the root and all subdirectories from the root.

Vi Editor
vi is a family of screen-oriented text editors which share common characteristics, such as methods of invocation from the operating system command interpreter, and characteristic user interface features $ vi opens a new file in the editor $ vi < path><file name > opens the specific file for editing

The first thing most users learn about the VI editor is that it has two modes: command and insert. The command mode allows the entry of commands to manipulate text. These commands are usually one or two characters long, and can be entered with few keystrokes. The insert mode puts anything typed on the keyboard into the current file.

Once you are inside the editor use the following commands to edit

Inserting New Text


A Append at the end of the current line. I Insert from the beginning of a line. O (Letter oh) Enter insert mode in a new line above the current cursor position. a Enter insert mode, the characters typed in will be inserted after the current cursor position. A count inserts all the text that had been inserted that many times. i Enter insert mode, the characters typed in will be inserted before the current cursor position. A count inserts all the text that had been inserted that many times. o Enter insert mode in a new line below the current cursor position.

Cutting and Pasting/Deleting text


" Specify a buffer to be used any of the commands using buffers. Follow the " with a letter or a number, which corresponds to a buffer. D Delete to the end of the line from the current cursor position. P Paste the specified buffer before the current cursor position or line. If no buffer is specified (with the " command.) then 'P' uses the general buffer. X Delete the character before the cursor. Y Yank the current line into the specified buffer. If no buffer is specified, then the general buffer is used. d Delete until where. "dd" deletes the current line. A count deletes that many lines. Whatever is deleted is placed into the buffer specified with the " command. If no buffer is specified, then the general buffer is used. p Paste the specified buffer after the current cursor position or line. If no buffer is specified (with the " command.) then 'p' uses the general buffer. x Delete character under the cursor. A count tells how many characters to delete. The characters will be deleted after the cursor. y

Yank until , putting the result into a buffer. "yy" yanks the current line. a count yanks that many lines. The buffer can be specified with the command. If no buffer is specified, then the general buffer is used.

Moving the Cursor Within the File


^B Scroll backwards one page. A count scrolls that many pages. ^D Scroll forwards half a window. A count scrolls that many lines. ^F Scroll forwards one page. A count scrolls that many pages. ^H Move the cursor one space to the left. A count moves that many spaces. ^J Move the cursor down one line in the same column. A count moves that many lines down. ^M Move to the first character on the next line. ^N Move the cursor down one line in the same column. A count moves that many lines down. ^P Move the cursor up one line in the same column. A count moves that many lines up. ^U Scroll backwards half a window. A count scrolls that many lines. $ Move the cursor to the end of the current line. A count moves to the end of the following lines. % Move the cursor to the matching parenthesis or brace. ^ Move the cursor to the first non-whitespace character. ( Move the cursor to the beginning of a sentence. ) Move the cursor to the beginning of the next sentence. { Move the cursor to the preceding paragraph. } Move the cursor to the next paragraph. | Move the cursor to the column specified by the count.

b Move the cursor back one word. If the cursor is in the middle of a word, move the cursor to the first character of that word. e Move the cursor forward one word. If the cursor is in the middle of a word, move the cursor to the last character of that word. h Move the cursor to the left one character position. j Move the cursor down one line. k Move the cursor up one line. l Move the cursor to the right one character position. w Move the cursor forward one word. If the cursor is in the middle of a word, move the cursor to the first character of the next word.

Moving the Cursor Around the Screen


^E Scroll forwards one line. A count scrolls that many lines. ^Y Scroll backwards one line. A count scrolls that many lines. z Redraw the screen with the following options. "z<return>" puts the current line on the top of the screen; "z." puts the current line on the center of the screen; and "z-" puts the current line on the bottom of the screen. If you specify a count before the 'z' command, it changes the current line to the line specified. For example, "16z." puts line 16 on the center of the screen.

Replacing Text
C Change to the end of the line from the current cursor position. R Replace characters on the screen with a set of characters entered, ending with the Escape key. S Change an entire line. c Change until . "cc" changes the current line. A count changes that many lines. r

Replace one character under the cursor. Specify a count to replace a number of characters. s Substitute one character under the cursor, and go into insert mode. Specify a count to substitute a number of characters. A dollar sign ($) will be put at the last character to be substituted.

Searching for Text or Characters


, Repeat the last f, F, t or T command in the reverse direction. / Search the file downwards for the string specified after the /. n Repeat last search given by '/' or '?'. t Search the current line for the character specified after the 't' command, and move to the column before the character if it's found.

Saving and Quitting


Q Quit out of "VI" mode and go into "EX" mode. The ex editor is a line-by-line editor. The EX command to get back into VI is ":vi". ZZ or WQ Exit the editor, saving if any changes were made. Q! Quit without saving.

File Permissions:
Every user on a UNIX system has a unique username, and is a member of at least one group (the primary group for that user) Every directory and file on the system has an owner, and also an associated group. It also has a set of permission flags which specify separate read, write and execute permissions for the 'user' (owner), 'group', and 'other' (everyone else with an account on the computer) The 'ls' command shows the permissions and group associated with files when used with the -l option. On some systems (e.g. Coos), the '-g' option is also needed to see the group information An example of the output produced by 'ls -l' is shown below.
drwx------ 2 richard staff 2048 Jan 2 1997 private drwxrws--- 2 richard staff 2048 Jan 2 1997 admin -rw-rw---- 2 richard staff 12040 Aug 20 1996 admin/userinfo drwxr-xr-x 3 richard user 2048 May 13 09:27 public

Understanding how to read this output is useful to all unix users, but especially people using group access permissions. Field 1: a set of ten permission flags. Field 2: link count (don't worry about this) Field 3: owner of the file Field 4: associated group for the file Field 5: size in bytes Field 6-8: date of last modification (format varies, but always 3 fields) Field 9: name of file (possibly with path, depending on how ls was called TAR ARCHIVE tar -cvf (filename or device) ("files or directories to archive") eg tar -cvf /dev/rmt0 "/usr/*"

TAR RESTORE tar -tvf (filename or device)

Lists archive

tar -xvf (filename or device) Restore all tar -xvf (filename or device) ("files or directories to restore") use -p option for restoring with orginal permissions

eg tar -xvf /dev/rmt0 "tcpip" Restore directory and contents tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named file

JOB SCHEDULING $ crontab -l $ crontab -e $ crontab -l > (filename) $ crontab (filename) $ crontab -r $ crontab -v List out crontab entrys Edit crontab entrys Output crontab entrys to a file Enter a crontab from a file Removes all crontab entrys Displays crontab submission time. Schedule a job using at

at (now + 2 minutes, 13:05, etc) {return} Command or schell script {return} {CTRL D} at -l atq at -r (at job No) atrm (at job No)

Lists out jobs scheduled to run via at command Removes an at job scheduled to run.

Potrebbero piacerti anche