Articles in SysAdmin
awk/nawk [options] file scan for patterns in a file and process the results
cat [options] file concatenate (list) a file
cd [directory] change directory
chgrp [options] group file change the group of the file
chmod [options] file change file …
to move /opt on new partition (disk or file system)
1) from system prompt: format –> partition –> label
2) newfs -v /dev/dsk/c0t1d0s1 (target location)
3) mkdir /new_dir
4) mount /dev/dsk/c0t1d0s1 /new_dir
5) cd /new_dir
6) ufsdump 0f – /opt | …
In this example we use the tar command to copy the contents of the /export/home directory to /temphome. This particular syntax forgoes the creation of an actual tarball file. This can be useful if you …
Here’s the correct way to page four commands so they’re all controlled by “more”:
?View Code BASH(date; netstat -i; whodo; ps -ef) | more
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit …
?View Code BASHcd to start point (is acceptable) and as super user run: ls -ailR | sort -rn +5 | more
Sample output under SuSE Linux:
?View Code BASHdeathstar:/opt # ls -ailR | sort -rn +5 | …
Instructions for adding swap space on the fly for a Solaris system. Adding swap space via a swap file degrades system perfomance. However, this is a useful method for quickly adding swap space without interrupting …
Here is a quick example showing how to count users logged in on a particular date using the “last” command on Linux.
?View Code BASHtruss -vlstat -tlstat ls -l [file name]
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post
enable “Rename hard links”
disable “Rename soft links”
if root of destination drive is mounted as /destination/ then select “Restore to alternate path: from / to /destination/ , Restore search path
This is the alternate path for everything: …
The Unix tar command creates an archive of files and directories while preserving directory structure, file permissions and ownership information. This command is ideally suited for creating backups of most types of data. Many open-source …
1. in old user’s home dir.
?View Code BASHoldgroup=<oldgroup>
newgroup=<newgroup>
username=<username>
tar cvf – `find . -print` > backup.tar
mkdir /home/users/${newgroup}/${username}
mv backup.tar /home/users/${newgroup}/${username}/
cd /home/users/${newgroup}/${username}/
tar -xvf backup.tar
find . -group ${oldgroup} -exec chgrp ${newgroup}{} \;
find . -type l -group ${oldgroup} -exec chgrp …
isainfo -v
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post
In our example we were requested to archive a 741 mb directory to CD. The source data resided on a Unix data server.
1. we copied the source data to a …
share -F nfs -o ro,anon=0 /cdrom/cdrom0
mount -o ro server:/cdrom/cdrom0 /cdrom
if target server responds: RPC: Program not registered
do
/etc/init.d/nfs.server start
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about …
?View Code BASH<em>pattern matching and processing </em>
<strong>awk ‘pattern {action}’ filename </strong>
reads one line at a time from file, checks for pattern match, performs action if pattern matched <em>pattern</em>
NR is a special awk variable meaning the …
find /full_source_path -depth -print | cpio -pudm /full_target_path
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post
Pipe in Unix is a method of passing information from one command to another. The pipe take the output of the first command and sends it as input for the second command. The a second …
tar cvf – . | gzip > target.tar.gz
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post
The following is a collection of examples using fsck command. It is important to unmount VXFS before running fsck on Veritas filesystem.
to fsck a Veritas FS:
?View Code BASHfsck -F vxfs /dev/dsk/c2t2d0s0
to do a full fsck …
1) rsync needs to be installed on source and destination nodes
2) both nodes need to be each other’s /etc/hosts
3) rsync needs to be in the basic PATH for default user’s (root’s shell); create a soft …
Before beginning Oracle REinstall, make sure to remove the /var/opt/oracle/oraInst.loc file created by /tmp/orainstRoot.sh script during prior installation
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about …
1. Disable volume management:
/etc/init.d/volmgt stop
2. Insert CD and create ISO:
dd if=/dev/rdsk/c0t6d0s2 of=/destination_path/image_name.iso bs=1024k
3. After ISO is created, make mountpoint …


