Sunteți pe pagina 1din 6

AIX

General Information
AIX is IBM's version of the UNIX operating system. AIX is the native operating system on the RISC System/6000 server and on the IBM RISC Model 220 workstations. AIX is a casesensitive operating system, therefore the computer differentiates between upper and lower case letters.

Getting Started
Before you can use AIX, you must first login to one of the Putty sessions. A putty machine should have a prompt saying Host Name (or IP address), after that it will prompts for login: on the screen. At this prompt, enter your userid. AIX will then ask for your password. Enter this into the computer, and if entered correctly, you will be logged onto the Putty terminal. AIX will then display your OS prompt and wait for your command. The OS prompt displayed depends on which command interpreter (shell) you are running and any configurations installed. The default is the K-shell which uses a $ as its OS prompt.

Using AIX Commands


AIX allows the use of several different shells. The main shells supported on the system are the Korn shell, the Bourne shell, and the C shell. The basic command interpretation is standard among these shells. However, each shell handles certain commands in a unique way. Therefore, the syntax section of the command will specify which shell syntax is being represented when differences occur. For example, {K} represents the Korn shell and {C} represents the C shell.

Basic Commands
1) Basic UNIX commands for every day work change directory go up one dir present working directory (i.e. shows current directory) list files in dir list all files with details editor list file to screen page by page manual pages for command (i.e. help) list commands (usually held in /usr/bin) To view all pages containing the specified keyword (for example delete) To view all the options for rm command (or any other command) Copies all files in existing directory to a new directory at same level as existing one Copies all files in existing directory to a new directory at any level moves all files in existing directory to a new directory at same level as existing one moves all files in existing directory to a new directory at any level removes all files in existing directory cd <dir> cd .. pwd ls ls -la vi <file> more <file> man <cmd> ls /usr/bin man k <keyword> man rm cp * ../<new dir> cp * <file path> mv * ../<new dir> mv * <file path> rm *

rm <file name> Escape <enter> k Ctrl + c mkdir <folder name> rmdir <folder name> exit which <command> crontab l ps -ef fuser <filename> chmod 777 chmod g+w

removes the specified file in existing directory Retrieves previous commands entered Exits Creates new directory folder at the next lower level from your current position Removes folder from next level down exit shell (to logout: repeat until all shells exited)

says where the command is picked up from lists what is in the cron table, first two numbers are minutes, hours. list processes list processes accessing a file sets read, write, execute permission for owner, group, world sets write permission for other users in the same group.

2) vi commands
Basic quit out (wont quit if changes have been made since last saved) quit out without saving changes write (i.e. save) file write (i.e. save) file and quit out repeat last command undo last command restore whole line escape to command mode (required after all inserts) Moving cursor left cursor down cursor up cursor right go to start of line go to end of line forwards one word backwards one word go to line 12 go to last line in file show current line number Inserting (end all inserts with escape) insert before cursor insert at start of line add after cursor add at end of line open line below for insert

:q :q! :w :wq . u U esc h j k l 0 $ w b 12G G control g i I a A o

O x X dw dd 5dd D cc 7cc C cw r R J 4Y 4dd 4P ma mb :'a,'b t. :'a,'b m. /<string> ?<string> n :%s/<aaa>/<bbb> :%s/<aaa>/<bbb>/g :73,89 s/<aaa>/<bbb>/ :.,.+16 s/<aaa>/<bbb>/ : g/<aaa>/s//<bbb>/c mk<enter> ay'k<enter>) ap<enter> ad'k<enter> d'k % :r <filename> :r !ls

