dvdrecord -scanbus = lists dvd devices

df -h = free hard drive space

df = free hard drive space

du -sh = disk usage

du -h = hard drive usage

dialog –msgbox “Hello” 8 12 = create dialog box

dialog –title “Check me” –checklist “Pick numbers” 12 15 2 1 “First” “on” 2 “Second” “off” = create checklist

echo $SHELL = prints the default shell name

echo $OSTYPE = prints the operating system name

echo ‘text’ = prints what is held in the quotes

echo $HOME = prints home directory

echo $USER = who is currently using the system

echo $HISTFILE = location of history file

echo $HISTFILESIZE = history’s set size

echo $HISTSIZE = history’s set size

echo “test” | mail -v -s test xyz@abc.com = sending e-mail from a terminal

ethtool eth0 = info about ethernet connection

ethtool -i eth0 = driver for ethernet

ethtool -S eth0 = statictics for ethernet

ethtool l0 = info about local loop

egrep “one/two/three” filename = looks for any of these 3 words in a file

env = prints all environment variables

expr 7 + 8 = simple command based calculator (mind the spaces in the equation)

/etc/init.d/httpd status = service status

/etc/init.d/mysqld start = starts mysql server

/etc/init.d/oracle-xe start = starts oracle server

exec ls -l = runs ls command and closes the terminal

exec uptime = runs uptime command and closes terminal

fc -l = short command history

fdisk -l = list of partitions on the hdd

fdisk -l /dev/hda = partitions within a specific partition

fdisk /dev/hda = master device on IDE channel 0

fdisk /dev/hdb = slave device on IDE channel 0

fdisk /dev/hdc = master device on IDE channel 1

fdisk /dev/hdd = slave device on IDE channel 1

find /usr/bin -amin -30 = finds files accessed in last 30 minutes in /usr/bin

find /usr/bin -atime +50 = finds files not accessed for than 50 days

find /usr/bin -perm 750 = finds files with permission 750

find /usr/bin -user root = finds files owned by root in /usr/bin

find /usr/bin -user root | wc -l = calculates total no of files owned by root

find ! /usr/bin -user root = finds files not owned by user root

find ! /usr/bin -user root | wc -l = calculates no of files not owned by root

find -iname filename.ext = finds a file by name

find . = lists all files and subdirectories in the current directory

find . -size +200M = finds files more than 200M in size

find . -size +200M -ls = more details

find . -name *.txt -size +40K = finds .txt file names of more than 40 k in size

find /usr/share/docs | xargs grep -l ‘keyword’ = finds files that contain the keyword from documents

finger = log in details

free = memory usage in kb

free -b = memory usage in mb

free -m = memory usage in blocks

free -mt = memory usage in totals

free -g = memory usage in gigabytes

free -s 5 = update memory usage every 5 seconds

fuser -amuv /boot = shows processes with /boot open (a = all, m = man, u = user, v = verbose)

fuser /boot = shows parent pids for processes opening /boot

fuser -m /boot = shows pids for processes opening /boot

fuser -u /boot = shows pids for user

fuser -k /boot = kills all processes with /boot files open

fuser -l = lists supported signals

fuser -k -HUP /boot = kills all processes running /boot by sending HUP signal

getenforce = status of selinux

gdmsetup = display configuration client/gui

glxinfo = graphics card info

glxinfo | direct = check if direct randering is on

gnome-terminal -x alsamixer = stars terminal with alsamixer displayed

gnome-terminal -tab -tab -tab = stars terminal with 3 open tabs

gnome-terminal -geometry 80*20 = stars terminal 80 characters and 20 lines

gnome-terminal -zoom=2 = stars terminal with larger fonts

grep india /usr/share/dict/words = looks for the word ‘india’ in dictionary

grep “word” filename.txt = prints lines with the “word ” in them

grep –color “word” filename.txt = prints lines with the word in color

grep 300 filename.txt = prints lines with 300 in them

grep -n “word” filename = line numbers with the word in them printed

grep -vn “word” filename = lines without the “word” in them

