Commands For Linux (Basics)
Commands For Linux (Basics)
Commands For Linux (Basics)
Appendix B
Basic Linux and
vi Commands
___________________
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 2
vi Commands
The Visual Interpreter/Editor (vi) is the most widely used text editor available for the UNIX environment.
While almost everybody curses its unwieldy command syntax, it is still the only editor almost certain to
be included with every version of the UNIX and Linux operating system. The following are a partial list
of available vi commands.
vi has two modes. Command line (where anything typed is taken as an editing command) and input mode
(where everything typed will be treated as part of the file being edited. To enter the input mode, type a, A,
i, I, o, O, c, C, s, S, r, or R. To return to the command-line mode, use the <ESC> key. To access the vi
editor from SQLPlus, enter the following command:
SQL>define _editor=vi
To edit a file from SQLPlus prompt, edit <filename> (press enter), from the Linux command prompt, vi
<filename> (press enter)
To MOVE the cursor:
h - move left j - move down k - move up l - move right
w - one word forward b - one word backward e - end of current word
W, B, or E - same as lower case but ignores punctuation
0 (zero) - Move to beginning of current line $ - end of current line
G - go to last line of file H - go to top line on the screen
L - go to last line on screen M - go to middle line on the screen
/<string> - Search forward to the next occurrence of <string>
?<string> - Search backward to the next occurrence of <string>
n - Repeat previous search N - Repeat previous search in opposite direction
<ctrl> f - Scroll forward one page <ctrl> b - Scroll backward one page
To UNDO previous changes:
u - Will undo the most recent change. U - Will undo the most recently deleted text.
:e! - re-edit current file without saving any changes made since last change
To ENTER NEW text:
a - Append text after the current cursor position.
A - Append text to the end of a line (jumps to end of line and begin appending).
c - Change object C - Change from current cursor position to end of the line
i - Insert text before the current cursor position. I - Insert text at the beginning of a line.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 3
o - Insert a blank line BELOW the current cursor position.
O - Insert a blank line ABOVE the current cursor position.
r - Replace character at current cursor position R - Replace all characters until <ESC> is pressed
s - substitute text for character under cursor
:s/A/B/opt substitutes string B for string A. %s/A/B/opt is global replace
options include: g (change all occurences on current line) c (confirm prior to each change)
p (print changed lines) S - Substitute entire line to the end
. <period> - repeat last change n. <integer><period> repeat last change n times
To leave the input mode, press <ESC>
To DELETE existing text:
x - Will delete the character directly under the current cursor location.
dd - Will delete the entire line where the cursor is located.
dnd (where n is some integer) will delete n lines from current cursor position
dw - delete current word D - delete to end of current line
J - Delete return at end of current line. Join this line and the next
<int> J - Join the next <int> lines
COPY, CUT, and PASTE: vi uses a single buffer where the last changed or deleted text is stored. This text may be
manipulated with the following commands:
Y - Yank a copy of the current line y <integer> - Yank a copy of next <int> lines
yw - Yank a copy of the current word yb - Yank a copy of the previous word
p - Put buffer contents after cursor P - Put buffer contents before cursor
Also, see the s and S commands under the input section
To SAVE edited changes to an operating system file:
zz - Will terminate edit mode. :w filename - Will save changes to the filename specified.
:wq - Write all changes and quit the edit mode
To QUIT without saving changes:
ZZ - Will terminate edit mode. :q! - Will terminate the file without saving changes.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 4
Basic Linux Commands
This appendix is meant to serve only as a quick reference while you are in class. For more
details on these commands, consult the man pages, your Linux documentation, or other
Linux command reference books.
Files and
Directories
Linux Commands Description/Comments
Command
manual
man <command>
man k <string>
man man
Find the manual entry for this
<command>.
Show all the manual entries that
contain this <string>.
Displays the manual page for
man.
Command
information
info <command>
Show the information system entry
for this command. Using info
info shows a tutorial of the info
documentation system.
Print to
standard out
cat <file>
Concatenate and print
print the
named file to the terminal screen.
List users
cat /etc/password
Change
working
directory
cd <directory>
Change working directory to
specified directory
cd with no parameters changes to
$HOME.
Copy a file
cp <source_file>
<destination_file>
Copy a source file to a destination
file.
View a file
less <file>
View a file a page at a time. This
is a GNU version of more, or pg.
View a file
more <file>
View a file a page at a time. BSD
version.
List directory
ls <directory>
Options l long listing, -R
recursive, -a show hidden files, -t
sort by time, -r reverse sort,
default directory is current
working directory.
Create a
directory
mkdir <directory>
Make a directory defaults into the
current working directory, full
path may be specified.
Move or
rename a file
mv <old_file> <new_file>
Move changes the name of a file
or moves it to a different directory.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 5
Process List
ps
ps -ef
Shows the processes report
Shows all processes on the system
with a full listing. Many option
exist see the man page for details.
Print working
directory
pwd
Print to stdout the current working
directory.
Remove or
erase a file
rm <file>
Removing a file on Linux is
permanent. Options r recursive,
and f force (including
subdirectories) are very
dangerous. Often the rm
command is aliased with rm i
The option i asks Are you sure?
Create an empty
file
touch <file>
Create a file.
Name of the
machine
hostname
Returns the name of the machine.
The IP address
of the machine
host <machine_name>
Queries the Domain Name Server,
and returns the IP address of the
machine name.
Remote shell
rsh <host> <command>
Execute a <command> on <host>.
Rsh is not secure, use ssh instead.
Remote shell
ssh <host>
Secure shell, has features to
replace rsh, rcp, ftp, and telnet.
Remote shell
telnet <host>
Start a terminal session on <host>.
Telnet is not secure use ssh
instead.
Search a file for
a pattern
grep <option> <pattern> <file>
Search a <file> or stream for a
regular expression defined by
<pattern> and show the line that
contains that pattern. A common
option is i for case insensitive.
grep can accept input from a file
or stdin through a pipe as in:
netstat a| grep ESTABLISHED
Source a script
. <script_file>
In the bash shell this command .
forces the script to run in the shell.
Normal behavior is for the script
to run in a child shell.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 6
An interpreter
awk
A macro language for reformatting
or interpreting input. For each line
of input, a variety of actions can
be taken. May be referred to as
nawk for new awk.
Sort a file
sort
Sort a file takes input from stdin or
a filename argument, many
options to sort by a particular
column, field, etc. See man page.
Command-line
editor
sed
Sed is a command-line editor, with
many possible commands and
options that are very good for
editing from a shell script.
Visual editor
vi <file>
Terminal based editor available on
every Unix system, Linux provides
vim, an improved vi, that is a
superset of vi.
Gnu editor
emacs <file>
This is a GPL editor with
extensive customizable features
available on most UNIX and
Linux distributions.
WSIWIG editor
gedit <file>
A full-screen editor, requiring X.
Available under Gnome.
WSIWIG
kate <file>
A full-screen editor, requires X.
Available under KDE
Terminal output
stdout
Standard out (stdout), is not a
command but a concept, most
Linux commands write to stdout
by default unless redirected.
Terminal input
(keyboard)
stdin
Standard in (stdin), is not a
command but a concept, most
Linux commands read from stdin
by default unless redirected.
Alias
alias <command> <alias>
Make a substitution when a user
types <command> substitute and
execute <alias>, common alias is
alias rm rm i. These aliases
are set in the .bashrc file.
Show shell
variables
set
Prints all of the variables that are
currently defined in the shell.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 7
Show
environment
variables
printenv or env
Prints all the environment
variables an environment
variable has been exported so
that it will be inherited by child
processes.
File Creation
mask
umask S u=rwx,g=rx,o=rx
Set the default permissions for all
files created by this shell or its
children. The S option uses the
symbolic notation, the numeric
notation is obsolete.
Clock
xclock
An X client that shows a clock on
the screen. Often used to test the X
windows system.
X access
control
xhost
xhost +<Xclient>
Show the current access control in
place.
Add a Xclient that is allowed to
access the local DISPLAY, if no
<Xclient> is given all are allowed.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 8
System
Administration
Linux Commands Description / Comments
Substitute user
su - username
Change the user that is currently
performing the work. This can be
used by any user to change who is
the effective id of the session user.
normal users must provide a
password, root does not. The -
parameter is optional. It runs the
new users login scripts.
Limited root
privileges
sudo
The root user may configure which
users can execute certain
commands as root, and whether a
password is required or not. Useful
for allowing specific users to
perform certain root commands
e.g. mount and unmount
removable volumes such as
CDROMs.
Root file system
/
The root directory for the system
directory tree.
Home Directory
/home
Typically the directory in which
all user home directories placed.
For example: /home/oracle.
Tmp directory
/tmp
A temporary storage area. Do
notput anything here you want to
keep. SA often have a cron job to
remove everything periodically.
Boot directory
/boot
A small partition to hold the kernel
image(s) and boot loader
instructions.
Log directory
/var/log
The location of most system log
files.
Sample
configuration
files
/etc/inittab
Configuration files are located per
the application. Any configuration
file that you change after
installation should be included in
the backup.
Password files
/etc/passwd
/etc/shadow
The /etc/passwd file holds
user information and must be
readable by others; even with
encrypted passwords this can be a
security hole. The /etc/shadow
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 9
file holds the encrypted passwords
and is only readable by root.
Groups file
/etc/group
The /etc/groups file defines
the groups on a server and the
users that are members of the
group; primary group for a user is
defined in the /etc/passwd
file.
X configuration
file
/etc/X11/XF86Config
The file that sets the X server
settings for your video card,
monitor, mouse, and keyboard.
Usually set up with a OS vendor
supplied tool.
Schedule a
command to run
at a regularly
scheduled time
crontab -e
Use this command to edit the
crontab file, to create the
specification for the cron daemon
to use.
Schedule a
script to run at a
particular
frequency
/etc/anacrontab
Edit the file to specify a script to
run at a particular frequency (see
man anacrontab for details).
Schedule a
command to run
at a single
specified time
at <options> TIME
Runs a job specified by <options>
at a specified TIME parameter.
Schedule a
command
batch <options> <TIME>
Run a command when the load
average drops below .8, optionally
after a set TIME.
Mount a file
system
mount <opt> <dev> <mount_point>
Mount a file system on device
<dev> at <mount_point> with the
options specified by <dev>.
Unmount a file
system
umount <dev>
umount <mount_point>
Unmount the file system or device.
Maximum # of
user ID
65535
Recover root
password
{lilo}
control-x
linux S
passwd root
{grub}
c
This is a procedure to recover the
root password if is lost. This
requires physical access to the
machine and system console. You
start by rebooting the machine,
then during the LILO boot press
and hold [Ctrl] + [x] to get a
prompt and command LILO to
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 10
kernel vmlinuz-2.4.9-13 single
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot
passwd root
boot linux to runlevel S.
The second procedure uses the
grub boot loader.
Create new user
useradd
The D option alone shows the
defaults.
D with other options changes the
defaults options; without D
override, the default (e.g., g) sets
a primary group.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 11
Delete user
userdel
Remove a user and optionally all
files belonging to the user.
Modify user
account
usermod
Change /etc/password
information.
Create new
group
groupadd
g sets the group id; default is first
free value above 500.
Delete group
groupdel
Remove a group from the system.
May not remove a group that is a
primary group for a user. Files
owned by deleted group must be
manually changed with chown.
Change run
levels
init <runlevel>
The init command causes the
rcN.d scripts to be evaluated, for
the change in run level. init 6
forces a reboot.
Synchronize the
disks
sync
Forces the buffer cache and page
cache to write all dirty buffers to
disk. Used just before a reboot to
prevent disk corruption.
Shutdown the
Linux system
shutdown <mode> <delay>
Do a graceful shutdown of the
system, shut down processes, run
all shutdown scripts, and sync
disks. The modes are r, reboot
and h, halt. The delay is a
required parameter is a number in
seconds or now. Option
shutdown warning message may
be sent as well.
Error logs
dmesg
View boot messages. This log is
circular, and limited system errors
could overwrite boot information
after a time.
Network IP
configuration
/etc/sysconfig/network-
scripts/
This directory holds scripts
executed as part of the boot up
sequence by rc.sysinit.
Hosts IP
addresses
/etc/hosts
A list of hosts that your machine
knows about. Must at minimum
include the name of the local
machine and loopback IP.
Name service
switch
/etc/nsswitch.conf
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 12
Network
parameters
sysctl -a | grep net
View all net parameters that are
set for the kernel.
Routing
daemon
routed
NIC
Configurations
ifconfig -a
Show all the network devices
currently configured.
modprobe ip_alias
Secondary IP
Address ifconfig eth0:1 IP
Login prompt
/etc/issue
Banner message user sees when
issued the login prompt.
YP/NIS service
binder
/sbin/ypbind
Finds and attaches to a NIS server
for name resolution and other
services.
Module
information
modinfo <options> <module>
Display information about kernel
modules: l shows license, p
parameters, d description.
List modules
lsmod
Show currently loaded modules.
Load module
insmod
Load a loadable module.
Unload module
rmmod
Unload a loadable module.
Install Software
rpm -ivh package
Install i, verbose v, with
progress hash marks h.
Uninstall
software
rpm -e package
Erase package e; will not
uninstall if dependencies exist.
List installed
software
rpm -qa
Query q, All a, lists all installed
packages.
Verify installed
software
rpm -V package
Compares installed files with the
rpm database information.
List all files
rpm -ql package
List all the files that are part of a
package.
Package owner
rpm -qf file
List the package when given the
full file name.
Machine model
uname -m
Shows CPU level (e.g., i686).
OS Level
uname -r
Shows kernel version.
Run Level
runlevel
Shows previous and current
runlevel.
Kernel
Parameters
sysctl -a
Show settings of all settable kernel
parameters.
Max # File
Descriptors
sysctl fs.file-max
Shows the value of maximum number
of file descriptor per process.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 13
Kernel
parameter
settings
/etc/sysctl.conf
Compiled in kernel parameters;
may be reset at bootup by setting
them in this file.
echo <value> > </proc/<file>
Write the new value of a kernel
parameter into the /proc file
system.
Change Kernel
Parameter
echo 2147483648
>/proc/sys/kernel/shmmax
Set the value of the maximum size
of a shared memory segment.
Shared Memory
sysctl kernel.shmmax
Show the shmmax parameter.
Change Kernel
Parameter
sysctl w <parameter>=<value>
Change a kernel parameter; the p
option reads the setting from a file
and sets them. The default file is
/etc/sysctl.conf
Set Process
limits
ulimit <option> <value>
Set limits on a shell and processes
started by the shell. Users can
make limits more restrictive;
generally only root can make limit
less restrictive; some options
require root privilege. Options: u
sets number of processes, n
number of file handles; many
others (see man bash).
Show process
limits
ulimit
Without options ulimit show the
current limit settings.
Interprocess
Communication
(Shared
Memory and
Semaphores)
ipcs <option>
Options: m the current usage of
shared memory; s usage of
semaphores; a shows all.
Remove a
shared memory
segment
ipcrm shm <shmid>
Releases the shared memory
segment identified by <shmid>.
This is very dangerous. You can
corrupt a database that is using the
segment that is released.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 14
System
Performance
Linux Commands Description / Comments
Performance
monitor
top
View real-time OS and process
statistics.
System activity
reporter
sar <options> <interval>
<count>
Options: q shows CPU queue, u
CPU utilization, d device
activity, n DEV network device
activity, many more (see man
page). Interval is in seconds.
Virtual Memory
statistics
vmstat <interval> < count>
Interval is in seconds.
Virtual Memory
statistics
cat /proc/meminfo
Shows instantaneous virtual
memory usage.
Kernel Cache
statistics
cat /proc/slabinfo
Kernel slab allocator statistics:
frequently allocated cache objects
such as inode, dentries, and
asynchronous IO buffers.
I/O statistics
iostat <option> <interval>
<count>
Options: d device activity, c
CPU activity, x extended disk
activity statistics. The interval is in
seconds.
Multiprocessor
Statistics
mpstat P <cpu> <count>
<interval>
Return CPU statistics for
particular processor or all CPUs in
an smp system.
Physical RAM
64 GB(Theoretical)
Maximum physical RAM requires
enterprise kernel (Red Hat
Enterprise Linux AS 21 only
supports up to 16 GB).
Swap device
swapon -s
Shows devices currently in use for
swap. The swap device is arbitrary
designated at install. It may be
changed or added to. Multiple
swap devices may be created;
swap size should be at least as
large as physical memory.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 15
Display swap
size
free
Show the current memory and
swap usage.
Activate Swap
swapon -a
Turn on swap.
Free disk blocks
df -k
Measured in KB; use m for MB
units.
Device listing
cat /proc/devices
List devices known to the system
by major and minor number.
Disk
information
cat /proc/scsi/scsi0/sda/model
cat /proc/ide/ide0/hda/model
View SCSI disk information.
View IDE disk information.
Print network
statistics
netstat <options>
Print a wide variety of network
statistics (see man netstat).
Graphical
system statistics
viewer
xosview
An X-based display of recent OS
statistics.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 16
Misc System
Information
Linux Commands Description / Comments
NFS exported
/etc/exports
Database file are not supported on
simple NFS.
NFS Client
mounted
directories
/var/lib/nfs/xtab
Max File
System
2 TB with 4KB block size (on 32
kernel)
With ext3 and ext2, others vary.
Max File Size
File size can not
exceed file
system
2 GB {512B block size}
2 TB {4KB block size}
The oracle database can create
files up to 64 GB with a 16 KB
database block size.
The 32-bit kernel limits file and
block devices to 2 TB.
File System
Block size
dumpe2fs <device>
Dump the file system properties to
stdout.
Filesystem table
/etc/fstab
Mounts these file systems at boot
up.
Journal
Filesystem
types
ext3
reiserfs
Disk Label
fdisk -l
fdisk is not available on all
distributions.
resize2fs
Extend File
system resize_reiserfs
Extending a file system is
applicable to only some file
system types.
Backup
tar cvf /dev/rst0 /
Create a backup of the root / file
system.
Restore
tar xvf /dev/rst0
Restore the root / file system.
Prepare boot
volumes
/sbin/lilo
Must be run after changing
/etc/lilo.conf to push
changes to boot loader.
Startup script
/etc/rc.d/rc
Kernel
/boot/vmlinuz
Kernel Bits
getconf WORD_BIT
POSIX call to get kernel
information. There are many other
variables besides WORD_BIT.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 17
Boot single user
{lilo}
control-x
linux S
{grub}
c
kernel vmlinuz-2.4.9-13 single
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot
Use LILO facility.
Use GRUB Boot Loader.
Time zone
Management
/etc/sysconfig/clock
SW Directory
/var/lib/rpm
Directory where rpm database are
kept.
Devices
/dev
This directory holds all the device
files.
CPU
cat /proc/cpuinfo
Shows CPU static information.
Whole Disk
/dev/sda
Device name.
CDROM
/dev/cdrom
Usually mounted at
/mnt/cdrom.
CDROM file
type
iso9660
Floppy drive
/dev/fd0
Usually mounted at
/mnt/floppy.
System
information
/proc
The /proc filesystem is a memory-
based file system that allows
access to process and kernel
settings and statistics.
Compile and
link a
executable
make f <file> <command>
Use a make file <file> to
determine which parts of a large
program need to be recompiled,
and issue the commands required
to compile, link, and prepare the
executable for use.
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 18
LVM Linux (UnitedLinux) Description / Comments
LVM
Logical Volume Manager
This package is not provided by Red Hat
Enterprise Linux AS 2.1 and may not be
added without tainting the kernel. Kernel
support is provided in United Linux.
LVM Concepts
logical extents
A Logical volume is made up of logical
extents.
logical volume
A set of logical extents taken from a volume
group and presented to the OS as a disk
volume. These extents may be striped across
multiple disks.
volume group
A set of physical disk partitions created by
fdisk or the like, initialized with
pvcreate, then grouped into a physical
volume with vgcreate.
Display volume
group
vgdisplay -v
Modify physical
volume
pvchange
Prepare physical
disk
pvcreate
List physical
volume
pvdisplay
Remove disk
from volume
group
vgreduce
Move logical
volumes to
another physical
volumes
pvmove
Create volume
group
vgcreate
Remove volume
group
vgremove
Volume group
availability
vgchange
Restore volume
group
vgcfgrestore
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Administration Workshop I B - 19
Exports volume
group
vgexport
Imports volume
group
vgimport
Volume group
listing
vgscan
Change logical
volume
characteristics
lvchange
List logical
volume
lvdisplay
Make logical
volume
lvcreate
Extend logical
volume
lvextend
Reduce logical
volume
lvreduce
Remove logical
volume
lvremove
Create striped
volumes
lvcreate -i 3 -I 64
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
O
r
a
c
l
e
U
n
i
v
e
r
s
i
t
y
a
n
d
E
n
-
S
o
f
I
n
f
o
r
m
a
t
i
c
a
E
T
r
e
i
n
a
m
e
n
t
o
L
t
d
a
u
s
e
o
n
l
y
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED