SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Command Line Basics
Section Overview
 X Windows
 Consoles and Terminals
 UNIX Commands
 UNIX Filesystem
 vi Editor
X Windows
 Familiar GUI interface
 Virtual screens
 Remote applications
 X-Terminal Windows
     Multiple concurrent session
     Scroll bars
     Cut, Copy & Paste
X Managers &
Environments
 X Window Managers
     Very configurable
     A lot of variety
     GUI login mode
 X Window Environment
     Fully integrated environment
     Window manager runs within the
      environment
Why use the command
line?
 Always available
     GUI not installed/working
     Remote sessions
 More efficient
 More powerful
 Better understanding of what is
 happening
UNIX Terminals
 Old Days
     Hardwired – serial connections
     Modems – remote connections
 Network – telnet
 Console
     Monitor/keyboard/mouse on system
     Boot/error messages display
     Headless servers
Virtual Consoles in Linux
  Multiple sessions on one console
  Special Consoles
     Console 1 – default console
     Console 7 – X Windows
  Toggling between consoles
     Text mode - <Alt><Fn>
     X Windows - <Ctrl><Alt><Fn>
     <Fn>: Function Key (n = 1 .. 7)
Basic Philosophy
 10% of work solves 90% of
 problems
 Smaller is better
 Portability
 Solve at right level

   Be Creative!!!
Command Anatomy 101

command [-switches] [arg1] [arg2]…

 Command: Name of the program
 Switches: Modify command’s behaviour
 Arg#: Arguments passed to command
Getting Help
 Online manual available
 Searchable
     Command/File name
     Type/Section
     Keyword
 Not always easy to understand
Man Page Sections
  Solaris   Linux            Contents
    1         1     User commands
    2        2      System calls
    3        3      Library calls
    4        5      File formats
    5        7      Misc. files and documents
    6        6      Games and demos
    7        4      Devices/Network protocols
   1m        8      Administration commands
    9        9      Kernel specs/interfaces (?)
Using man
 man command
     Look up command
 man n intro
     Contents of section n
 man –k string
     Search short descriptions (apropos)
 man –K string
     Search all man pages for string
Account Related
Commands
 login
     Start session
 passwd
     Change Password
 logout / exit
     Close session
File/Directory Commands
 Files                   Directories
     cp – Copy             ls – List contents
     mv –                  mv – Move/Rename
      Move/Rename           cd – Change Dir
     rm – Remove           pwd – Current Dir
     cat – View all        mkdir – Create
     more – View page      rm/rmdir – Remove
     less – View page
Copies, moves, and
renaming
  cp file1 file2|dir1
     Copy file1 to file2 or into directory dir1
  cp –r[p] dir1 dir2
     Copy directory dir1 to dir2
  mv file1 file2|dir2
     Moves file1 to file2 or into directory
      dir1
     Renames file1 to file2 if both in same
      directory
Viewing files
  cat file1
      Display the contents of file1 to the
       screen
  more file1
      Display the contents of file1 one
       screen at a time
  less file1
      Same as more but more powerful
Removing files and
directories
  rm file1 file2 ...
      Removes list of files
  rmdir dir1
      Removes dir1 only (if it is empty)
  rm -r dir1
      Removes dir1 and all
       subdirectories/files
      VERY Dangerous!!!
Other directory commands
  ls [-la] [file/dir list]
     Lists files in a directory
  mkdir dir1
     Creates directory dir1
  cd dir1
     Makes dir1 the current directory
  pwd
     Displays the current directory path
UNIX Filesystem Hierarchy
                                / (root)




 bin    sbin   home    etc     boot    root       usr         var         dev   lib




       scott   alice    bob      bin       sbin     local           lib         tmp




n321   mail        public_ht     bin       man          lib         share       src
                      ml
So many bins…
                               / (root)




             bin        sbin                usr




 bin directories: User programs       bin   sbin         local
 sbin directories: System
 programs
 /bin & /sbin – Needed at boot
 time
 /usr/bin & /usr/sbin – available                  bin           sbin
 when system fully operating
Windows Files/Directories
 UNIX/Linux              Windows
