exploring interfaces and filesystems n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Exploring interfaces and filesystems PowerPoint Presentation
Download Presentation
Exploring interfaces and filesystems

Loading in 2 Seconds...

play fullscreen
1 / 67

Exploring interfaces and filesystems - PowerPoint PPT Presentation


  • 159 Views
  • Uploaded on

Exploring interfaces and filesystems. Unit objectives Outline structure of the Linux interface, and roles of the kernel, terminal and shell Enter shell commands, find documentation, use metacharacters, shut down system Learn directory structure, file types, and use wildcards

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Exploring interfaces and filesystems' - camille


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
exploring interfaces and filesystems
Exploring interfaces and filesystems

Unit objectives

  • Outline structure of the Linux interface, and roles of the kernel, terminal and shell
  • Enter shell commands, find documentation, use metacharacters, shut down system
  • Learn directory structure, file types, and use wildcards
  • Display contents of text and binary files
  • Search text files by using grep, identify common text editors, and use the vi editor
topic a
Topic A
  • Topic A: Linux interfaces
  • Topic B: Basic shell commands
  • Topic C: Files and directories
  • Topic D: Displaying the contents of files
  • Topic E: Searching and editing text files
shells terminals and the kernel
Shells, terminals, and the kernel
  • Kernel
    • The core component of the OS
  • Terminal
    • Screen that allows you to log in
  • Shell
    • Runs within the terminal
    • Interface that accepts commands and passes them to the kernel
    • BASH Shell (Bourne Again Shell): the default shell

continued

exercise a 1

Exercise A-1

Discussing terminals and shells

topic b
Topic B
  • Topic A: Linux interfaces
  • Topic B: Basic shell commands
  • Topic C: Files and directories
  • Topic D: Displaying the contents of files
  • Topic E: Searching and editing text files
basic shell commands
Basic Shell Commands
  • Commands
    • Indicate name of the program to execute
  • Options
    • Letters starting with a dash “-” that alter way the command works
  • Arguments
    • Specify the parameters the command works upon
shell metacharacters
Shell metacharacters
  • Key combinations that have special meaning in the Linux OS
  • One of the most commonly used metacharacters is the $ character
activity b 1

Activity B-1

Using shell commands and metacharacters

getting command help
Getting command help
  • Manual pages
    • Commonly referred to as man pages
    • Documents the command’s function and the syntax it accepts
activity b 2

Activity B-2

Getting help

activity b 3

Activity B-3

Shutting down the system

topic c
Topic C
  • Topic A: Linux interfaces
  • Topic B: Basic shell commands
  • Topic C: Files and directories
  • Topic D: Displaying the contents of files
  • Topic E: Searching and editing text files
the linux directory structure1
The Linux directory structure
  • Directory
    • Special file used to organize other files into a logical structure
  • Absolute pathname
    • Full pathname to a certain file or directory starting from the root directory
home directory
Home directory
  • Home directory
    • A directory for users to store personal files and information
    • Each user has a sub-directory
changing directories
Changing directories
  • pwd (print working directory)
    • Used to identify the current directory path
  • cd (change directory)
    • Used to move from one directory to another
the metacharacter and relative paths
The ~ metacharacter and relative paths
  • ~
    • Refers to the current user’s home directory
    • Can specify another user’s home directory by adding the username after ~
  • Relative pathname
    • Pathname of a target directory relative to your current location in the tree
tab completion
Tab-completion
  • Tab-completion
    • Fills in the remaining characters of a unique filename or directory name when you press the Tab key
activity c 1

Activity C-1

Logging on and navigating the file structure

file types
File types
  • Text files
  • Binary data files
  • Executable program files
  • Directory files
  • Linked files
  • Special device files
  • Named pipes and socket files
filenames
Filenames
  • Filename
    • User-friendly identifier given to a file
  • Filename suffixes
    • Identifiers following a dot (.) at the end of a filename
    • used to denote the type of the file
the ls command
The ls command
  • Used to list the files in a directory
  • Most common method for displaying files
  • Displays all the files in the current directory
    • You can use an argument with ls to list a directory different from current one
ls f file type characters
Ls –F file type characters
  • @ Linked file
  • * Executable file
  • / Subdirectory
  • = Socket file
  • | Named pipe
the file command
The file command
  • File command
    • Displays detailed information about any file
    • Works with multiple files
    • Uses * to include all files in a directory
