Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files.

Slides:



Advertisements
Similar presentations
Guide to Linux Installation and Administration, 2e1 Chapter 5 Using Linux Graphical Environments.
Advertisements

A Guide to Unix Using Linux Fourth Edition
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
A Guide to Unix Using Linux Fourth Edition
Chapter One The Essence of UNIX.
A Guide to Unix Using Linux Fourth Edition
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
CS 497C – Introduction to UNIX Lecture 36: - Customizing the Environment Chin-Chih Chang
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 12 Printing in Linux.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Chapter 2: Exploring the Desktop The Complete Guide to Linux System Administration.
Using Linux Commands 2 Lab#5
Using Linux Commands 2 Lab#5. Sort command Sort the lines of text files. $ sort fileName by default it will sort in normal order(alphabetical 0-9 A-Z.
Linux Operations and Administration
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Advanced File Processing
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
1 Guide to Novell NetWare 6.0 Network Administration Chapter 12.
Introduction to Shell Script Programming
Chapter 3 Mastering Editors
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
CENT 305 Information Systems Security Linux Introduction.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
SUSE Linux Enterprise Desktop Administration Chapter 2 Use the Linux Desktop.
Linux+ Guide to Linux Certification Chapter Four Exploring Linux Filesystems.
Linux+ Guide to Linux Certification, Third Edition
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Linux+ Guide to Linux Certification, Third Edition
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
Linux+ Guide to Linux Certification Chapter Eight Working with the BASH Shell.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
BIF713 Additional Utilities. Linux Utilities  You have learned many Linux commands. Here are some more that you can use:  Data Manipulation (Reg Exps)
Editors And Debugging Systems Other System Software Text Editors Interactive Debugging Systems UNIT 5 S.Sharmili Priyadarsini.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Chapter Three The UNIX Editors.
Chapter Eleven The X Window System. 2 Lesson A Starting and Navigating an X Window System.
Chapter Six Introduction to Shell Script Programming.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
1 Day 18 Bash and the.files. 2 The.files ls shows you the files in your directory –Or at least most of them. –Some files are hidden. Try: ls –a –This.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Linux+ Guide to Linux Certification, Second Edition
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
Linux Administration Working with the BASH Shell.
Agenda Customizing a Unix/Linux account Environment Introduction to Start-up Files (.bash_profile,.bashrc,.profile,.kshrc) Safe Methods for Changing Start-up.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
SUSE Linux Enterprise Desktop Administration
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Linux Shell Script Programming
Linux Operations and Administration
Presentation transcript:

Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files

Guide to Linux Installation and Administration, 2e2 Objectives In this chapter, you will: Describe how a Linux shell operates Customize your shell environment Use common text editors to create or modify text files Describe popular text-processing methods and tools used on Linux

Guide to Linux Installation and Administration, 2e3 Understanding the Shell Command interpreter: program that accepts input from the keyboard and launches commands or otherwise controls the computer system Linux command interpreter is called the shell The shell is only loaded when a user logs in at a text mode login prompt Different types of shells are available for Linux Valued Gateway Client:

Guide to Linux Installation and Administration, 2e4 The Shell Prompt Shell prompt: set of words or characters indicating that the shell is ready for commands The default shell prompt includes four components: –The user account name –The hostname –The last part of the full directory path –A prompt character Valued Gateway Client:

Guide to Linux Installation and Administration, 2e5 A Standard Shell Prompt

Guide to Linux Installation and Administration, 2e6 The Functions of a Shell A shell’s primary purpose is to launch programs A Linux shell gives users the ability to write scripts that the shell can execute The shell has many built-in features to work with files and commands on a Linux system Valued Gateway Client:

Guide to Linux Installation and Administration, 2e7 Different Types of Shells

Guide to Linux Installation and Administration, 2e8 Different Types of Shells

Guide to Linux Installation and Administration, 2e9 Entering Commands Modern shells include features designed to simplify the process of entering commands and command parameters: –Tab completion –History feature Valued Gateway Client:

Guide to Linux Installation and Administration, 2e10 Using Tab Completion Tab completion is a shell feature that lets you enter part of a file or directory name, press the Tab key, and have the shell fill in the remainder of the name Using tab completion makes it easier to enter long or complex directory paths and filenames Valued Gateway Client:

Guide to Linux Installation and Administration, 2e11 Using the History Feature Command history: records each command that you enter at the shell prompt History list: recently entered commands To locate a previously executed command –Use the history number –Use the beginning of a command –Search the history list Valued Gateway Client:

Guide to Linux Installation and Administration, 2e12 The Shell Start-up Process The profile scripts are executed when a user logs into a Linux system Additional scripts are executed when a user starts a shell The /etc/profile script contains configuration information that applies to every user on the system Valued Gateway Client:

