Hamid

   
 
  UNIX Commands

1 Log In Session

 

1.1 Log In

Enter username at login: prompt. Be carefull - Unix is case sensitive.
Enter password at password: prompt.

 

1.2 Change Password

passwd

 

1.3 Log Out

logout or exit

 

2 File System

 

2.1 Create a File

cat >  file      Enter text and end with  ctrl-D
vi  file         Edit  file  using the  vi  editor 

 

2.2 Make a Directory

 

mkdir   directory-name

2.3 Display File Contents

 

cat   file    display contents of  file 
more  file    display contents of  file one screenfull at a time.
view  file    a read only version of vi. 
less  file    similar to, but more powerfull than more. 
              See the man page for more infomation on less.

 

2.4 Comparing Files

 

diff file1 file2   line by comparison
cmp file1 file2    byte by byte comparison

 

2.5 Changing Access Modes

 

chmod mode file1 file2 ...
chmod -R  mode dir (changes all files in  dir  )

 

 

    Mode Settings

 u  user (owner)
 g  group
 o  other

 +  add permission
 -  remove permission

 r  read
 w  write
 x  execute

 

Example: chmod go+rwx public.html adds read, write, and execute permissions for group and other on public.html.

 

2.6 List Files and Directories

 

ls        list contents of directory
ls -a     include files with "." (dot files)
ls -l     list contents in long format (show modes)

 

2.7 Move (or Rename) Files and Directories

 

mv src-file dest-file    rename src-file to  dest-file
mv src-file dest-dir     move a file into a directory
mv src-dir dest-dir      rename src-dir, or move to dest-dir
mv -i src dest           copy & prompt before overwriting

 

2.8 Copy Files

 

cp src-file dest-file    copy src-file to  dest-file
cp src-file dest-dir     copy a file into a directory
cp -R src-dir dest-dir   copy one directory into another
cp -i src dest           copy & prompt before overwriting

 

2.9 Remove File

 

rm file      remove (delete) a file
rmdir dir    remove an empty directory
rm -r dir    remove a directory and its contents
rm -i file   remove file, but prompt before deleting

 

 

2.10 Compressing files

 

compress file       encode file, replacing it with file.Z
zcat file.Z         display compressed file
uncompress file.Z   decode file.Z, replacing it with file

 

 

2.11 Find Name of Current Directory

 

pwd    display absolute path of working directory

 

2.12 Pathnames

 

simple:
One filename or directory name for accessing local file or directory.
Example: foo.c

 

absolute:
List of directory names from root directory to desired file or directory name, each separated by /.
Example: /src/shared

 

relative:
List of directory names from working directory to desired file or directory name, each separated by /.
Example: Mail/inbox/23

 

2.13 Directory Abbreviations

~           Your home (login) directory
~username   Another user's home directory
.           Working (current)  directory
..          Parent of working directory
../..       Parent of parent directory

 

2.14 Change Working Directory

 

cd /	   			go to the root directory
cd        			go to your login (home) directory
cd ~username 			go to username's login (home) directory
				not allowed in the Bourne shell
cd ~username/directory		go to username's indicated directory
cd ..				go up one directory level from here
cd ../..			go up two directory levels from here
cd /full/path/name/from/root	change directory to absolute path named 
 				note the leading slash
cd path/from/current/directory	change directory to path relative to here. 
				note there is no leading slash

 

3.0 Commands

 

3.1 Date

 

date    display date and time

 

3.2 Wild Cards

 

?    single character wild card
*    Arbitrary number of characters

 

3.3 Printing

lpr file            print file on default printer
lpr -Pprinter file  print file on printer
lpr -c# file        print # copies of file
lpr -d file         interpret file as a dvi file
lpq                 show print queue (-Pprinter also valid)
lprm -#             remove print request # (listed with lpq)

 

3.4 Redirection

command > file		direct output of command to file instead of
			to standard output (screen), replacing current 
			contents of file

command > > file	as above, except output is appended to the current 
			contents of file

command < file		command receives input from file instead of
			from standard input (keyboard)

cmd1 | cmd2		"pipe" output of cmd1 to input of cmd2

script file		log everything displayed on the terminal to file; 
			end with exit

 

4 Search Files

 

grep string filelist 		show lines containing string in any file 
				in filelist
grep -v string filelist 	show lines not containing string
grep -i string filelist 	show lines containing string, ignore case

 

5 Information on Users

finger user or
finger user@machine 	get information on a user
finger @machine 	list users on machine
who      		list current users

 

6 Timesavers

 

6.1 Aliases

 

alias string command     abbreviate command to string

 

6.2 History: Command Repetition

Commands may be recalled

history    show command history
!num       repeat command with history number num
!str       repeat last command beginning with string str
!!         repeat entire last command line
!$         repeat last word of last command line

 

7.0 Process and Job Control

 

7.1 Important Terms

pid		Process IDentification number.  See section 7.2.
job-id 	Job identification number. See section 7.2.

 

7.2 Display Process and/or Job IDs

ps       report processes and pid numbers
ps gx    as above, but include "hidden" processes
jobs     report current jobs and job id numbers

 

7.3 Stop (Suspend) a Job

 

ctrl-Z    NOTE:process still exists!

 

7.4 Run a Job in the Background

 

To start a job in  background add & to the end of the command. 
Example: xv foo.gif &

To force a running job into the background:
ctrl-Z    stop the job
bg        "push" the job into the background

 

7.5 Bring a Job to the Foreground

 

fg              bring a job to foreground
fg %job-id      foreground by job-id (see 7.2)

 

7.6 Kill a Process or Job

 

ctrl-C                 kill foreground process
kill -KILL pid#        see 7.2 for 
kill -KILL %job-id#    displaying  pids & job-ids 

 

