99 Pages to Linux V1.2 Page 1
Total Page:16
File Type:pdf, Size:1020Kb
99 Pages to™ 99 Pages to Linux v1.2 Page 1 Preface This book is a collection from various online and offline sources. It is assembled from publicly available contents as a free service to the community, and organized in a way that simplifies progressive understanding of Linux fundamentals while keeping it structured for use as a quick reference for your toolset. The contents are independent of distributions and should apply to most Linux systems; however, it is always useful to check man pages from your specific vendor. The trademark “99 Pages to™” is owned by Manceps, Inc. Other than that, NO other copyrights or ownership are claimed by making this text available. Feedback: [email protected] The next 99 pages will take you from absolute beginner to advanced user in 4 easy sections. The detailed table of contents is a quick way to locate information so you can use this as a reference. Click here to skip the table of contents and get right to the book. Now let’s dig right into Linux… 99 Pages to Linux v1.2 Page 2 Table of Contents Preface .......................................................................................................................................................... 2 Introducing bash ......................................................................................................................................... 10 The shell .................................................................................................................................................. 10 Are you running bash? ........................................................................................................................ 10 About bash .......................................................................................................................................... 10 Using "cd" ............................................................................................................................................ 10 Paths ....................................................................................................................................................... 11 Absolute paths .................................................................................................................................... 11 Relative paths ...................................................................................................................................... 11 Using “..” ............................................................................................................................................. 11 Relative path examples ....................................................................................................................... 12 Understanding "." ............................................................................................................................... 12 cd and the home directory.................................................................................................................. 12 Other users' home directories ............................................................................................................ 13 Using Linux Commands ........................................................................................................................... 13 Introducing “ls” ................................................................................................................................... 13 Long directory listings ......................................................................................................................... 13 Looking at directories.......................................................................................................................... 14 Recursive and inode listings ................................................................................................................ 14 Understanding inodes ......................................................................................................................... 15 mkdir ................................................................................................................................................... 15 touch ................................................................................................................................................... 16 echo ..................................................................................................................................................... 16 cat and cp ............................................................................................................................................ 17 mv ....................................................................................................................................................... 17 Creating Links and Removing Files .......................................................................................................... 18 Hard links ............................................................................................................................................ 18 Symbolic links ...................................................................................................................................... 18 99 Pages to Linux v1.2 Page 3 Symlinks in-depth ................................................................................................................................ 19 rm ........................................................................................................................................................ 21 rmdir.................................................................................................................................................... 21 Using Wild cards...................................................................................................................................... 22 Introducing Wild cards ........................................................................................................................ 22 Understanding non-matches .............................................................................................................. 23 Wild card syntax: “*” and “?” ............................................................................................................. 23 Wild card syntax: “[]” .......................................................................................................................... 23 Wild card caveats ................................................................................................................................ 24 Basic Administration ................................................................................................................................... 25 Regular Expressions ................................................................................................................................ 25 What is a regular expression? ............................................................................................................. 25 Glob comparison ................................................................................................................................. 25 The simple substring ........................................................................................................................... 25 Understanding the simple substring ................................................................................................... 25 Metacharacters ................................................................................................................................... 26 Using “[]” ............................................................................................................................................. 26 Using “[^]” ........................................................................................................................................... 26 Differing syntax ................................................................................................................................... 27 The "*" metacharacter ........................................................................................................................ 27 Beginning and end of line ................................................................................................................... 28 Full-line regexes .................................................................................................................................. 28 FHS and finding files ................................................................................................................................ 28 Filesystem Hierarchy Standard ........................................................................................................... 28 The two independent FHS categories ................................................................................................. 29 Secondary hierarchy at /usr ................................................................................................................ 29 Finding files ......................................................................................................................................... 29 The PATH ............................................................................................................................................. 29 Modifying PATH .................................................................................................................................