SlideShare a Scribd company logo
L2B Second Linux Course



Session4



           Please visit our Facebook Group
L2B Second Linux Course
L2B Linux course



      Session outlines:
        Text Processing Tools
        Text Processing Tools Exercises
        VIM
        VIM Exercises
        Basic System Configuration Tools
L2B Second Linux Course
L2B Linux course




               Text Processing Tools
L2B Second Linux Course
L2B Linux course


     Extracting Text
        cat
            • One or more files
         less
            •   Easy to read
            •   /text
            •   n/N
            •   v     open an editor
            •   Used by man command to present man pages
L2B Second Linux Course
L2B Linux course


     Extracting Text
        head
            • First 10 lines only
            • -n     change number of lines
         tail
            • Last 10 lines only
            • -n change number of lines
            • -f   monitoring the file
L2B Second Linux Course
L2B Linux course


     Extracting Text
        cut
            •   Display specific columns
            •   -d column delimiter
            •   -f   number of field
            •   -c cut by characters
                   – cut -c2-5   /usr/share/dict/words
L2B Second Linux Course
L2B Linux course


     Extracting Text
        Grep
            •   Display lines where a pattern is matched
            •   -i   case-insensitively
            •   -n print line numbers of matches
            •   -v print lines not containing pattern
            •   -AX     include the X lines after each match
            •   -Bx      include the X lines before each match
L2B Second Linux Course
L2B Linux course


     Tools for Analyzing Text
        wc
            •   Counts words, lines, bytes and characters
            •   -l  only line count
            •   -w only word count
            •   -c only byte count
            •   -m character count (not displayed)
L2B Second Linux Course
L2B Linux course


     Tools for Analyzing Text
        sort
            •   Sort text and original file is not changed
            •   -r   reverse (descending) sort
            •   -n numeric sort
            •   -u (unique) removes duplicate lines
            •   -t c field separator
            •   -k X which field
            •   uniq & uniq -c
L2B Second Linux Course
L2B Linux course


     Tools for Analyzing Text
        diff and patch
            • diff foo.conf-broken foo.conf-works
            • -u better for patchfiles
            • Patching
                   – diff -u foo.conf-broken foo.conf-works > foo.patch
                   – patch -b foo.conf-broken foo.patch
L2B Second Linux Course
L2B Linux course


     Tools for Analyzing Text
        aspell
            • Interactively spell-check files:
                   – aspell check letter.txt
            • Non-interactively list mis-spelled words in
                   – Only reads data from standard input
                   – aspell list < letter.txt
L2B Second Linux Course
L2B Linux course


     Tools for Manipulating Text




                     tr and sed
L2B Second Linux Course
L2B Linux course


     Tools for Manipulating Text
        Tr
            • Converts characters in one set to corresponding
              characters in another set
            • Only reads data from STDIN
            • tr 'a-z' 'A-Z' < lowercase.txt
L2B Second Linux Course
L2B Linux course


     sed (stream editor)
        search/replace operations on a stream of text
        Normally does not alter source file
        -i to alter source file
        -i.bak to back-up and alter source file
L2B Second Linux Course
L2B Linux course


     sed Examples
        sed 's/dog/cat/i' pets
        sed 's/dog/cat/g' pets
        sed '1,50s/dog/cat/g' pets
        sed '/digby/,/duncan/s/dog/cat/g' pets
        sed -e 's/dog/cat/' -e 's/hi/lo/' pets
L2B Second Linux Course
L2B Linux course


     Characters for Complex Searches
       ^ represents beginning of line
       $ represents end of line
       Character classes as in bash:
            • [abc], [^abc]
            • [[:upper:]], [^[:upper:]]
         Used by: grep, sed, less, others
L2B Second Linux Course
L2B Linux course




                        VIM
L2B Second Linux Course
L2B Linux course


     VIM Advantages:
       Speed: Do more with fewer keystrokes
       Simplicity: No dependence on mouse/GUI
       Availability: Included with most Unix-like OSes
     Disadvantages
       Difficulty: Steeper learning curve than simpler
        editors
L2B Second Linux Course
L2B Linux course


     Three main modes:
        Command Mode (default): Move cursor,
         cut/paste text
        Insert Mode: Modify text
        Exit Mode: Save, quit, etc