Guide to Linux Installation and Administration, 2e13 A Typical Start-up Script

Guide to Linux Installation and Administration, 2e14 Customizing the Shell You can customize the Linux environment with the following methods: –Use aliases –Use symbolic links –Use environment variables Valued Gateway Client:

Guide to Linux Installation and Administration, 2e15 Using Aliases Alias: string of characters that is substituted for another string of characters at the shell prompt The alias command lets you define an alias for text you enter at a shell prompt General format of the alias command: alias = Valued Gateway Client:

Guide to Linux Installation and Administration, 2e16 Symbolic Links Symbolic link –File that refers to another file or directory, rather than containing data itself –Used when the same data must be accessed from two locations in the directory structure, or by two different names –Commonly used in directories such as /lib and /usr/lib To create a symbolic link, use the ln command with the -s option Valued Gateway Client:

Guide to Linux Installation and Administration, 2e17 A Symbolic Link

Guide to Linux Installation and Administration, 2e18 Viewing a Symbolic Link

Guide to Linux Installation and Administration, 2e19 Environment Variables Environment variables are settings, or values, available to any program launched by a user Each environment variable is assigned a value Set command: displays a list of all environment variables defined in your current environment To see the value of an environment variable, execute echo followed by the environment variable name preceded by a dollar sign The export command makes an environment variable available to other programs launched from that environment Valued Gateway Client:

Guide to Linux Installation and Administration, 2e20 Using Text Editors Linux supports numerous text editors Linux system administrator can modify configuration files using any text editor Files that use a markup language can be created in any text editor You can filter text files within some text editors Valued Gateway Client:

Guide to Linux Installation and Administration, 2e21 The Variety of Linux Text Editors Graphical text editors are included on modern Linux desktops, such as –gedit in Gnome –kedit and kate in KDE Widely used text-mode editors: –vi –emacs –pico –joe Valued Gateway Client:

Guide to Linux Installation and Administration, 2e22 The pico Text Editor

Guide to Linux Installation and Administration, 2e23 Using the vi Editor vi is a modal editor – keystrokes are interpreted differently depending on the mode you are working in vi has several modes: –Command mode –Insert mode –Replace mode Valued Gateway Client:

Guide to Linux Installation and Administration, 2e24 Using the vi Editor

Guide to Linux Installation and Administration, 2e25 vi Commands to Enter Insert or Replace Mode

Guide to Linux Installation and Administration, 2e26 Additional vi Commands

Guide to Linux Installation and Administration, 2e27 Text Processing There are two methods to create formatted documents: –Graphical, or WYSIWYG (what-you-see-is-what- you-get) –Rely on markup languages to define special codes that format documents Valued Gateway Client:

Guide to Linux Installation and Administration, 2e28 Markup Languages Widely used markup languages in the Unix and Linux world: –HTML (hypertext markup language) –TeX – a document-processing system with two popular versions: LaTeX and TeTeX –roff codes for online documents Valued Gateway Client:

Guide to Linux Installation and Administration, 2e29 An HTML Document in vi

Guide to Linux Installation and Administration, 2e30 Controlling Fonts The X Window System is installed with many different fonts xfontsel graphical program is used to review and select fonts Both Gnome and KDE provide a standard font selection dialog box Fonts are managed in X using the xfs font server New fonts can be added to the Linux system any time Valued Gateway Client:

Guide to Linux Installation and Administration, 2e31 The xfontsel Program

Guide to Linux Installation and Administration, 2e32 The Font Selector Dialog Box in Gnome

Guide to Linux Installation and Administration, 2e33 Manipulating Text Files Filtering is the process of adding, removing, or altering data in the text file based on complex rules or patterns sort command: sorts all of the lines in a text file, writing them out in alphabetical order sed command: processes each line in a text file according to a series of command-line options awk and perl programming languages can be used to create scripts for filtering text files Valued Gateway Client:

Guide to Linux Installation and Administration, 2e34 Linux Text-filtering Commands

Guide to Linux Installation and Administration, 2e35 Summary Linux shell: program that launches other programs and works with files in Linux Modern shells include features designed to simplify the process of entering commands - tab completion and history Aliases within a shell cause the shell to replace text on a command-line entry with different text before trying to execute the command Environment variables store values that any program can access

Guide to Linux Installation and Administration, 2e36 Summary Linux supports text editors, such as vi Linux programs format text using a WYSIWYG display or markup languages such as LaTeX and roff use codes Fonts are managed in X Windows System using a font server Gnome and KDE provide a dialog box to select the font for graphical programs Filtering text files can be done within some text editors or using different command-line utilities