/usr          %SystemRoot% (C:Windows)
/bin &        %SystemRoot%System32
/usr/bin
/dev          %SystemRoot%System32Drivers
/etc          %SystemRoot%System32Config
/tmp          C:Temp
/var/spool    %SystemRoot%System32Spool

                        Source: Principles of Network and System
                                  Administration by Mark Burgess
Relative & Absolute Paths
 Absolute Path
     Given from “root” directory
     Example: /usr/local/bin
 Relative Path
     ‘.’ – Current Directory
     ‘..’ – Parent Directory
     ‘~’ – Home Directory
     Example: ~/.. = /home
Filter Commands
 cat – View all      sort – Sort by
 more – View page    field
 less – View page    uniq – Remove
                     dup
 head – View first
                     cut – Get fields
 tail – View last
 wc – word count     paste – Merge
                     Files
                     grep – Search
                     text
                     tr – Replace text
Heads or Tails
  head -# file
      Displays the first # lines of file1
  tail -# file
      Displays the last # lines of file1
  wc [-cwl] file
      Counts number of characters, words,
       or lines in file
Sorting
  Lists the contents of a file based on
  order
  sort file
      Sorts file alphabetically by line
  sort -r file
      Sorts file in reverse order by line
  sort –t: -n +2 file
      Sorts file based on the 3rd field (+2)
      in numeric order (-n)
      with fields separated by ‘:’ (-t:)
Extracting info
  cut –f# [-d%] file
      Displays # fields separated by %in
       file
  grep search-string file
      Displays all lines with search-
       string in file
      Can create very sophisticated search
       conditions
Changing file contents
  paste file1 file2
      Merge contents of file1 and file2
       line by line
  tr c1 c2 < file
      Changes all occurrences of
       character c1 to c2 in file
Misc. Commands
 date
     Set system time/date
     View (formatted) system time/date
 cal
     Displays calendar
 echo
     Display strings & shell variables
Visual Editor (vi)
  Very Powerful
  3 modes
     Command
     Insert
     ex
  Can be frustrating to learn initially
  Important to have cheat sheet
  handy 
emacs versus vi
Georgy says…

Slashdot (Asked by markhb):
   vi or emacs?
Georgy:
I'm so glad you asked!! Both. vi for quick
editing, emacs (NOT xemacs) for coding
projects. :q!:q!:q!

                           Source: Slashdot.com, 8/20/2003
Why vi?!?!?!
 Because it is always there!!!




          ©www.nicedog.com
Installing Applications
  Source Code
     Typically requires a C compiler (gcc)
     GNU Configure – Builds Makefile
     Read README file first!!!
  Precompiled Packages
     Solaris: pkgadd
     RedHat Linux: rpm
RedHat Package Manager
 Command line: rpm
     Install/Upgrade/Remove software
     Distribution verification
     Powerful package/file queries
 Network Installations
     yum
     up2date
     apt-get

Weitere ähnliche Inhalte

Was ist angesagt?

Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpointbijanshr
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity TipsKeith Bennett
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
SGN Introduction to UNIX Command-line 2015 part 1
SGN Introduction to UNIX Command-line 2015 part 1SGN Introduction to UNIX Command-line 2015 part 1
SGN Introduction to UNIX Command-line 2015 part 1solgenomics
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologistAjay Murali
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)meashi
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linuxshravan saini
 

Was ist angesagt? (20)

Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
SGN Introduction to UNIX Command-line 2015 part 1
SGN Introduction to UNIX Command-line 2015 part 1SGN Introduction to UNIX Command-line 2015 part 1
SGN Introduction to UNIX Command-line 2015 part 1
 
Os lab manual
Os lab manualOs lab manual
Os lab manual
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux And perl
Linux And perlLinux And perl
Linux And perl
 
Linux final exam
Linux final examLinux final exam
Linux final exam
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologist
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Unix
UnixUnix
Unix
 

Ähnlich wie Lecture1 2 intro-unix

Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2Gourav Varma
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unixsouthees
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Vu Hung Nguyen
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to LinuxDimas Prasetyo
 
Chapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsChapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsShankar Mahure
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Wave Digitech
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersDevanand Gehlot
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Ranjan Raja
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheetapajadeh
 