L2B Second Linux Course
L2B Linux course

     First steps with vim
         vim filename(command mode)
         Insert mode
            •   I          at the cursor
            •   A   append to end of line
            •   I   insert at beginning of line
            •   o   insert new a line (below)
            •   O   insert new line (above)
         Exit mode
            • :w    writes (saves) the file to disk
            • :wq   writes and quits
            • :q!   quits, even if changes are lost
L2B Second Linux Course
L2B Linux course


     Command Mode
       Right Arrow moves right one character
       5, Right Arrow moves right five characters
       Arrow Keys, h, j, k, l (the same as arrows)
       w, b Move by word
       ), (   Move by sentence
       }, {   Move by paragraph
       xG           Jump to line x
       gg           Jump to the first line
      G             Jump to the last line
L2B Second Linux Course
L2B Linux course


     Command Mode
       As in less
            • /, n, N
         As in sed
         The selected line only
            • :1,5s/cat/dog/
         All of the entire file
            • :%s/cat/dog/gi
L2B Second Linux Course
L2B Linux course


     Command Mode
       Line
            • cc
            • dd
            • yy
         Letter
            • cl
            • dl
            • yl
L2B Second Linux Course
L2B Linux course


     Command Mode
       Word
            • cw
            • dw
            • yw
         Sentence ahead
            • c)
            • d)
            • y)
