1 / 7

Chapter 4: Exploring Linux Filesystems

Chapter 4: Exploring Linux Filesystems. Directory Structure. Similar to Windows structure but there is no drive name It uses forward slash instead of backward one Home directory Remember the difference between # and $ Command commands {pwd, cd, etc.}

Download Presentation

Chapter 4: Exploring Linux Filesystems

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 4: Exploring Linux Filesystems

  2. Directory Structure • Similar to Windows structure but there is no drive name • It uses forward slash instead of backward one • Home directory • Remember the difference between # and $ • Command commands {pwd, cd, etc.} • Use of cd without argument or with ~ to change to home • Relative versus absolute paths • The . and .. • Tab-completion feature and history

  3. Files • File types (text, binary, executable, directory, linked, special device, named pipes, and socket) • Name convention (up to 255, alpha, _, -, .) • Hidden files (use .) • Listing files (ls or dir) • Parameters to ls (-F, -l, -a) also ll • The eight components in the long listing • The file command • Wild characters (*, ?, [abcde], [a-e], [!a-e])

  4. Viewing File Contents • Common commands: • cat • tac • head • tail • more • less • Using redirection | with more and less • strings • od

  5. Searching for Text • Regular expression versus wild characters

  6. Searching for Text (cont.) • The grep (Global Regular Expression Print) command • Syntax: grep regexp filename • It is a case sensitive. To ignore case use the –i modifier • To reverse the action of the grep command use the –v • To match whole word(s), you need to use spaces before and after • egrep for extended regexp while fgrep ignores regexp • Do sample Demo

  7. Text Editors • Most common: vi, vim, or emacs • Important for vi: • Modes (command and insert) • How to switch • Reading, writing, exiting, etc. • Insert date :r !date • Replace texts :1,$ s/word/WORD/g • Show/hide line numbers :set number / :set nonumber • Other editors: for instance emacs uses CTRL + ch to perform various functions • GUI-based editors: e.g. Xemacs, gedit, and kedit • Demo

More Related