Ähnlich wie Lecture1 2 intro-unix (20)

Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
Chapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsChapter 4 Linux Basic Commands
Chapter 4 Linux Basic Commands
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Linux
LinuxLinux
Linux
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheet
 

Mehr von nghoanganh (20)

Tom tat lenh ubuntu
Tom tat lenh ubuntuTom tat lenh ubuntu
Tom tat lenh ubuntu
 
Thi xa vung bien hoan thanh 04042013
Thi xa vung bien   hoan thanh 04042013Thi xa vung bien   hoan thanh 04042013
Thi xa vung bien hoan thanh 04042013
 
Oxford thuong-yeu-truyen368-com-html
Oxford thuong-yeu-truyen368-com-htmlOxford thuong-yeu-truyen368-com-html
Oxford thuong-yeu-truyen368-com-html
 
Mis11e ch06
Mis11e ch06Mis11e ch06
Mis11e ch06
 
Mis11e ch03
Mis11e ch03Mis11e ch03
Mis11e ch03
 
Mis11e ch02
Mis11e ch02Mis11e ch02
Mis11e ch02
 
Mis11e ch01
Mis11e ch01Mis11e ch01
Mis11e ch01
 
Mis11e ch05
Mis11e ch05Mis11e ch05
Mis11e ch05
 
Chap14
Chap14Chap14
Chap14
 
Chap13
Chap13Chap13
Chap13
 
Chap11
Chap11Chap11
Chap11
 
Chap8
Chap8Chap8
Chap8
 
Chap7
Chap7Chap7
Chap7
 
Chap6
Chap6Chap6
Chap6
 
Chap5
Chap5Chap5
Chap5
 
Chap4
Chap4Chap4
Chap4
 
Chap3
Chap3Chap3
Chap3
 
Chap2
Chap2Chap2
Chap2
 
Chap1
Chap1Chap1
Chap1
 
Chap17
Chap17Chap17
Chap17
 

Kürzlich hochgeladen

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 

Kürzlich hochgeladen (20)

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 

