Posts Tagged ‘AIX’

Finding password rules in AIX

Posted: February 4, 2016 in HowTo
Tags: , , ,

In AIX 5.2, following file holds the password configuration

/etc/security/user
Advertisements

How to setup an user in AIX

Posted: November 30, 2015 in HowTo
Tags: , , ,

Follow the below steps to create a user in AIX and assign to a group.

Step 1: Create a user

mkuser user-name

 
Step 2: Create a group

mkgroup group-name

 
Step 3: Create a home directory

mkdir /home/users/user-name

 
Step 4: Provide permissions to home directory

chown user-name:group-name /home/users/user-name

 
Step 5: Assign home directory to user

chuser home=/home/users/user-name user-name

 
Step 6: Add user to the group

chuser group=group-name user-name

Getting list users and groups in AIX

Posted: August 31, 2015 in HowTo
Tags: , , ,

Run the following command to get the list of users and associated groups in AIX environment

$ lsuser ALL

Run the following command to check if port is in use

# netstat -an | grep <port number>

If above returns the connection, then run the following command to get the address of the port number

# netstat -Aan | grep <port number>

Once you have the address of the port number, run the following command to get the process id that is using the port.

# rmsock <address of port number> tcpcb

Example

# netstat -an | grep 30767
tcp4       0      0  *.30767                *.*                    LISTEN
# netstat -Aan | grep 30767
f100060001b2f398 tcp4       0      0  *.30767            *.*                LISTEN
# rmsock f100060001b2f398 tcpcb
The socket 0x1b2f008 is being held by proccess 942150 (vcs_agent).

Finding Files in IBM AIX

Posted: September 14, 2012 in HowTo
Tags: , ,

General syntax of “find” command

$ find <where> <condition> <action>

To get all files/directories in the current and sub directories

$ find .

To get all files/directories in the current and sub directories that were modified 5 (5*24 hours, to be precise) or fewer days ago

$ find . -mtime -5

To get all files/directories in the current and sub directories that were modified 10 or more days ago

$ find . -mtime +10

To get all files/directories in the current and sub directories that were modified exactly 15 days ago

$ find . -mtime 15

To delete all files/directories in the current and sub directories that were modified 30 or more days ago

$ find . -mtime 30 -exec rm -r {} \;

To delete all files in the current and sub directories that were modified 30 or more days ago

$ find . -mtime 30 -type f -exec rm -r {} \;

To delete all files with extension ‘log’ in the current and sub directories that were modified 30 or more days ago

$ find *.log -mtime 30 -type f -exec rm -r {} \;

 

 

Finding Memory Usage in IBM AIX

Posted: September 14, 2012 in HowTo
Tags: , ,

Run the following command to get the memory usage in AIX

$ svmon -G

Finding Directory Size in IBM AIX

Posted: September 14, 2012 in HowTo
Tags: , ,

Run the following command to get directory size in KB

$ du -sk <directory>