grep -c “word” filename = total no. of occurrences of “word”

grep -n “word” * = lists all lines from all files that contain “word”

grep -R myword /etc/bin* = lists lines with their file names in the directory containing myword

grep -h -R myword /etc/bin* = lists lines without their file names containing myword

grep -Rn myword /etc/bin* = lists lines containing myword with their numbers

grep –color -R myword /etc/bin* = lists lines in the directory containing myword in color

grep -Rl myword /etc/bin* = lists file names in the directory containing myword

grep -x “word” * = only “word” a line

grep word filename.txt = searchers for the word in the file (case sensitive)

grep word -n filename.txt = lists lines containing word with their numbers

grep -i word filename = searchers for the word in the file (i = not case sensitive)

grep -i word1 word2 filename = searchers for the word in the file

groups = list of groups

gzip = only zips, gunzip = unzips + untars, tar = zips + unzips with czvf, xzvf

gzip abc.txt = zips a file

gzip -1 abc.txt = fast compression but poor quality

gzip -9 abc.txt = slow compression but good quality

gzip -rv foldername = zips all files in the folder

gzip -tv abc.txt.gz = checks integrity if gz file with verbose

gzip -lv abc.txt.gz = gives info about gz file

gunzip -v abc.txt.gz = unzips gz file with verbose

gunzip -c abc.tar.gz | tar x = unzips and untars a file (two steps)

gunzip abc.tar.gz; tar xf abc.tar = unzips then untars a file (two steps)

hal-device-manager = opens a gui for hardware profiling

head -6 .bash_history = first 6 commands

head -5 filename.txt = prints first 5 lines of the file

head -n 5 filename.txt = prints first 5 lines of the file

history 5 = last five commands

history | wc -l = total history commands

history | grep rpm = search through history for rpm commands

history = list of all commands used so far

hostname = name of the host

hwclock –show = prints today’s date and time

hwclock –set –date =”2/22/2008 12:25:30” = reset new time and date

identify imagename.jpg = gives image info

identify -verbose imangename.jpg | less = gives info about image

identify -verbose imangename.jpg | more = gives more info about image

id = info about user/root’s groupid/uid etc

ifconfig = network card info, ipaddress etc.

ifconfig -a = available network cards

info coreutils = info about core commands

iostat 3 = checks disk reads

iostat -c 3 = updates cpu usage

iostat -c -t = cpu usage with time

iostat -c -t 2 10 = repeat cpu usage info every 2 seconds 10 times

ip a = available network interfaces

ip addr = ip addresses by method of connection ie ppp0

ip addr show eth0 = ip address for ethernet connection

ip calc -bnm 192.168.0.1/27 = displays netmast ip from CIDR

ip route = checks routing table

isoinfo = info about iso

iwconfig = checks for wireless connection

iwlist = checks for a wireless access point

kded –version = kde version

kde-config –version = kde version

kill 23456 = kills process with id 23456

kill -9 1234 = sends SIGKILL to id 1234

kill -SIGCONT 1234 = sends SIGCONT to id 1234

kill 4% = kills the process represented by 4% job

kill sttd = kills all sttd daemons running

last = last log in details

lastlog [-u root] = last log in time

last [root] = entire log in history, the feature needs to be activated first

lastb [root] = prints failed login attempts

less filename.txt = prints contents of the file, scroll bar fixed, Press q to quite and spacebar to go to another page

less filename.txt = prints contents of the file, scroll bar fixed, press spacebar

less filename /word = searches for word

ln -s originalfile newfile = creates a symbolic link to new file

locate xyz = locates file xyz case-sensitive

locate -i xyz = locates file xyz not case-sensitive

locate -r /ls$ = locates files ending in /ls

locate -r james*bond = locate files with james and bond in their names

locate -r ^ boot/grub/me = locate files beginning with boot/grub/me

locate *.jpg > Desktop/myjpgs.txt = stores results of search in a file named myjpgs.txt

lsmod = lists kernel modules installed