Lecture1 2 intro-unix

  • 2. Section Overview X Windows Consoles and Terminals UNIX Commands UNIX Filesystem vi Editor
  • 3. X Windows Familiar GUI interface Virtual screens Remote applications X-Terminal Windows  Multiple concurrent session  Scroll bars  Cut, Copy & Paste
  • 4. X Managers & Environments X Window Managers  Very configurable  A lot of variety  GUI login mode X Window Environment  Fully integrated environment  Window manager runs within the environment
  • 5. Why use the command line? Always available  GUI not installed/working  Remote sessions More efficient More powerful Better understanding of what is happening
  • 6. UNIX Terminals Old Days  Hardwired – serial connections  Modems – remote connections Network – telnet Console  Monitor/keyboard/mouse on system  Boot/error messages display  Headless servers
  • 7. Virtual Consoles in Linux Multiple sessions on one console Special Consoles  Console 1 – default console  Console 7 – X Windows Toggling between consoles  Text mode - <Alt><Fn>  X Windows - <Ctrl><Alt><Fn>  <Fn>: Function Key (n = 1 .. 7)
  • 8. Basic Philosophy 10% of work solves 90% of problems Smaller is better Portability Solve at right level Be Creative!!!
  • 9. Command Anatomy 101 command [-switches] [arg1] [arg2]… Command: Name of the program Switches: Modify command’s behaviour Arg#: Arguments passed to command
  • 10. Getting Help Online manual available Searchable  Command/File name  Type/Section  Keyword Not always easy to understand
  • 11. Man Page Sections Solaris Linux Contents 1 1 User commands 2 2 System calls 3 3 Library calls 4 5 File formats 5 7 Misc. files and documents 6 6 Games and demos 7 4 Devices/Network protocols 1m 8 Administration commands 9 9 Kernel specs/interfaces (?)
  • 12. Using man man command  Look up command man n intro  Contents of section n man –k string  Search short descriptions (apropos) man –K string  Search all man pages for string
  • 13. Account Related Commands login  Start session passwd  Change Password logout / exit  Close session
  • 14. File/Directory Commands Files Directories  cp – Copy  ls – List contents  mv –  mv – Move/Rename Move/Rename  cd – Change Dir  rm – Remove  pwd – Current Dir  cat – View all  mkdir – Create  more – View page  rm/rmdir – Remove  less – View page
  • 15. Copies, moves, and renaming cp file1 file2|dir1  Copy file1 to file2 or into directory dir1 cp –r[p] dir1 dir2  Copy directory dir1 to dir2 mv file1 file2|dir2  Moves file1 to file2 or into directory dir1  Renames file1 to file2 if both in same directory
  • 16. Viewing files cat file1  Display the contents of file1 to the screen more file1  Display the contents of file1 one screen at a time less file1  Same as more but more powerful
  • 17. Removing files and directories rm file1 file2 ...  Removes list of files rmdir dir1  Removes dir1 only (if it is empty) rm -r dir1  Removes dir1 and all subdirectories/files  VERY Dangerous!!!
  • 18. Other directory commands ls [-la] [file/dir list]  Lists files in a directory mkdir dir1  Creates directory dir1 cd dir1  Makes dir1 the current directory pwd  Displays the current directory path
  • 19. UNIX Filesystem Hierarchy / (root) bin sbin home etc boot root usr var dev lib scott alice bob bin sbin local lib tmp n321 mail public_ht bin man lib share src ml
  • 20. So many bins… / (root) bin sbin usr bin directories: User programs bin sbin local sbin directories: System programs /bin & /sbin – Needed at boot time /usr/bin & /usr/sbin – available bin sbin when system fully operating
  • 21. Windows Files/Directories UNIX/Linux Windows /usr %SystemRoot% (C:Windows) /bin & %SystemRoot%System32 /usr/bin /dev %SystemRoot%System32Drivers /etc %SystemRoot%System32Config /tmp C:Temp /var/spool %SystemRoot%System32Spool Source: Principles of Network and System Administration by Mark Burgess
  • 22. Relative & Absolute Paths Absolute Path  Given from “root” directory  Example: /usr/local/bin Relative Path  ‘.’ – Current Directory  ‘..’ – Parent Directory  ‘~’ – Home Directory  Example: ~/.. = /home
  • 23. Filter Commands cat – View all sort – Sort by more – View page field less – View page uniq – Remove dup head – View first cut – Get fields tail – View last wc – word count paste – Merge Files grep – Search text tr – Replace text
  • 24. Heads or Tails head -# file  Displays the first # lines of file1 tail -# file  Displays the last # lines of file1 wc [-cwl] file  Counts number of characters, words, or lines in file
  • 25. Sorting Lists the contents of a file based on order sort file  Sorts file alphabetically by line sort -r file  Sorts file in reverse order by line sort –t: -n +2 file  Sorts file based on the 3rd field (+2)  in numeric order (-n)  with fields separated by ‘:’ (-t:)
  • 26. Extracting info cut –f# [-d%] file  Displays # fields separated by %in file grep search-string file  Displays all lines with search- string in file  Can create very sophisticated search conditions
  • 27. Changing file contents paste file1 file2  Merge contents of file1 and file2 line by line tr c1 c2 < file  Changes all occurrences of character c1 to c2 in file
  • 28. Misc. Commands date  Set system time/date  View (formatted) system time/date cal  Displays calendar echo  Display strings & shell variables
  • 29. Visual Editor (vi) Very Powerful 3 modes  Command  Insert  ex Can be frustrating to learn initially Important to have cheat sheet handy 
  • 30. emacs versus vi Georgy says… Slashdot (Asked by markhb): vi or emacs? Georgy: I'm so glad you asked!! Both. vi for quick editing, emacs (NOT xemacs) for coding projects. :q!:q!:q! Source: Slashdot.com, 8/20/2003
  • 31. Why vi?!?!?! Because it is always there!!! ©www.nicedog.com
  • 32. Installing Applications Source Code  Typically requires a C compiler (gcc)  GNU Configure – Builds Makefile  Read README file first!!! Precompiled Packages  Solaris: pkgadd  RedHat Linux: rpm
  • 33. RedHat Package Manager Command line: rpm  Install/Upgrade/Remove software  Distribution verification  Powerful package/file queries Network Installations  yum  up2date  apt-get