8.0 Mail Handler (MH)

MH commands are issued directly to the terminal.

 

inc        incorporate new mail
scan       show list of mail messages
show       show current message
next       show next message
prev       show previous message
repl       reply to current message
forw       forward current message
comp       compose a mail message
rmm        remove current mail message
cmd -help  print help on mh commmand cmd 

 

The file .mh_profile is used to enable/disable MH features. man mh-profile for more information.

9.0 On-line Assistance

On-line Documentation

man command-name   display on-line manual pages
man -k  string     list one-line summaries of manual pages containing string




Comments on this page:
Comment posted by WilbSwateRef( milotry-rx.com ), 06/20/2017 at 11:47pm (UTC):
Cialis Lilly Icos 5 Mg <a href=http://genericvia.com/viagra-discount-sales.php>Viagra Discount Sales</a> Can Pregnant Women Take Amoxicillin Cialis Cout <a href=http://xenical.ccrpdc.com/how-to-order-xenical.php>How To Order Xenical</a> Viagra Discount Keflex Expansion Joint <a href=http://viasamples.com/cheap-viagra-fast.php>Cheap Viagra Fast</a> Levitra 20mg Tablets Mfg Gsk Generic Drugs <a href=http://buy-tadalafil-online.BuyCial.com>Buy Tadalafil Online</a> Viagra Without Prescription In Canada Comprar Viagra Sin Receta En Valencia <a href=http://cheapcial.com/order-cialis-tablets.php>Order Cialis Tablets</a> Viagra Naturale Nel Cibo Cialis Laboratorios Lilly <a href=http://cialcost.com/buy-tadalafil.php>Buy Tadalafil</a> Propecia Ritenzione Idrica Viagra Prezzo <a href=http://brandcial.com/cialis-buy-online.php>Cialis Buy Online</a> Cialis Sin Disfuncion Erectil

Comment posted by WilbSwateRef( milotry-rx.com ), 06/15/2017 at 4:36pm (UTC):
Stilnox <a href=http://viagra-online-usa.viaforsale.com>Viagra Online Usa</a> Pflanzliches Viagra Horn Kapseln Viagra Significado <a href=http://generic-cialis.tadalaf.com>Generic Cialis</a> Buy Norinyl Without Prescription Medicamento Comprar Propecia <a href=http://propecia-drugs.propecorder.com>Propecia Drugs</a> Cialis Ohne Rezept Hannover Doxycycline Fda Approved Online <a href=http://kamagra-soft-tablets.kamagorder.com>Kamagra Soft Tablets</a> Combining Amoxicillin And Ciprofloxacin Pflanzliches Viagra Horn <a href=http://etrobax.com>cialis</a> Effect Of Tadalis Sx Soft Necesito Tomar Cialis <a href=http://buylevitraeufast.com/generic-levitra.php>Generic Levitra</a> Lasix Dosage Viagra Levitra And Cialis <a href=http://levipill.com/order-levitra.php>Order Levitra</a> Levaquin Anthrax Internet Cash Delivery Pharmacy Purple Viagra Pills <a href=http://BuyCial.com>Buy Cialis</a> Propecia 1mg Difference 5mg Purchase Cheap Cephalexin Without Prescription <a href=http://mail-order-viagra.canadianvia.com>Mail Order Viagra</a> Buy Ciprofloxacin 500 Mg Online Que Espana La Propecia <a href=http://buy-propecia-brand.propecpills.com>Buy Propecia Brand</a> Kamagra Gels Baclofene Amm 2012 <a href=http://cialcheap.com/buy-generic-cialis.php>Buy Generic Cialis</a> Viagra Jelly For Sale Uk 123 Acheter Cialis Pour Femme <a href=http://genericvia.com/buy-25mg-viagra-online.php>Buy 25mg Viagra Online</a> Buy Cialis On Line Cherche Viagra Strasbourg <a href=http://viasamples.com/viagra-online-online.php>Viagra Online Online</a> Propecia 20mg Prednisone Without A Script <a href=http://generic-cialis-100mg.cial5mg.com>Generic Cialis 100mg</a> Cheap Tadalafil Generic Why Amoxicillin Before Surgery <a href=http://leviplus.com/vardenafil-levitra.php>Vardenafil Levitra</a> Acquistare Kamagra Bordeaux Puedo Tomar Viagra Con 18 Anos <a href=http://cialis.cialpills.com/cost-of-cialis.php>Cost Of Cialis</a> Buy Liquid Kamagra

Comment posted by Marvamots( amatry-rx.com ), 05/07/2017 at 3:45am (UTC):
Cialis Composizione Quiniela De Propecia Vendita Cialis Online Italia <a href=http://byuvaigranonile.com>viagra</a> Viagra Generika Sicher Und Schnell Fucidin Cialis No Prescription From Canada Levitra Sirve Para Aguantar Mas



Add comment to this page:
Your Name:
Your Email address:
Your website URL:
Your message:

Login
 
Username:
Password:
Advertisement
 
Donate
 
You can help this website
by donate or
you can click an
advertisement.

IGNOU Students
 
Sample Synopsis

Time Table BCA 2009
Projects (Vb n ASPnet) : Download
Synopsis Form

Training Letter

Guide Remuneration Form

Certificates of Originality

Java KeyWords - PDF

Java KeyWords - Wikipedia


Click Here / Click Here

Edit Plus (Use it as Java editor) Download

How to configure EditPlus to compile JAVA codes click here


Advertisement
 
PC Games (Full, Rip, Compressed)
 
 
© 2007 - 2009 HamidRaza - Today, there have been 9 visitors (80 hits) on this page!
=> Do you also want a homepage for free? Then click here! <=