cd /home/userChange to the directory /home/user
(the home directory for a user with the user
name user).

cd ..Go up one level from the current
directory.

cp

Copy a file.

cp oldfile newfileMake a copy of the file oldfile
in the current directory. The copy is named
newfile.

cp oldfile /home/userMake a copy of the file oldfile
in the current directory. The copy also has
the name oldfile and is in the
directory /home/user.

ln

Create a link from one file or directory to
another file or directory.

ln -s /bin/program prolinkCreate a soft link (shortcut) from the
existing file /bin/program to
prolink. The link prolink is
created in the current working directory. If
you enter the command prolink, you
run the program /bin/program.

ls

List the files in the current directory.

ls -alList all (-a) the files in the
current directory in long (-l)
format.

ls *.htmlList files in the current directory
that end with .html. The * is a
wild-card character that represents any
number of characters. The ? is a
wild-card character that represents a single
character.

ls /home/userList the files in the directory
/home/user.

mkdir

Make a new directory.

mkdir newdirMake a new directory called newdir
beneath the current directory.
mkdir /home/newdirMake a new directory called newdir
beneath the /home directory.

mv

Move a file to a new directory or rename
the file.

mv myfile /home/userMove the file myfile from the
current directory to the directory
/home/user.

mv myfile yourfileRename the file myfile. The
new filename is yourfile.

pwd

Show the path to the present working
directory.

tar

Tape ARchive, a
command which combines many files into one for
backup purposes. Below are some example
commands:

These command
compress and decompress files. The recommended
and default extension is .gz.

more|less

These commands are
almost the same, and usually act in a pipe. They
are used for file pagination to terminal. Below
are some example commands:

zcat /var/log/vmksummary.1.gz
| less

more /etc/passwd

rm

Remove a file.

rm deadfileRemove the file deadfile from
the current directory.

rmdir

Remove a directory.

rmdir goneRemove the directory gone,
which exists beneath the current directory.

Finding and Viewing
Files

Command

Example and Explanation

cat

Concatenate the contents of files and
display the content on the screen.

cat /proc/vmware/memDisplay the contents of the file
/proc/vmware/mem.

find

Find files under a specified directory that
match conditions you specify.

find / -name myfil*Find files in the root directory and
all directories under it that have file
names beginning with myfil. The
* is a wild-card character that
represents any number of characters. The
? is a wild-card character that
represents a single character.

find -name '*.vmx' -print -exec chown
User2 {} \;Find all files in this directory and
all subdirectories that end with .vmx,
display the names of all files that are
found on the screen and, for each file
(indicated by the curly braces — {}),
change its owner to User2.

The -print option is not
necessary, but it is handy to track the
progress of the find command. If
you do not use -print, the find
command is silent except for error messages
from find or from chown.

find -name '*.vmx' -exec grep -il
'SOMETHING' {} \;Find all files in this directory and
all subdirectories that end with .vmx
and look for the pattern SOMETHING in each
of the files. The -i option to
grep makes the search case-insensitive.
The -l option to grep
causes grep to display the names of
the files that have SOMETHING in them. When
a file is found that contains SOMETHING,
this command displays the full path to the
file from the current directory (for
example,
./virtualmachines/Linux/RedHat71Test/redhat71.vmx).

grep

Search for a specified text pattern in a
specified directory or list of files and
display the lines in which the pattern is
found.

grep "log file" *Search all the files in the current
directory for the text string log file.

less

Display the contents of a specified file
one screen at a time. Use the arrow keys to
move up and down through the file.

less myfileDisplay the contents of the file
myfile.

grep "log file" * | lessSearch all the files in the current
directory for the text string log file
and use less to display the results
so you can scroll up and down through them.

more

Display the contents of a specified file
one screen at a time. Use the spacebar to
move forward through the file a screen at a
time; use the Enter key to move forward
through the file one line at a time.

more myfileDisplay the contents of the file
myfile.

grep "log file" * | moreSearch all the files in the current
directory for the text string log file
and use more to display the results
so you can view them one screen at a time.

Managing the
Computer and Its Users

Command

Example and Explanation

apropos

Find commands with descriptions that
include a specified word. Displays the name
of the command and the first line of the
description.

apropos fileFind commands with descriptions that
include the word file.

apropos file | lessFind commands with descriptions that
include the word file and use
less to display the results so you can
scroll up or down through them.

du

Display usage in kilobytes for contents of
the current directory or for a specified
file or directory.

du /binShow how much disk space is used by the
/bin directory.

vdf

vdf is an ESX Server-customized
version of the df command. Use
vdf in place of the df
command. vdf works with all the
standard df options.

Displays free space for all mounted file
systems. The listing also shows the total
space, amount of space used and percentage
of space used for each file system.

fdformat

Do a floppy disk format.

fdformat /dev/fd0Format a floppy disk in the first
floppy disk drive.

groupadd

Add a new group.

groupadd newgroupAdd a group named newgroup to
the system.

hostname

Display the system's host name.

ifconfig

Display the network interface configuration
information for devices used by the service
console.

insmod

Install a loadable module into the running
kernel.