hidden files
Hidden files
  • Hidden files
    • Files that are not normally displayed with common filesystem commands
    • represent important configuration files or program directories
activity c 2

Activity C-2

Examining files and file types

wildcard metacharacters
Wildcard metacharacters
  • Can simplify more than one filename to a command
  • Interpreted by the shell and can be used with most filesystem commands
  • Matches certain portions of filenames or an entire filename

continued

activity a 3

Activity A-3

Using wildcard metacharacters

topic d
Topic D
  • Topic A: Linux interfaces
  • Topic B: Basic shell commands
  • Topic C: Files and directories
  • Topic D: Displaying the contents of files
  • Topic E: Searching and editing text files
displaying content of text files
Displaying content of text files
  • cat command
    • Display the entire contents of a text file to the screen
  • tac command
    • Displays a file to the screen beginning with the last line of the file and ending with the first line of the file
  • head command
    • Displays the first 10 lines (including blank lines) of a text file to the terminal screen
    • Can also take a numeric option specifying a different number of lines to display

continued

displaying content of text files continued
Displaying content of text files, continued
  • tail command
    • By default, displays the last 10 lines (including blank lines) of a text file to the terminal screen
    • Can also take a numeric option specifying a different number of lines to display
other text file viewing commands
Other text file viewing commands
  • more command
    • Displays a text file page-by-page and line-by-line
    • Gets its name from the pg command once used on UNIX system
  • less command
    • Displays a text file page-by-page
    • Use the cursor keys to navigate the file
activity d 1

Activity D-1

Displaying text file contents

displaying the contents of binary files
Displaying the contents of binary files
  • strings commands
    • Linux command used to search for and display text characters in a binary file
  • od command
    • Linux command that is used to display the contents of a file in octal format (numeric base 8 format)
    • Safe to use on binary files and text files
activity d 2

Activity D-2

Displaying binary data

topic e
Topic E
  • Topic A: Linux interfaces
  • Topic B: Basic shell commands
  • Topic C: Files and directories
  • Topic D: Displaying the contents of files
  • Topic E: Searching and editing text files
searching for text within files
Searching for text within files
  • Regular expressions (regexp)
    • Special metacharacters used to match patterns of text within text files
    • Commonly used by many text tool commands such as grep
regular expressions and wildcards
Regular expressions and wildcards
  • Regular expressions are interpreted by a text tool program, wildcard metacharacters are interpreted by the shell,
  • Regular expressions match characters within text files, wildcard metacharacters match characters in filenames or directory names

continued

regular expressions and wildcards continued
Regular expressions and wildcards, continued
  • Wildcard metacharacters regular expressions usually have different definitions than wildcard metacharacters
  • More metacharacters are available for regular expressions
  • Regular expressions are divided into two different categories:
    • Common
    • extended

continued

the grep command
The grep command
  • Grep
    • Displays lines in a text file that match a common regular expression
  • Egrep
    • Displays text that match extended regular expressions
  • Fgrep
    • Does not interpret regular expressions
    • Returns results faster than the egrep command
activity e 1

Activity E-1

Using regular expressions in grep and egrep

the vi editor
The vi editor
  • One of the oldest and most popular text editors available for Linux and UNIX operating systems
    • vim – an improved version for Linux
    • Not easy, but portable
  • The vi editor is called bi-modal as it functions in two modes
    • Command mode
      • Perform editing tasks not related to inserting text
    • Insert mode
      • Allows inserting text into the document
activity e 2

Activity E-2

Using the vi editor

activity e 3

Activity E-3

Exploring vi options

other common text editors
Other common text editors
  • Pico (PIne COmposer) editor
  • Mcedit editor (Midnight Commander Editor)
  • Emacs (Editor MAcroS) editor
  • Xemacs editor
emacs editor
Emacs editor
  • Alternative to the vi editor that offers equal functionality
  • Not an easy-to-use editor as you must memorize several key combinations to work effectively

continued

gedit editor
Gedit editor
  • gedit editor
    • Text editor for the GNOME desktop
exercise e 4

Exercise E-4

Discussing common text editors

unit summary
Unit summary
  • Explored the components of the user interface
  • Used the shell to execute commands and use shell metacharacters
  • Learned about filesystems and files, and used shell wildcards to specify multiple file names
  • Displayed the contents of text files and binary files
  • Searched text files for regular expressions by using grep, and identified common editors
  • Used the vi editor