GNU Linux Tutorial - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

GNU Linux Tutorial

Description:

Common linux directory structure. Next. Starting off with Linux ... Bash shell most popular history, command line editing, rich customization ... – PowerPoint PPT presentation

Number of Views:685
Avg rating:3.0/5.0
Slides: 17
Provided by: sslSercI
Category:
Tags: gnu | common | linux | touch | tutorial

less

Transcript and Presenter's Notes

Title: GNU Linux Tutorial


1
GNU / Linux Tutorial
  • SERC Students' Activities
  • Aug 26, 2006

2
Topics
  • Background
  • Starting off with GNU / Linux
  • Programming Environment
  • Text Processing
  • Installing Packages
  • Editors
  • Introduction to Scripting in Bash and Perl
  • Hands-on session

Next
3
Starting off with Linux
  • Has always been a command-line based system
  • Currently very good GUI support
  • Many distributions of linux like SuSe, Gentoo,
    Fedora, Debian
  • Distributions differ in the number of
    customizations, customer support, package
    management, release cycles etc
  • Common linux directory structure

Next
4
Starting off with Linux ...
  • /etc configuration files, init scripts ...
  • /home user home directories
  • /usr sources, include files, shared files,
    libraries, local installations ...
  • /lib - libraries
  • /bin - executables
  • /opt optional software
  • /boot kernel image
  • /proc kernel data structures

Next
5
Basic commands
  • Bash shell most popular history, command line
    editing, rich customization
  • Startup .bashrc, .cshrc
  • Environment variables PATH, PS1, SHELL,
    TERM, EDITOR, HOME
  • Basic commands
  • cd ls pwd
  • echo export
  • alias
  • cat head tail touch
  • date cal
  • whoami id finger
  • man apropos info
  • top ps kill
  • find locate
  • grep more less ...

Next
6
Bash Shell Tricks
  • Moving around
  • ctrl-a ctrl-e alt-b alt-f
  • Letter case
  • alt-u alt-l alt-c
  • !!, !1, !2, !x
  • History ctrl -r
  • reset
  • edit mode
  • prompt customization
  • Escape character
  • ctrl-v
  • Delete words
  • ctrl-w ctrl-u
  • Kill rings ctrl-y alt-y
  • Clear ctrl-l

Next
7
Pipes, Redirection, Indirection
  • Everything is a file
  • String together a bunch of simple commands to
    achieve a complicated task
  • cmd1 cmd2 ....
  • cmd1 gt some_file
  • cmd1 lt input_file gt output_file
  • append command gtgt output_file
  • tee
  • stdin 0, stdout 1 , stderr 2
  • /dev/null, /dev/dsp ....

Next
8
Process management
  • An interactive tool to observe load, mem usage,
    cpu usage, user, command executed, send signals,
    process state
  • Can you 'top' this ?
  • ps show processes on a machine, output format
    specifier
  • Foreground, background processes
  • Be 'nice' to your sysadmin else she'll 'kill' you
  • Jobs 1, 2 ...
  • Exit values of a process ?

Next
9
Remote login, Finding files, finding help ...
  • Logging in with ssh
  • Exporting X server
  • Password less login with ssh-agent
  • scp
  • Find search files, directories etc
  • Locate Faster, update regularly
  • man
  • apropos
  • info
  • Net forums, mailing lists
  • RTFM

Next
10
Compress, Backup, cron
  • Save disk space
  • Compress using gzip, bzip2, zip
  • Uncompress gunzip, bunzip2, unzip
  • Viewing zip files zcat, zmore
  • Regularly backup your important files
  • Cron to run commands at regular intervals
  • Man crontab

Next
11
Progrmming Environment
  • Languages supported C, C, Fortran ??
  • Debugger gdb
  • compile with -g option
  • Breakpoints, frames, watch, conditional
    breakpoints
  • Makefile
  • Example
  • Editors vi , emacs
  • Code browsers cscope, etags, ctags, sourcenav
  • Configuration management RCS, CVS

Next
12
Installing software
  • Compile from source
  • Read the README
  • Configure set the correct flags
  • make and install
  • Just install an RPM
  • Dependency management is a problem
  • New tools yum, apt, yast

Next
13
Text processing
  • grep
  • cut
  • awk
  • sort
  • sed
  • Lots of help available on the net
  • Examples

Next
14
Vi, Emacs
  • Vi one of the oldest editors
  • Mode based editor Command mode, insert mode,
    colon mode, visual mode ...
  • customized using /.exrc
  • http//heather.cs.ucdavis.edu/matloff/ViIntro.htm
    l
  • Emacs Extensible editor, better
  • Most of the commands that appear in bash can be
    used in the emacs
  • Customised using emacs-lisp. in /.emacs
  • http//heather.cs.ucdavis.edu/matloff/Emacs.html

Next
15
Introduction to scripting
  • Scripting in Bash , Perl, Python, csh etc etc
  • Bash supports arrays, functions and anything that
    you can call from the shell
  • Perl Prototyping, Extraction and Reporting
    Language
  • Scalars, Lists, Hash Maps
  • Rich set of libraries
  • Language extensions

Next
16
Thank you
  • GNU/Linux/Unix Has a 'steep' learning curve,
    but you have to learn it only once
  • Use the Internet
  • Read The Freakin' Manual

Exit
Write a Comment
User Comments (0)
About PowerShow.com