insmod parportInstall the loadable module named
parport into the running kernel.

kill

Kill a specified process.
kill 3456Kill the process with a process ID of
3456.

kill-9 is the surest way
to kill a process; however, use it only as a
last resort since it will not save editor
buffers.

lsmod

List all loaded modules.

lspci

List PCI devices available to the service
console.

lspci -vList PCI devices in verbose mode.

mount

These commands manually mount CDs, floppies,
local partitions, and remote directories to
a selected local directory. The local
(empty) directory must exist before the
mount can succeed. Example mound command
would be "mount /dev/sdb5 /data". Permanent
mounting is done by editing the /etc/fstab
file.

mount

Shows all the active mounts.

mount -a

Remounts everything specified in
/etc/fstab file.

mount /dev/cdrom

This command does the default
mounting of a CD to the default mount
point. In Service Console the CD is
mounted to /mnt/cdrom directory.

mount /mnt/floppy

Mounts a normal 1440KB floppy
(/dev/fd0) to the specified directory.

mount -t iso9660 -o
loop /local/w2005srv.iso /mnt/isocd

Mount a CD/DVD ISO image file to the
specified directory. This is very useful
for testing and other purposes. The
mount point directory must exist (mkdir
/mnt/isocd) before mounting.

passwd

Change your password.

passwd userChange the password for a user named
user. You must be logged in as the
root user (su) to change another
user's password.

ps

Show names, process IDs and other
information for running processes.

ps -efShow full (-f) information
about every (-e) running process.

shutdown

Shut down the computer.

shutdown -h 5Completely halt (-h) the
computer in 5 minutes.

shutdown -r nowShut down and restart (-r) the
computer immediately.

umount

Unmount a specified device.

umount /mount/floppyUnmount the device currently mounted at
/mount/floppy.

useradd

Add a new user to the system.

useradd newuserAdd a new user with a user name of
newuser to the system.

who

Show the user names of all users logged in
to the system.

whoami

Show what user name you are currently using
on the system.

man

Prints the manual
page for a command or a configuration file
entered as a parameter to this command.

reboot

Does a nice reboot
on the system. Does "Force Power Off" for the
VMs.

halt

Does a nice halt on
the system. Does "Force Power Off" for the VMs.

shutdown

Generic command for
shutting down or rebooting the system.

fdisk

Command line disk
partitioning program in Linux. It is powerful
and has a very simple user interface.

fdisk /dev/sdb

On command
line, starts fdisk against second available
SCSI disk. "sda" is the first SCSI disk, "sdc"
is the third SCSI disk etc. VMware ESX
Server is installed on /dev/sda, and the
external storage is /dev/sdb, and maybe some
others too.

p

Fdisk
subcommand, prints the current partition
table on current disk.

d

Fdisk
subcommand, deletes an existing partition.
Enter the partition number to delete. It is
recommended to printout the current
partition table before deleting anything.

n

Fdisk
subcommand, creates a new partition. Select
partition type (primary, extended, or
logical). Almost always you should use the
default starting cylinder. For size, enter
"+NNNNNm", where NNNNN is the size in
megabytes.

t

Fdisk
subcommand, change partition type (id). By
default fdisk creates ext2 type partitions.
We might also want to use id "fb", the vmfs
type, or some other type.

w

Fdisk
subcommand, writes the current partition
table to disk. If you don't get any errors,
you don't have to reboot. If you get errors
at this point, the new partition table is
used only after next system boot.

mke2fs

This command
formats a partition for ext2, or ext3 file
system.

mke2fs -j
/dev/sdb1

Formats
/dev/sdb1 using ext3 file system.

mke2fs
/dev/sdb1

Formats
/dev/sdb1 using ext2 file system

kudzu

This is the
RedHat's tool to detect and configure hardware:
adding new and removing old. When you run kudzu,
or system runs it at bootup, be careful. Kudzu
might offer to remove hardware you have
dedicated solely to the VMs. Know your hardware
and configuration. It might be a good idea to
refer to /etc/modules.conf file before running
kudzu. A safe action to select in kudzu is "Do
nothing". Select it when in doubt.

dd

With this 'disk
dump' command you can create ISO images and
floppy images. You can also use it to create
imagefiles of partitions and whole disks. Below
are some example commands:

dd if=/dev/cdrom
of=/local/suse90pro-dvd1.iso bs=2048

dd if=/dev/cdrom
of=/local/w2003srv.iso bs=2048

The above
two examples create an ISO image of a
CD/DVD. You can safely ignore the error
message usually shown at the end of the
media.

dd if=/dev/fd0
of=/local/bootfloppy1.img bs=1440k

This
command creates a floppy image quickly.

dd if=/dev/fd0
of=/local/bootfloppy2.img bs=512

This is a
bit slower version of the above example.

ntpdate

This command takes an NTP server as a
parameter and synchronises the clock once. This
command doesn't work when local NTP daemon is
running. Example: ntpdate ntp1.funet.fi

chmod

This
command is the main command for changing file
modes. Like chown, it can do things recursively
with parameter "-R". Below are some example
commands: