iSelfSchooling.com - Since 1999  References  |  Job Openings
    Home  | Search more  | Oracle Syntax  | Computer Institute   | (Login or Register to access to VIDEOS)
 

Copyright & User Agreement

   Suggestions Email2aFriendHomepage us! |  Bookmark

Services

  Vision/Mission

  Services

  Biography

  Contact Us

 FREE Training

  Start...

  SQL

  PL/SQL

  Forms 

  Reports

  DBA Fundamentals

  Performance

  Prepare for OCP

  ShareUrNotes

...

  Acknowledgement

  Who is who

  University Directory

  Links...

 

 

 

 

Quick LINUX Commands

 

 

Files and Directories Commands

LINUX System Administration Commands

LINUX System Performance Commands

Misc. System Information Linux Commands

Linux Logical Volume Manager (LVM) Commands

 

To get more information about a command,

type: # man <command>

 

More Resources by Google:

Files and Directories Commands

Commands

Description

# . <script_file>

In the bash shell this command forces the script to run.

# alias <command> <alias>

Make a substitution when a user execute <alias>.

# awk

A macro language for reformatting or interpreting input.

# cat /etc/password

Display a list of users.

# cat <file>

Concatenate and print – print the named file to the terminal screen.

# cd <directory>

Change working directory to specified directory. $HOME is default.

# cp <s-file> <d-file>

Copy a source file <s-file> to a destination file <d-file>.

# emacs <file>

This is a GPL editor.

# env

Print all the environment variables.

# gedit <file>

A full-screen editor, requiring X.

# 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 also from stdin. For examp: netstat –a | grep ESTABLISHED

# host <machine-name>

Query the Domain Name Server and return the IP address.

# hostname

Return the name of the machine.

# info <command>

Show the information system entry for this command.

# kate <file>

A full-screen editor, requiring X.

# less <file>

View a file one page at a time. This is a GNU version of more, or pg.

# ls <directory>

Option –l long listing, -R recursive, -a show hidden files, -t sort by time, -r reverse sort, and default directory is your current directory.

# man <command>

# man –k <string>

# man man

Find the manual entry for this <command>.

Show all the manual entries that contain this <string>.

Display the manual page for man.

# mkdir <directory>

Make a directory, full path may be specified if it is not in your current directory.

# more <file>

View a file one page at a time.

# mv <s-file> <d-file>

Move or rename a source file <s-file> to a destination file <d-file>.

# printenv

Print all the environment variables.

# ps

# ps -ef

Show the processes report.

Show all processes on the system with a full listing.

# pwd

Print to stout the current working directory.

# rm <file>

Remove a file on Linux. Options –r recursive, –f force (including subdirectory), and –i ask ‘Are you sure?’

# rsh <host> <command>

Execute a <command> on <host>. It is not secure, use ssh.

# sed

Sed is a command line editor.

# set

Prints all of the variables that are currently defined.

# sort

Sort an input file or stdin.

# ssh <host>

Secure shell, has features to replace rsh, rcp, ftp, and telnet.

# stdin

Standard in (stdin), is not a command but a concept, most Linux commands read from stdin by default unless redirected.

# stdout

Standard out (stdout), is not a command but a concept, most Linux commands write to stdout by default unless redirected.

# telnet <host>

Start a terminal session on <host>.

# touch <file>

Create a file.

# 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 notations, the numeric notation is obsolete.

# vi <file>

Terminal based editor available on every Unix system.

# xclock

An X client that shows a clock on the screen. Often used to test the X windows system.

# 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.

 

 

 

 

LINUX System Administration Commands

Commands

Description

# at <options> TIME

Runs a job specified by <options> at a specified TIME parameter.

# batch <options> TIME

Run a command when the load average drops below .80, optionally after a set TIME.            

# crontab –e

Use this command to edit the crontab file.

# dmesg

View boot messages. This log is circular, and limited system errors could overwrite boot information after a time.

# echo <value> > </proc/<file>

Write the new value of a kernel parameter into the /proc file system. To change a shared memory segment:

# echo 2147483648 > /proc/sys/kernel/shmmax

# groupadd

-g sets the group id; default is first free value above 500.

# groupdel

Remove a group from the system.

# ifconfig –a

Show all the network devices currently configured.

# init <runlevel>

The init command causes the rcN.d scripts to be evaluated, for the change in run level. # init 6 forces a reboot.

# insmod

Load a loadable module.

# ipcrm shm <shmid>

Release the shared memory segment identified by <shmid>. This is very dangerous. You can corrupt a database that is using the segment that is released.

# ipcs <option>

Options: -m the current usage of shared memory; -s usage of semaphores; -a shows all.

# lsmod

Show currently loaded module.

# modinfo <options> <module>

Display information about kernel modules: -l shows license, -p parameters, -d description.

# mount <opt> <dev> <mnt-pt>

Mount a file system on device <dev> at <mnt-pt>.

# rmmod

Unload a loadable module.

# routed

It is routing daemon

# rpm –e package

Erase package –e; with not uninstall if dependencies exist.

# rpm –ivh package

Install –i, verbose –v, with progress hash marks –h.

# rpm –qa

Query –q, All –a, lists all installed packages.

# rpm –qf file

List the package when given the full file name.

# rpm –ql package

List all the files that are part of a package.

# rpm –V package

Compares installed files with the rpm database information.

# runlevel

Show previous and current runlevel.

# 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 number in seconds or ‘now’.

# sync

Force the buffer cache and page cache to write all dirty buffers to disk. Use it before a reboot.

# sysctl –a

Show settings of all settable kernel parameters.

# sysctl –a | grep net

View all net parameters that are set for the kernel.

# sysctl fs.file-max

Show the value of maximum number of file descriptor per process.

# sysctl kernel.shmmax

Show the shmmax 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.

# ulimit

Without options ulimit show the current user limit setting.

# ulimit <option> <value>

Set limits on a shell and processes started by the shell. Users can make limits more restrictive; generally ly root can make limit less restrictive; some ooptions require root privilege. Options: -u sets number of processes, -n number of file handlers;

# umount <dev>

# umount <mnt-pt>

Unmount the file system or device.

# uname –m

Show CPU level. (e.g., i686).

# uname –r

Show kernel version.

# useradd

The –D option alone shows the defaults, -g sets a primary group.

# userdel

Remove a user and optionally all files.

# usermod

Change /etc/password information.

/

The root directory for the system

/boot

A small partition to hold the kernel image(s) and boot loader instructions.

/etc/anacrontab

Edit the file to specify a script to run at a particular frequency.

/etc/group

The /etc/group file defines the groups on a server.

/etc/hosts

A list of hosts that your machine knows about. At minimum must include the name of the local machine and loopback IP.

/etc/inittab

Configuration files are located per the application. Any configuration file that you change after installation should be included in the backup.

/etc/issue

Banner message user sees when issued the login prompt.

/etc/nsswitch.conf

Contains the IP address of the name service switches.

/etc/passwd

/etc/shadow

The /etc/passwd file holds user information.

The /etc/shadow file holds the encrypted passwords.

/etc/sysconfig/network-scripts/

This directory holds scripts executed as part of the boot up sequence by rc.sysinit.

/etc/sysctl.conf

Compiled in kernel parameters; may be reset at bootup by setting them in this file.

/etc/X11/XF86Config

The file that sets the X server settings for your video card, monitor, mouse, and keyboard.

/home

Typically the directory in which all user home directories placed.

/sbin/ypbind

Finds and attaches to a NIS server for name resolution and other services.

/tmp

A temporary storage area. Don’t put anything here you want to keep.

/var/log

The location of most system log files.

65535

Maximum number of user ID.

 

 

{lilo}

control-x

linux S

passwd root

 

{grub}

c

kernel vmlinuz-2.4.9-13 single

ro root=/dev/hda8

initrd /initrd-2.4.9-13.img

boot

passwd root

This is a procedure to recover the root password if is lost. You start by rebooting the machine, then during the lilo boot press and hold [Ctrl]+[x] to get a prompt and command LILO to boot linux to run level S.

 

 

 

 

The second procedure uses the grub boot loader.

 

 

 

LINUX System Performance Commands

Commands

Description

# cat /proc/devices

List devices known to the sytem by major and minor number.

# cat /proc/ide/ide0/had/model

View IDE disk information.

# cat /proc/meminfo

