Featured »

March 2, 2022 – 2:00 pm

Books have been written on the subject of awk and sed. Here’s a small sample of commands I put together over the years that are useful for everyday system administration tasks. Most of these tasks …

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Archive by Category

Articles in Commands & Shells

Working with ISO images on Solaris

November 22, 2005 – 4:57 pm
HP-Greets-IBM-2

The following two commands will take all data in /home/neal, copy it to the ISO file, and burn the ISO file to a recordable CD.

Executing commands with ‘find’

November 21, 2005 – 11:47 pm
shell_0004

To executes commands with ‘find’ use the ‘-exec’ option. Example:

Using rsync to copy files

November 21, 2005 – 4:00 pm
hard-disk_00416535

In the following example we need to make sure that /export/home on server host2 looks exactly like /export/home on host1. Thus, our SOURCE is host1:/export/home and our TARGET is host2:/export/home
There are two ways of using …

Using GNUPlot to chart MySQL data

November 20, 2005 – 12:17 pm
shell_0005

The following Korn shell function connects to a MySQL database and extracts specified data, which is then plotted as a function of time using GNUPlot.  Using correct syntax is critical. Note the use of single- …

Database operations with SQL and Korn shell

November 20, 2005 – 11:46 am
logo_mysql

The following Korn shell function will read the a directory containing CSV data files named server_sysstat.20051119.csv with format:

FTP script with nested function

November 20, 2005 – 2:14 am
968780_94091618

An example of an FTP script with Korn shell.

Unix Commands Summary

November 19, 2005 – 11:24 pm
shell_001

 
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 …

Moving filesystems with ufsdump

November 19, 2005 – 11:22 pm
di-logo-solaris-orange

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 | …

Copying directories using tar and rsync

November 19, 2005 – 11:20 pm
shell_002

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 …

Count users with “last”

November 19, 2005 – 11:15 pm

Here is a quick example showing how to count users logged in on a particular date using the “last” command on Linux.

To display file’s modification, last access, etc

November 19, 2005 – 11:14 pm
shell_0005

Display a file’s modification, last access and other attributes on Solaris.

Create tarball

November 19, 2005 – 10:42 pm
shell_002

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 …

Check if Solaris supports 64-bit applications

November 19, 2005 – 10:41 pm
solaris-logo

How to determine if your installation of Solaris supports 64-bit applications.

Copy directory structure and files with cpio

November 19, 2005 – 10:38 pm
shell_003

A basic command to copy directory structure and contents using cpio.

Using FTP with pipes

November 19, 2005 – 10:37 pm
968780_94091618

All The Reasons Pot Is Good For You

AP/Damian Dovarganes
Colorado and Washington both passed legislation that legalizes the recreational use of marijuana on Tuesday.

While recreational marijuana is controversial, many people believe that the drug should be legal, especially …

Create TAR and pipe through gzip

November 19, 2005 – 10:36 pm
shell

A simple example of creating a gzip-compressed tar archive of the current directory.