To kill all processes of a specific user, enter:
# ps -u [user-id] -o pid | grep -v PID | xargs kill -9
Another way is to use
who to check out your current users and their terminals. Kill all processes related to a specific terminal:
# fuser -k /dev/pts[#]
Yet another method: Su to the user-id you wish to kill all processes of and enter:
# su - [user-id] -c kill -9 -1
To discover the amount of paging space a proces is using, type:
# svmon -wP [proces-id]
Svmon shows you the amount of memory in 4KB blocks.
Use the following command to interactively find and remove core dumps on your system:
# find / -name core -exec file {} \; -exec rm -i {} \;
How to do an automatic FTP from within a script:
- -n prevents automatic login and -v puts it in verbose mode
- asciorbin_Type should be set to either ascii or binary
- grep for $PHRASE (particular return code) from $LOGFILE to determine success or failure
ftp -nv $REMOTE_MACHINE < $LOGFILE
user $USER_NAME $USER_PASSWORD
$asciorbin_Type
cd $REMOTE_PATH
put $LOCAL_FILE $REMOTE_FILE
quit
!
grep $PHRASE $LOGFILE
When you change MAXUPROC (Maximum number of processes allowed per user), the smitty help panel will tell you that changes to this operating system parameter will take effect after the next system reboot.
This is wrong Help information. The change takes effect immediately, if MAXUPROC is increased. If it is decreased, then it will take effect after the next system reboot.
This help panel text from smitty will be changed in AIX 5.3. APAR IY52397.
Let's say you have a helpdesk, where they must be able to run a script under user-id root to check or monitor a system:
First, create a script, you wish your helpdesk to run.
Modify your /etc/inetd.conf file and add:
check stream tcp wait root /usr/local/bin/script.sh
Where
script.sh is the script you've written.
Modify your
/etc/services file and add:
check 4321/tcp
You may change the portnumber to anything you like, as long as it's not in use.
Now, you may run:
# telnet [system] 4321
And your script will be magically run and it's output displayed on your screen. If the output of the script isn't displayed on your screen very long, just put a
sleep command at the end of your script.
Defunct processes are commonly known as "zombies". You can't "kill" a zombie as it is already dead. Zombies are created when a process (typically a child process) terminates either abnormally or normally and it's spawning
process (typically a parent process) does not "wait" for it (or has yet to "wait" for it) to return an exit status.
It should be noted that zombies DO NOT consume any system resources (except a process slot in the process table). They are there to stay until the server is rebooted.
Zombies commonly occur on programs that were (incompletely) ported from old BSD systems to modern SysV systems, because the semantics of signals and/or waiting is different between these two OS families.
See: http://www.hyperdictionary.com/dictionary/zombie+process
Adding a DVD-ROM with DLpar is very easy. Removing however, can be somewhat more difficult, especially when you've run cfgmgr and devices have been configured. This is how to remove it. Remove all cdrom devices found with lsdev -Cc cdrom:
# rmdev -dl cd0
# rmdev -dl ide0
Then remove all devices found with:
# lsdev -C | grep pci
All PCI devices still in use, can't be removed. The one not in use, is the PCI device where the DVD-ROM drive on was configured. You have to remove it before you can do a DLPAR remove operation on it. Now do your DLPAR remove operation.
To display line numbers in VI: Press ESC, then type
:set number
To remove the line numbers again, type
:set nonumber
How do you send an attachment via e-mail from AIX to Windows? Uuencode is the answer:
# uuencode [source-file] [filename].b64 | mail -v -s "subject" [email-address]
For example:
# uuencode /etc/motd motd.b64 | mail -v -s "Message of the day" email@hostname.com
The
.b64 extension gets recognized by
Winzip. When you receive your email in Outlook, you will have an attachment, which can be opened by Winzip (or any other unzip tool).
You can combine this into a one-liner:
# ( echo "This is the body";uuencode /etc/motd motd.b64 ) | mail -s "This is the subject" email@hostname.com
If you want to attach tar of gzip images to an e-mail, you can also simply use those extensions to send through email, as these extensions are also properly recognized by Winzip:
# uuencode file.tar file.tar | mailx -s "subject" email@hostname.com
# uuencode file.tar.gz file.tar.gz | mailx -s "subject"
email@hostname.com
Number of results found: 469.
Displaying results: 321 - 330.