open line above for insert Deleting delete current character delete previous character delete word delete line delete 5 lines delete to end of line Changing change one line change 7 lines change to end of line change word replace one character replace many characters (end with escape) join line below to current line Yank & Paste yanks 4 lines and puts in paste buffer delete 4 lines and puts in paste buffer paste 4 lines mark a line and call it a mark a line and call it b from line a to line b transfer (copies) to after current line from line a to line b move (deletes original) to after current line Searching search forwards for <string> search backwards for <string> search for next occurrence of <string> in current direction Substitution substitute 1st occurrence on each line of <aaa> for <bbb> subs all occurrences subs 1st occurrence in lines 73 to 89 subs 1st occurrence in next 16 lines (. = here) globally search for <aaa> subs with <bbb> if confirmed (y = subs, n or anything else = don't subs) Buffers mark a line and call it k into buffer a yank from k ( says the next symbol is a buffer name buffer a paste into buffer a delete from k delete from line marked k other find matching bracket reads a file and inserts after current line gets dir listing and writes after current line

:n ^ $ * . [abc] [^abc]

next file (if entered vi with e.g. vi *.a) search and subs special characters beginning of line end of line any number of preceding character any character any of a or b or c any character except a or b or c back up a screen forwards a screen down a line up a line search forwards for <string> search backwards for <string> go to next occurrence of search string (in current direction) go to last line go into vi editor

3) More Navigation
b f j k /<string> ?<string> n G v

4) Some other Handy commands ls :- This is one of the most useful AIX commands. It is used to display the contents of a
directory. There are many combinations of options with the ls command. Syntax: ls -l -rw-r--r-- 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz ^^ ^ ^ ^ ^ ^ ^ ^ ^ ^ || | | | | | | | | | || | | | owner group size date time name || | | number of links to file or directory contents | | | permissions for world | | permissions for members of group | permissions for owner of file: r = read, w = write, x = execute -=no permission type of file: - = normal file, d=directory, l = symbolic link, and others... touch:- This command can be used to update the last access and modification times of the specified files or directories. The -a option will change the access times and the -m option will alter the modification time. Specifying -c will prevent touch from creating the file if it doesn't exist. The -f option will attempt to change the times regardless of the write permissions of the files. You can set the time to that of another file by specifying the -r option or you can set the time manually by specifying it with the -t option. The time should be entered in the order year, month, date, hours, and minutes. Syntax: touch [-a] [-c] [-f] [-m] [-r file][-t YYMMDDhhmm] {files | directories} who:- This command displays a list of the users currently logged into the system. The -m option can be specified to display information about the current user. This is the same as

typing the am i option. The -H option will place a header on the output. The -w option will display a plus for those users whose terminal allows writes by other users, and a dash for those who do not allow writes. Syntax: who [-m] [-w] [am i]

File compression and Archiving:Compressed files use less disk space and download faster than large, uncompressed files. You can compress Linux files with the open-source compression tool Gzip or Zip, which is recognized by most operating systems. By convention, compressed files are given the extension .gz. The command Gzip creates a compressed file ending with .gz; Gunzip extracts the compressed files and removes the .gz file. To compress a file, at a shell prompt, type the following command: gzip filename.ext The file will be compressed and saved as filename.ext.gz. To expand a compressed file, type: gunzip filename.ext.gz The filename.ext.gz is deleted and replaced with filename.ext. If you exchange files with non-Linux users, you may want to use zip to avoid compatibility problems. Linux can easily open zip or gzip files, but non-Linux operating systems may have problems with gzip files. To compress a file with zip, type the following: zip -r filename.zip files In this example, filename represents the file you are creating and files represents the files you want to put in the new file: To extract the contents of a zip file, type: unzip filename.zip You can zip or gzip multiple files at the same time. List the files with a space between each one. gzip filename.gz file1 file2 file3 /user/work/school The above command will compress file1, file2, file3, and the contents of the /user/work/school directory and put them in filename.gz. Archiving with TAR:

Tar files place several files or the contents of a directory or directories in one file. This is a good way to create backups and archives. Usually, tar files end with the .tar extension. tar -cvf filename.tar files/directories In this example, filename.tar represents the file you are creating and files/directories represents the files or directories you want to put in the new file.

S-ar putea să vă placă și