Unix - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Unix

Description:

display the path of the current directory. Command. Meaning. cp file1 file2 ... Go to your home space 'root directory' (type cd) ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 15
Provided by: cseOhi
Category:
Tags: directories | unix

less

Transcript and Presenter's Notes

Title: Unix


1
Unix
  • Based on tutorial at
  • http//www.ee.surrey.ac.uk/Teaching/Unix/unix3.htm
    l

2
Outline
  • Commands
  • Environment Variables

3
Basic Commands
4

5
(No Transcript)
6
Some quick commands
7
Killing a process
  • To list jobs
  • jobs
  • To bring the last job to the foreground
  • fg
  • To run the suspended job in the background
  • bg
  • To list the process ID of the processes
  • ps aef grep prasun
  • To kill the process
  • kill -9 ltprocessIDgt

8
Environment Variables
ENVIRONMENT variables are set using the set
command, displayed using the set, printenv or env
commands, and unset using the unset command. To
show all values of these variables, type
printenv less echo PATH /usr/local/bin/usr
/ccs/bin/usr/bin/usr/dt/bin/usr/openwin/bin/us
r/ucb/usr/local/teTeX/bin/usr/contrib/bin. P
ATH
9
apropos
When you are not sure of the exact name of a
command, apropos keyword will give you the
commands with keyword in their manual page
header. For example, try typing apropos copy
10
Man pages
There are on-line manuals which gives information
about most commands. The manual pages tell you
which options a particular command can take, and
how each option modifies the behaviour of the
command. Type man command to read the manual page
for a particular command. For example, to find
out more about the wc (word count) command, type
man wc Alternatively whatis wc gives a
one-line description of the command, but omits
any information about options etc.
11
Man page sections
-l Lists all manual pages found matching name
within the search path. man -l
socket socket (3socket) -M /usr/man socket
(3head) -M /usr/man socket (3xnet) -M
/usr/man socket (n) -M /usr/local/man socket
(3socket) -M /usr/share/man socket (3head)
-M /usr/share/man socket (3xnet) -M
/usr/share/man socket (n) -M
/usr/local/man socket (3socket) -M
/usr/share/man socket (3head) -M
/usr/share/man socket (3xnet) -M
/usr/share/man socket (n) -M
/usr/local/man socket (3socket) -M
/usr/share/man socket (3head) -M
/usr/share/man socket (3xnet) -M /usr/share/man
12
Access Man page by section
man s 2 read Read section 2 of the man
page echo MANPATH Echoes the paths where man
pages will be searched for
13
Editing PATH variable
  • Editing your .bashrc file
  • Go to your home space 'root directory' (type cd)
  • Use your favorite text editor (e.g. type xemacs
    .bashrc)
  • There should be a line looking like
    PATHPATHblabla.If there is not, just add
    one.
  • You can also change your path variable by
  • export PATHPATH/WWW/ echo PATH

14
Other pointers
  • Read man pages to learn other commands such as
  • gzip, cat, zcat, diff, find, history, diff,
    more, less, source
  • Bash Shell
  • http//www.gnu.org/software/bash/manual/bashref.ht
    mlBourne-Shell-Variables
  • Debugger
  • Debugging a multi-process program is difficult
    with a debugger such as gdb
  • Lots of printf is strongly recommended during
    development
Write a Comment
User Comments (0)
About PowerShow.com