lsmod | sort -k 2,2n = sorts kernel modules in increasing size order

ls /var/www/html/*.html = lists all html files

ls .??* = lists all directory names that start with a dot .

ls /etc/rc.d = prints all directories for all available run levels

ls /etc/rc.d/init.d = list of system services’ scripts

ls -l = lists files and folders in the current directory

ls -la = lists hidden files and folders in the current directory with a dot

ls li = files with their inodes

ls -lt = files recently modified

ls -lu = lists files by their accss time

ls -ln = user names and groups numerically displayed

ls -lh = human readable file sizes

ls -lR = displays all the files and their folders

ls -F = lists files by type

ls -c = lists files columnwise

ls –color =always = shows filenames in colors

ls -l /var/lib/rpm = rpm database

ls = lists contents of a directory

ls . = lists contents of a directory

ls .. = lists contents of a directory

ls / = lists all system directories

ls = lists directories in current directory

ls /var = lists all subdirectories under the /var directory

ls /proc | wc -l = number of subdirectories in /proc directory

ls -ltr =

ls -l filename.ext = checks permissions for a file

ls -l /etc = permission status of all subdirectories

ls -a = shows hidden . Dot directories. A kind of special configuration files not be messed with

ls tr | ‘\n’ ‘ ‘ = replaces all newline characters with spaces

ls tr | -d ‘\n’ = deletes newlines

ls /var/lib/mysql = list of databases in blue color

lsof = list of open directories and files

lsof -c bash = list of files open by bash shells

lsof -d cwd = list of directories open as current working directory

lsof -u james = list of files and directories open by user james

lsof /mnt/sda1 = list of anything open on /mnt/sda1 file system

lsof +d /mnt/sda1/dx = list of anything open under /mnt/sda1/dx directory

lpadmin = Linux printer details

lspci = info about pci devices/ports

lspci | grep VGA = graphics card info

lspci | grep audio = audio card info

lspci | grep -i modem = modem info

lspci | grep -i usb = usb ports info

lspci | grep -i ethernet = ethernet card info

man -f php = info about php modules

man -k php = info about php modules

man php = php manual pages

man man = info about manual pages and their format

man 3 php = shows entries for php in 3rd section of the manual

man php | grep word = searches for a particular word in php manual

man hier = info about directories

md5sum xyz.iso = checksum verification

more filename.txt = shows contents of a file page by page (press spacebar)

mount = files system type per device

mount /mnt/cdrom = mounts cd rom

mysql = launches mysql

mysql -u root -p = asks for a password to launch mysql

my old.txt new.txt = renames a file

netstat = info about active Internet connections

netstat -i = netstat statictics

netstat -tanp = shows active tcp connections

netstat -uanp = shows active udp connections

od -c -t x1 filename.txt = list of newline characters in Linux

ogg123 mysong.ogg = plays ogg file

ogg123 http://xyz.com/music/audio.ogg = plays from web address

ogg123 -z *.ogg = play files in pseudo-random order

ogg123 -Z *.ogg = same -z, but repeats forever

ogg123 /var/music/ = plays songs in /var/music and sub dirs

ogg123 -@myplaylist = plays songs from playlist

pgrep httpd = gives process id for httpd

pgrep -l init = gives process id for processes containing init as string

ps -lu james = all processes owned by james

php –help = shows all php help pages in full

php –help | less = shows limited php help pages, scroll bar fixed, q to exit

php -v = php version

php –version = php version

pirut =

passwd = asks for a new password for root

play musicfilename.wav = plays music file

play *.wav = plays all wav files upto 32

play audio.au vol. 6 = plays audio file with volume level 6

play -r 12000 short.aiff = sampling rate of 12000

ps ajfx = process hierarchy in BSD style

ps ax = lists all running processes

ps aux = lists all running processes with BSD cycle

ps auwx = running processes with wide format

ps auwwx = running processes with unlimited width

ps auwx | sort -r -k 4,4 = sort processes on descending memory usage

ps auwx | head -4 = prints first 4 lines of a process

ps auwx | head -n 4 = prints first 4 lines of a process

ps auwx | tail -4 = prints last 4 lines of a process

ps auwx | tail -n 4 = prints last 4 lines of a process

ps auwx | less = shows contents of a process, scroll bar fixed

ps auwx | more = shows contents of a process page by page (press spacebar)

ps auwx | grep init = shows lines containing init in them

ps auwx | grep “\[*\]” = shows bracketed comments

ps = list of processes by current user in current shell

ps -C httpd = process info for http

ps -p 5323 -o pid,ppid,bsdtime,args = process info for id 5323

ps -U james,john -o pid,ruser,tty,stat,args = process info for 2 users

ps -e = lists all running processes

ps -e | wc -l = number of all running processes

ps -ef = lists all running processes with format listing

ps -ef –forest = process hierarchy in forest format

ps -eF = lists all running processes with full format listing

ps -ejH = process hierarchy

ps -el = lists all running processes with long listing

ps -eo ppid,user,%mem,size,vsize,comm –sort=-size = multiple parameters

ps -eo ppid,user,bsdstart,bsdtime,%cpu,args –sort=-%cpu = multiple parameters

ps -eo ppid,user,bsdstart,bsdtime,%cpu,args –sort=-%cpu = multiple parameters

ps -eo ppid,user,stat,tname,sess,cputime,args –sort=user = multiple parameters

pstree = processes in alphabetical order in tree format

ps -u root = list of processes run by user root

ps -u root u = list of processes run by root with cpu usage

ps -fu root = list of processes run by root with PPID

pwd = current working directory

pwd -P = one level up from current working directory

pwd -L = one level down from current working directory

printenv | less = prints all environment variables

ps -ef | grep root = processed owned by root

ramsize = info about ram

reboot = reboots the pc

redhat-logviewer = opens a GUI tool for log monitoring

repoquery -il tomcat5 = list of files in tomcat5 package in any repo

repoquery –provides php = info about php modules

rm ~/.bash_history = clears history of commands

rm -f *.doc = removes/deletes all files of .doc extension in a folder

rpm2cpio xyz.rpm > xyz.cpio = extracts cpio archive from rpm package

rpm2cpio xyz.rpm | cpio -tv = lists the contents of archive

rpm -e xyz = removes package xyz

rpm -e –nodeps xyz-5.6.fc5.i386 = removes 32+ bit version of package if more versions available

rpm -ivh xyz.rpm = install package xyz (i=install, v=verbose, h=hash)

rpm -ivh http://ftp.abc.com/xyz.rpm = install package xyz from the site

rpm -Uvh xyz.rpm = update package xyz (U=update)

rpm -q –scripts kernel |less = list of all preinstall & post-install scripts

rpm -q php = php version no.

rpm -qi php = php install info

rpm -qi fedora-release = Fedora installation info

rpm -qi php/per/python/ruby = version info for the package

rpm -qa grun = prints grub version no.

rpm -qa php = prints php version no.

rpm -qa | sort | pr –column=2 | less = shows installed packages in 2 columns per page

rpm -qa | sort | pr –column=2 > abc.txt = saves output to a file

rpm -qa | sort | pr –column=2 | lpr = sends output to a printer

rpm -qa | grep kernel | sort = sorts installed packages in alphanumeric order

rpm -qa | grep kernel | sort -r = sorts in reverse alphanumeric order

rpm -qa | grep php = prints version nos. of all php related packages

rpm -qa | head = only 10 softwares listed

rpm -qa | head -n5 = first 5 software listed

rpm -qa | wc -l = total no of packages installed on the system

rpm -ql php = lists all files in a particular package

rpm -qal | grep php = find php in all installed packages

rpm -ql php | wc -l = total no. of files in a particular package

rpm -qa | grep php | wc -l = count the total number of php modules

rpm -qf /var/lib/php = what package a particular file belongs to

rpm -q –scripts mysql = scripts of a package

rpm -qa php | wc -l = total no. of php packages

rpm -qi php = info about php

rpm -q –last php = installation date of php

rpm -qi php | grep -i vendor = php vendor name

rpm -qi fedora-release | grep -i vendor = prints vendor name from a file named fedora-release

rpm -v = rpm version

rpm -qa –queryformat ‘%{NAME}==%{VENDOR}\n’ | grep -v “Red Hat” | sort =
list of installed packages with their vendor names except Red Hat

rpm -qa –qf ‘%{NAME}==%{VENDOR}\n’ | grep “Red Hat” | sort = list of installed packages with their vendor name as Red Hat

rpm -qa –qf ‘%{NAME}==%{VENDOR}\n’ | sort = list of installed packages with their vendor names

rpm -qa –qf ‘%{NAME}==%{VENDOR}\n’ | grep “Red Hat” | wc -l = total number of installed packages with Red Hat as their vendor

rpm -qa –qf ‘%{NAME}==%{LICENSE}\n’ | sort = list of all installed packages with their licence type sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{LICENSE}\n’ | wc -l = total number of installed packages with their licence type

rpm -qa –qf ‘%{NAME}==%{LICENSE}\n’ | grep php | sort = list of all php packages with their licence types sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{LICENSE}\n’ | grep php | wc -l = total number of all php packages with their licence types

rpm -qa –qf ‘%{NAME}==%{SIZE}\n’ | sort = list of all installed
packages with their names and sizes in bytes sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{SIZE}\n’ | grep php | sort = list of all php
packages with their names and sizes in bytes sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{SIZE}\n’ | grep php | wc -l = total number of
installed php packages with their names and sizes in bytes

rpm -qa –qf ‘%{NAME}==%{SUMMARY}\n’ | sort = list of all installed
packages with their names and functions sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{SUMMARY}\n’ | grep php | sort = list of all php
packages with their names and functions sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{SUMMARY}\n’ | grep php | wc -l = total number of all php packages with their names and functions

rpm -qa –qf ‘%{NAME}==%{BUILDHOST}\n’ | sort = list of all installed
packages with their names and buildhosts sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{BUILDHOST}\n’ | grep php | sort = list of all
php packages with their names and buildhosts sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{BUILDHOST}\n’ | grep php | wc -l = total number of all php packages with their names and buildhosts

rpm -qa –qf ‘%{NAME}==%{URL}\n’ | sort = list of all installed packages with their names and urls sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{URL}\n’ | grep php | sort = list of all php packages with their names and urls sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{URL}\n’ | grep php | wc -l = total number of all php packages with their names and urls

rpm -qa –qf ‘%{NAME}==%{ARCH}\n’ | sort = list of all installed
packages with their names and architecture type sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{ARCH}\n’ | grep php | sort = list of all php
packages with their names and architecture type sorted alphabetically

rpm -qa –qf ‘%{NAME}==%{ARCH}\n’ | grep php | wc -l = total number of all php packages with their names and architecture type

rpm –querytags = list of all rpm query tags

rpm –querytags | wc -l = total number of rpm tags

rpm -Va = verify all installed packages

rpm -Va | grep php = verify php packages only

rpm -Vv | grep php = check php packages only with verbose

root = superuser, who has permission to do anything

/root = root account’s home directory

sha1sum xyz.iso = checksum verification

stat filename = prints access/modification right to a file

set = list of all enviornmental variables

set | wc -l = total number of enviornmental variables

set history = 60 = history of commands set to 60

set | less = prints all shell variables, scroll bar fixed

setserial -g /dev/ttys0 /dev/ttys1 /dev/ttys2 /dev/tty3 = info about serial ports

setserial -ga /dev/ttys0 = info about one serial port

stty -F /dev/ttys0 -a = info about serial port

service httpd start = starts apache server

service mysqld start = starts mysql server

service –status-all = service status of all the services installed

shutdown = shutdowns the pc

shutdown -r = reboot

shutdown -0 (Zero) = reboot

shutdown – h = halt

Leave a Reply

Your email address will not be published. Required fields are marked *