L2B Second Linux Course
L2B Linux course


     Command Mode
       Sentence behind
            • c(
            • d(
            • y(
         Paragraph above
            • c{
            • d{
            • y{
L2B Second Linux Course
L2B Linux course


     Command Mode
       Paragraph below
            • c}
            • d}
            • y}
        u        undo
         Ctrl-r redo
         U undo all changes to the last modified line
L2B Second Linux Course
L2B Linux course

     Command Mode
       v starts character-oriented highlighting
       V starts line-oriented highlighting
       Visual keys used with movement keys:
            • w, ), }, arrows
         Highlighted text can be
            •   Deleted
            •   Yanked
            •   Changed
            •   Filtered
            •   search/replaced, etc.
L2B Second Linux Course
L2B Linux course


     Command Mode
       Ctrl-w, s splits the screen horizontally
       Ctrl-w, v splits the screen vertically
       Ctrl-w, Arrow moves between windows
       Ctrl-w twice, Arrow moves between windows
       To search for help inside vim convert to the
        exit mode and ask for help by running the
        following
            • :help
L2B Second Linux Course
L2B Linux course

     Configuring vi and vim
       :set
            •   :set number
            •   :set all
            •   :set number (:se nu)
            •   :set nonumber (:se nonu)
            •   :set ignorecase (:se ic)
            •   :set noignorecase (:se noic)
            •   :set showmatch (:se sm)
            •   :set noshowmatch(:se nosm)
            •   :set autoindent
            •   :set noautoindent
L2B Second Linux Course
L2B Linux course


     Configuring vi and vim
       :help
       :help something
       :set
            •   :set textwidth=3
            •   :set textwidth=0
            •   :set wrapmargin=10
            •   :set wrapmargin=0
         ~/.vimrc
         vimtutor
L2B Second Linux Course
L2B Linux course




                      Basic System
                   Configuration Tools
L2B Second Linux Course
L2B Linux course

     Introduction
        Network interfaces are named sequentially:
         eth0, eth1, etc
        Multiple addresses can be assigned to a
         device with aliases
        Aliases are labeled eth0:1, eth0:2, etc.
        Aliases are treated like separate interfaces
        View interface configuration with :
          ifconfig [ethX]
        Enable interface with ifup ethX
        Disable interface with ifdown ethX
L2B Second Linux Course
L2B Linux course


     Graphical Network Configuration
       system-config-network
       System > Administration > Network
     Network Configuration Files For Devices
       /etc/sysconfig/network-scripts/ifcfg-ethX
       Complete list of options in
        /usr/share/doc/initscripts-*/sysconfig.txt
L2B Second Linux Course
L2B Linux course


     Example Of Dynamic Configuration
        DEVICE=ethX
        HWADDR=0:02:8A:A6:30:45
        BOOTPROTO=dhcp
        ONBOOT=yes
        Type=Ethernet
L2B Second Linux Course
L2B Linux course


     Example Of Static Configuration
        DEVICE=ethX
        HWADDR=0:02:8A:A6:30:45
        IPADDR=192.168.0.254
        NETMASK=255.255.255.0
        GATEWAY=192.168.2.254
        ONBOOT=yes
        Type=Ethernet
L2B Second Linux Course
L2B Linux course


     Network Configuration Files and Other
      Global Network Settings
       /etc/sysconfig/network
            • NETWORKING=yes
            • HOSTNAME=server1.example.com
            • GATEWAY=192.168.2.254
L2B Second Linux Course
L2B Linux course

     DNS configuration
       Server address is specified by dhcp or in
        /etc/resolv.conf
            • nameserver 192.168.0.254
            • nameserver 192.168.1.254
L2B Second Linux Course
L2B Linux course


     Setting the System's Date and Time
       GUI:
            • system-config-date
            • System->Administration->Date & Time
         CLI: date [MMDDhhmm[[CC]YY][.ss]]
            •   date 01011330
            •   Date 010113302007.05
            •   Date 12312359
            •   Date 123123592007
            •   Date 01010101.01
L2B Second Linux Course
L2B Linux course


     Scripting
       Taking input with positional parameters
            •   $1
            •   $2
            •   $3
            •   $4, etc.
            •   $*
            •   $#
L2B L2B Second Linux
                       Course Second Linux
L2B Linux course
                       Course
     Scripting
       Taking input with the read command
            • read x
            • read -p "Enter a filename: " file
For More info Please Visit Our Facebook Group

More Related Content

What's hot

Linux
LinuxLinux
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
Acácio Oliveira
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
Vinoth Sn
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
Mohammad Reza Beygi
 
cisco
ciscocisco
cisco
edomaldo
 
Linux
LinuxLinux
Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems
Ahmed El-Arabawy
 
Linux beginner's Workshop
Linux beginner's WorkshopLinux beginner's Workshop
Linux beginner's Workshop
futureshocked
 
Linux CLI
Linux CLILinux CLI
3. intro
3. intro3. intro
3. intro
Harsh Shrimal
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
Michael Olafusi
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
Kavya Sri
 
Linux
LinuxLinux
Linux system administration
Linux system administrationLinux system administration
Linux system administration
orionsconsulting
 
Linux commands
Linux commandsLinux commands
Linux commands
Mannu Khani
 
Unit 7
Unit 7Unit 7
Unit 7
vamsitricks
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheet
apajadeh
 
Lpi lição 01 exam 101 objectives
Lpi lição 01  exam 101 objectivesLpi lição 01  exam 101 objectives
Lpi lição 01 exam 101 objectives
Acácio Oliveira
 
Linux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on EduonixLinux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on Eduonix
Paddy Lock
 

What's hot (20)

Linux
LinuxLinux
Linux
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 
cisco
ciscocisco
cisco
 
Linux
LinuxLinux
Linux
 
Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems Course 102: Lecture 28: Virtual FileSystems
Course 102: Lecture 28: Virtual FileSystems
 
Linux beginner's Workshop
Linux beginner's WorkshopLinux beginner's Workshop
Linux beginner's Workshop
 
Linux CLI
Linux CLILinux CLI
Linux CLI
 
3. intro
3. intro3. intro
3. intro
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
Linux
LinuxLinux
Linux
 
Linux system administration
Linux system administrationLinux system administration
Linux system administration
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unit 7
Unit 7Unit 7
Unit 7
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheet
 
Lpi lição 01 exam 101 objectives
Lpi lição 01  exam 101 objectivesLpi lição 01  exam 101 objectives
Lpi lição 01 exam 101 objectives
 
Linux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on EduonixLinux Administrator - The Linux Course on Eduonix
Linux Administrator - The Linux Course on Eduonix
 

Similar to Session4

Linux1
Linux1Linux1
Linux1
Learn 2 Be
 
ITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptxITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptx
HemantJadhao3
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
Ch3 gnu make
Ch3 gnu makeCh3 gnu make
Ch3 gnu make
艾鍗科技
 
Type Profiler: Ambitious Type Inference for Ruby 3
Type Profiler: Ambitious Type Inference for Ruby 3Type Profiler: Ambitious Type Inference for Ruby 3
Type Profiler: Ambitious Type Inference for Ruby 3
mametter
 
Strategies to improve embedded Linux application performance beyond ordinary ...
Strategies to improve embedded Linux application performance beyond ordinary ...Strategies to improve embedded Linux application performance beyond ordinary ...
Strategies to improve embedded Linux application performance beyond ordinary ...
André Oriani
 
The Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneThe Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhone
James Long
 
LinuxCommands (1).pdf
LinuxCommands (1).pdfLinuxCommands (1).pdf
LinuxCommands (1).pdf
AnkitKushwaha792697
 
Linex
LinexLinex
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptx
GuhanSenthil2
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
Reuven Lerner
 
001 linux revision
001 linux revision001 linux revision
001 linux revision
Sherif Mousa
 
Version control with subversion
Version control with subversionVersion control with subversion
Version control with subversion
xprayc
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux
Kuldeep Tiwari
 
LISP.ppt
LISP.pptLISP.ppt
LISP.ppt
HasnaatCH2
 
L lpic1-v3-103-1-pdf
L lpic1-v3-103-1-pdfL lpic1-v3-103-1-pdf
L lpic1-v3-103-1-pdf
hellojdr
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
mametter
 
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON
 
Peeling back the Lambda layers
Peeling back the Lambda layersPeeling back the Lambda layers
Peeling back the Lambda layers
Patrick McCaffrey
 

Similar to Session4 (20)

Linux1
Linux1Linux1
Linux1
 
ITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptxITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptx
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
Ch3 gnu make
Ch3 gnu makeCh3 gnu make
Ch3 gnu make
 
Type Profiler: Ambitious Type Inference for Ruby 3
Type Profiler: Ambitious Type Inference for Ruby 3Type Profiler: Ambitious Type Inference for Ruby 3
Type Profiler: Ambitious Type Inference for Ruby 3
 
Strategies to improve embedded Linux application performance beyond ordinary ...
Strategies to improve embedded Linux application performance beyond ordinary ...Strategies to improve embedded Linux application performance beyond ordinary ...
Strategies to improve embedded Linux application performance beyond ordinary ...
 
The Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneThe Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhone
 
LinuxCommands (1).pdf
LinuxCommands (1).pdfLinuxCommands (1).pdf
LinuxCommands (1).pdf
 
Linex
LinexLinex
Linex
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptx
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
001 linux revision
001 linux revision001 linux revision
001 linux revision
 
Version control with subversion
Version control with subversionVersion control with subversion
Version control with subversion
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
 
Presentation for RHCE in linux
Presentation  for  RHCE in linux Presentation  for  RHCE in linux
Presentation for RHCE in linux
 
LISP.ppt
LISP.pptLISP.ppt
LISP.ppt
 
L lpic1-v3-103-1-pdf
L lpic1-v3-103-1-pdfL lpic1-v3-103-1-pdf
L lpic1-v3-103-1-pdf
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
 
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
 
Peeling back the Lambda layers
Peeling back the Lambda layersPeeling back the Lambda layers
Peeling back the Lambda layers
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 

Session4

  • 1. L2B Second Linux Course Session4 Please visit our Facebook Group
  • 2. L2B Second Linux Course L2B Linux course  Session outlines:  Text Processing Tools  Text Processing Tools Exercises  VIM  VIM Exercises  Basic System Configuration Tools
  • 3. L2B Second Linux Course L2B Linux course Text Processing Tools
  • 4. L2B Second Linux Course L2B Linux course  Extracting Text  cat • One or more files  less • Easy to read • /text • n/N • v open an editor • Used by man command to present man pages
  • 5. L2B Second Linux Course L2B Linux course  Extracting Text  head • First 10 lines only • -n change number of lines  tail • Last 10 lines only • -n change number of lines • -f monitoring the file
  • 6. L2B Second Linux Course L2B Linux course  Extracting Text  cut • Display specific columns • -d column delimiter • -f number of field • -c cut by characters – cut -c2-5 /usr/share/dict/words
  • 7. L2B Second Linux Course L2B Linux course  Extracting Text  Grep • Display lines where a pattern is matched • -i case-insensitively • -n print line numbers of matches • -v print lines not containing pattern • -AX include the X lines after each match • -Bx include the X lines before each match
  • 8. L2B Second Linux Course L2B Linux course  Tools for Analyzing Text  wc • Counts words, lines, bytes and characters • -l only line count • -w only word count • -c only byte count • -m character count (not displayed)
  • 9. L2B Second Linux Course L2B Linux course  Tools for Analyzing Text  sort • Sort text and original file is not changed • -r reverse (descending) sort • -n numeric sort • -u (unique) removes duplicate lines • -t c field separator • -k X which field • uniq & uniq -c
  • 10. L2B Second Linux Course L2B Linux course  Tools for Analyzing Text  diff and patch • diff foo.conf-broken foo.conf-works • -u better for patchfiles • Patching – diff -u foo.conf-broken foo.conf-works > foo.patch – patch -b foo.conf-broken foo.patch
  • 11. L2B Second Linux Course L2B Linux course  Tools for Analyzing Text  aspell • Interactively spell-check files: – aspell check letter.txt • Non-interactively list mis-spelled words in – Only reads data from standard input – aspell list < letter.txt
  • 12. L2B Second Linux Course L2B Linux course  Tools for Manipulating Text tr and sed
  • 13. L2B Second Linux Course L2B Linux course  Tools for Manipulating Text  Tr • Converts characters in one set to corresponding characters in another set • Only reads data from STDIN • tr 'a-z' 'A-Z' < lowercase.txt
  • 14. L2B Second Linux Course L2B Linux course  sed (stream editor)  search/replace operations on a stream of text  Normally does not alter source file  -i to alter source file  -i.bak to back-up and alter source file
  • 15. L2B Second Linux Course L2B Linux course  sed Examples  sed 's/dog/cat/i' pets  sed 's/dog/cat/g' pets  sed '1,50s/dog/cat/g' pets  sed '/digby/,/duncan/s/dog/cat/g' pets  sed -e 's/dog/cat/' -e 's/hi/lo/' pets
  • 16. L2B Second Linux Course L2B Linux course  Characters for Complex Searches  ^ represents beginning of line  $ represents end of line  Character classes as in bash: • [abc], [^abc] • [[:upper:]], [^[:upper:]]  Used by: grep, sed, less, others
  • 17. L2B Second Linux Course L2B Linux course VIM
  • 18. L2B Second Linux Course L2B Linux course  VIM Advantages:  Speed: Do more with fewer keystrokes  Simplicity: No dependence on mouse/GUI  Availability: Included with most Unix-like OSes  Disadvantages  Difficulty: Steeper learning curve than simpler editors
  • 19. L2B Second Linux Course L2B Linux course  Three main modes:  Command Mode (default): Move cursor, cut/paste text  Insert Mode: Modify text  Exit Mode: Save, quit, etc
  • 20. L2B Second Linux Course L2B Linux course  First steps with vim  vim filename(command mode)  Insert mode • I at the cursor • A append to end of line • I insert at beginning of line • o insert new a line (below) • O insert new line (above)  Exit mode • :w writes (saves) the file to disk • :wq writes and quits • :q! quits, even if changes are lost
  • 21. L2B Second Linux Course L2B Linux course  Command Mode  Right Arrow moves right one character  5, Right Arrow moves right five characters  Arrow Keys, h, j, k, l (the same as arrows)  w, b Move by word  ), ( Move by sentence  }, { Move by paragraph  xG Jump to line x  gg Jump to the first line G Jump to the last line
  • 22. L2B Second Linux Course L2B Linux course  Command Mode  As in less • /, n, N  As in sed  The selected line only • :1,5s/cat/dog/  All of the entire file • :%s/cat/dog/gi
  • 23. L2B Second Linux Course L2B Linux course  Command Mode  Line • cc • dd • yy  Letter • cl • dl • yl
  • 24. L2B Second Linux Course L2B Linux course  Command Mode  Word • cw • dw • yw  Sentence ahead • c) • d) • y)
  • 25. L2B Second Linux Course L2B Linux course  Command Mode  Sentence behind • c( • d( • y(  Paragraph above • c{ • d{ • y{
  • 26. L2B Second Linux Course L2B Linux course  Command Mode  Paragraph below • c} • d} • y} u undo  Ctrl-r redo  U undo all changes to the last modified line
  • 27. L2B Second Linux Course L2B Linux course  Command Mode  v starts character-oriented highlighting  V starts line-oriented highlighting  Visual keys used with movement keys: • w, ), }, arrows  Highlighted text can be • Deleted • Yanked • Changed • Filtered • search/replaced, etc.
  • 28. L2B Second Linux Course L2B Linux course  Command Mode  Ctrl-w, s splits the screen horizontally  Ctrl-w, v splits the screen vertically  Ctrl-w, Arrow moves between windows  Ctrl-w twice, Arrow moves between windows  To search for help inside vim convert to the exit mode and ask for help by running the following • :help
  • 29. L2B Second Linux Course L2B Linux course  Configuring vi and vim  :set • :set number • :set all • :set number (:se nu) • :set nonumber (:se nonu) • :set ignorecase (:se ic) • :set noignorecase (:se noic) • :set showmatch (:se sm) • :set noshowmatch(:se nosm) • :set autoindent • :set noautoindent
  • 30. L2B Second Linux Course L2B Linux course  Configuring vi and vim  :help  :help something  :set • :set textwidth=3 • :set textwidth=0 • :set wrapmargin=10 • :set wrapmargin=0  ~/.vimrc  vimtutor
  • 31. L2B Second Linux Course L2B Linux course Basic System Configuration Tools
  • 32. L2B Second Linux Course L2B Linux course  Introduction  Network interfaces are named sequentially: eth0, eth1, etc  Multiple addresses can be assigned to a device with aliases  Aliases are labeled eth0:1, eth0:2, etc.  Aliases are treated like separate interfaces  View interface configuration with : ifconfig [ethX]  Enable interface with ifup ethX  Disable interface with ifdown ethX
  • 33. L2B Second Linux Course L2B Linux course  Graphical Network Configuration  system-config-network  System > Administration > Network  Network Configuration Files For Devices  /etc/sysconfig/network-scripts/ifcfg-ethX  Complete list of options in /usr/share/doc/initscripts-*/sysconfig.txt
  • 34. L2B Second Linux Course L2B Linux course  Example Of Dynamic Configuration  DEVICE=ethX  HWADDR=0:02:8A:A6:30:45  BOOTPROTO=dhcp  ONBOOT=yes  Type=Ethernet
  • 35. L2B Second Linux Course L2B Linux course  Example Of Static Configuration  DEVICE=ethX  HWADDR=0:02:8A:A6:30:45  IPADDR=192.168.0.254  NETMASK=255.255.255.0  GATEWAY=192.168.2.254  ONBOOT=yes  Type=Ethernet
  • 36. L2B Second Linux Course L2B Linux course  Network Configuration Files and Other Global Network Settings  /etc/sysconfig/network • NETWORKING=yes • HOSTNAME=server1.example.com • GATEWAY=192.168.2.254
  • 37. L2B Second Linux Course L2B Linux course  DNS configuration  Server address is specified by dhcp or in /etc/resolv.conf • nameserver 192.168.0.254 • nameserver 192.168.1.254
  • 38. L2B Second Linux Course L2B Linux course  Setting the System's Date and Time  GUI: • system-config-date • System->Administration->Date & Time  CLI: date [MMDDhhmm[[CC]YY][.ss]] • date 01011330 • Date 010113302007.05 • Date 12312359 • Date 123123592007 • Date 01010101.01
  • 39. L2B Second Linux Course L2B Linux course  Scripting  Taking input with positional parameters • $1 • $2 • $3 • $4, etc. • $* • $#
  • 40. L2B L2B Second Linux Course Second Linux L2B Linux course Course  Scripting  Taking input with the read command • read x • read -p "Enter a filename: " file
  • 41. For More info Please Visit Our Facebook Group