Show instantaneous virtual memory usage.

# cat /proc/scsi/scsi0/sda/model

View SCSI disk information.

# cat /proc/slabinfo

Kernel Cache Statistics: Kernel slab allocator statistics: frequently allocated cache objects such as inode, dentries, and asynchronous IO buffers.

# df –k

Measured in KB; use –m for MB units.

# free

Show the current memory and swap usage.

# iostat <option> <interval> <count>

I/O statistics: Options: -d device activity, -c CPU activity, -x extended disk activity statistics. The interval is in seconds.

# mpstat –P <cpu> <count> <interval>

Return CPU statistics for particular processor or all CPUs in an smp system.

# netstat <options>

Print a wide variety of network statistics.

# sar <options> <interval> <count>

System Activity Report: Options: -q shows CPU queue, -u CPU utilization, -d device activity, -n DEV network device activity, many more. ‘sec’ is in seconds.

# swapon –a

Turn on swap

# swapon –s

Swap device: Show devices currently in use for swap.

# top

Performance Monitor: View real-time OS and process statistics.

# vmstat <interval> <count>

Virtual Memory statistics and Interval is in seconds.

# xosview

An X-based display of recent OS statistics.

64 GB (theoretically)

Maximum physical RAM requires enterprise kernel (Red Hat Enterprise Linux AS 21 only supports up to 16 GB).

 

 

 

 

 

Misc. System Information Linux Commands

Commands

Description

# /boot/vmlinuz

Kernel.

# /etc/fstab

File system table: Mounts these file systems at boot up.

# /etc/rc.d/rc

Startup script.

# /etc/sysconfig/clock

Time zone management.

# /sbin/lilo

Must be run after changing /etc/lilo.conf to push changes to boot loader.

# cat /proc/cpuinfo

Show CPU static information.

# dumpe2fs <device>

File System Block Size: Dump the file system properties to stdout.

# fdisk –l

fdisk is not available on all distributions.

# getconf WORD_BIT

Kernel Bits: POSIX call to get kernel information. There are many other variables besides WORD_BIT.

# 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.

# resize_reiserfs

Extending a file system is applicable to only some file system types.

# resize2fs

Extending a file system is applicable to only some file system types.

# tar cvf /dev/rst0 /

Create a backup of the root / file system.

# tar xvf /dev/rst0

Restore the root / file system.

/dev

Directory that holds all the device files.

/dev/cdrom

Usually mounted at /mnt/cdrom.

/dev/fd0

Usually mounted at /mnt/floppy.

/dev/sda

Whole disk: Device name.

/etc/exports

NFS exported: Database file are not supported on simple NFS.

/proc

The /proc filesystem is a memory based file system that allows access to process and kernel settings and statistics.

/var/lib/nfs/xtab

NFS Client mounted directories.

/var/lib/rpm

Directory where rpm database are kept.

2 GB {512B block size}

The oracle database can create files up to 64 GB with a 16 KB database block size.

2 TB {4KB block size}

The 32-bit kernel limits file and block devices to 2 TB.

2 TB with 4KB block size (on 32 kernel)

With ext3 and ext2, others vary.

ext3

Journal Filesystem types.

iso9660

CDROM file type.

reiserfs

Journal Filesystem types.

 

 

 

Linux Logical Volume Manager (LVM) Commands

Commands

Description

# lvchange

Change logical volume characteristics.

# lvcreate

Make logical volume.

# lvcreate –i 3 –I 64

Create striped volumes.

# lvdisplay

List logical volume.

# lvextend

Extend logical volume.

# lvreduce

Reduce logical volume.

# lvremove

Remove logical volume.

# pvchange

Modify physical volume.

# pvcreate

Prepare physical disk.

# pvdisplay

List physical volume.

# pvmove

Move logical volumes to another physical volumes.

# vgcfgrestore

Restore volume group.

# vgchange

Volume group availability.

# vgcreate

Create volume group.

# vgdisplay –v

Display volume group.

# vgexport

Exports volume group.

# vgimport

Imports volume group.

# vgreduce

Remove disk from volume group.

# vgremove

Remove volume group.

# vgscan

Volume group listing.

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.

LVM

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.

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.

 

 

 

 

 
 
Google
 
Web web site