A Tutorial for AIX on Unixby Leena Kudalkar
AIX is IBM's flavor of the Unix Operating System. It runs on IBM's RISC processors and integrates AT&T's System V UNIX with enhancements from BSD (Berkley Standard Distribution) Unix.
Log on as a user and change your password.
On the operating system (OS) prompt, which is "%" for C shell, type the following command:
This will prompt you for the old password (given by your system administrator), new password and reconfirmation of your new password.
Now your AIX session has begun, and you are in the shell. You can type commands on the shell prompt: "%."
Note: "kpasswd" is for AIX's Kerberos Security System and corresponds to the standard UNIX command "passwd."
Execute the following command at the shell (OS) prompt:
% ls -al
It should show the current directory listing on the screen. Commands are either system programs or built-in shell functions. AIX is case-sensitive. Basic shell command syntax looks like this:
% command [ argument1 argument2 argument3 .... ]
Arguments (parameters) are inputs directing the behavior of the command in the form of options, keywords, file names, sizes, etc. Options are indicated with a "-" (dash) sign preceding the option letter. Multiple options can be combined on a single "-" sign.
Run the ls command again, with the two options given separately this time:
%ls -a -l
The output should be exactly the same as when the two options were combined.
'-l' tells ls to output a detailed list for files and directories and '-a' indicates that all files, including the hidden files, should be displayed.
Run the "man" command with a command name as an argument to learn about that command.
"% man grep" will provide a manual page for the "grep" utility explaining each optional argument.
Use the "more" utility program to prevent output from scrolling off the screen:
% ls -al | more
Here, the output of 'ls' is sent to a "pipe" through the "|" sign, through which it is redirected as input to the "more" utility. "More" breaks it into pages and displays one page at a time.
Press any key to see the next page of output.
% man ls | more
Run "cat" to display the contents of a file:
% cat <filename> [ | more ]
Execute "tail" to display the last few lines of a file. Type:
% tail <filename> -<n - number of lines>
where n indicates last n lines. If -n is omitted, it will display the last 10 lines.
Observe the output of "ls -al | more." You will find some files beginning with a "." All files whose names begin with a dot are hidden. Simply running "ls" will not show them. These are the .login, .profile and .cshrc (for C shell) files. The .login file holds operating system-specific information for the user. Among other things, it specifies terminal characteristics, your search path, mappings of actions to keystrokes and other environment variable settings. An example:
set path = (/usr/ucb /bin /usr/bin /etc /usr/local . )
This will set your environment variable "path" to the above each time you log in.
Run the following:
% cat .login | more
% cat .cshrc | more
The .cshrc is executed every time you enter the C shell. Your chosen default shell is also specified at login.
Working with Files and Directory
Execute the following file operations:
% cp [<path1>/]file1 [<path2>/]file2 # to copy a file as another
% mv [<path1>/]file1 [<path2>/]file2 # to rename a file
% mv file1, file2, file3 ... <destination directory> # to move one or more files as another
% rm <filename> # to delete a file permanently
% pg <filename> # to display contents of a file page by page. Press any key to read the
# next page.
The "pg" (page) program gives the effect of "cat <filename> | more." Words following a "#" on a line are treated as comments and not executed. Run the man command on each of the commands above to learn about the various combinations of optional arguments.
Run "pwd" to print a working directory.
The output can look like this:
At login, you are in the home directory, which is defined by setting the environment variable "HOME." It holds all your hidden startup files that set up your environment.
Create a new subdirectory:
% mkdir ./workfiles
% mkdir ./mysource
% mkdir workfiles/lib
A "." in the path indicates the current directory. A relative path looks like this:
It says go up one level for each "../" in the code. Here, go up two directory levels and to the bin subdirectory at that level.
Change your directory:
% cd ./workspace/lib
Remove subdirectory mysource using "rmdir." Type:
% rmdir ./mysource or % rmdir mysource or % rmdir %HOME%/mysource
Change the mode (access permission) of a file or directory. Type:
% chmod < user/group/all/others - for whom > < +/- grant / remove > <r w x - access type> <file or directory name>
The u = user, g = group, a = all, o = others.
% chmod g+rw myfile (grant read/write access for myfile to the entire group to which this user belongs).
% chmod o-x legacypgm (remove execute access to legacyprogram from others who are not in this user's group).
- check Find out about these important directories: /, /u, /bin , /usr/bin, /usr/local, /etc, /tmp, /dev.
- check Learn about these utilities via the "man" program: grep, sort, uniq, diff, mail.
- check Learn how to redirect output of a process to a file: % man sort > ./mydocs/sortmanpage
- check Each command is a process. A pipe, or "|," takes input of one AIX process and feeds it as input to the next.
- photo_camera monitor broken image by Nicemonkey from Fotolia.com