Useful stuff for Solaris
Adding a user:
useradd -d /path/to/home -m -s /path/to/shell -c “First Last” username
-m = make home directory and copy skeleton files
Removing a user:
userdel -r username
-r = remove the home directory
Show user’s group membership:
groups username
Change user’s group membership:
usermod -G group1,group2,group3 username
Customize the command prompt:
PS1=”`whoami`@`hostname`#”
PS1=”[\u@\h \w]#”
\! History number of current command
\# Command number of current command
\d Current date
\h Host name
\n Newline
\s Shell name
\t Current time
\u User name
\W Current working directory
\w Current working directory (full path)
Disk Management:
Slice = a contiguous range of blocks
8 slices per disk (generally)
1 file system per slice
File system cannot span multiple slices (without a LVM)
Slice cannot span multiple disks
Moving files with CPIO:
find . -depth | cpio -p -d -m -v /path/to/dest
See what process is preventing a umount
fuser -u /dev/dsk/c0t2d0s7
What is /var/adm/pacct:
pacct = process accounting file
ckpacct checks the size of the pacct file. If it exceeds 500 blocks (default)
accounting will be turned off
turnacct turns accounting on/off. Use switch arg to move the current pacct file to
/var/adm/pacct[filenum]
calling ckpacct will also rotate the pacct file
Privilege debugging in solaris 10:
ppriv -e -D original_command (shows what privileges the user is missing in order to run the command)
Leave a Reply