Linux Phrasebook, 2/e (Paperback)
暫譯: Linux 實用手冊,第2版 (平裝)

Scott Granneman

買這商品的人也買了...

商品描述

 

Get more done faster at the Linux command line! This best-selling Linux Phrasebook has been thoroughly updated in the second edition to reflect the newest distributions, incorporate feedback from hundreds of active Linux users, and cover today's newest tools and techniques -- including an entirely new chapter on text file manipulation. 


Linux Phrasebook, Second Edition offers a concise, handy reference to the Linux commands that, like a language phrasebook, can be used on the spot on moment's notice.

 

Don't waste a minute on non-essentials: this straight-to-the-point reference delivers specific information and tested commands designed to work with any modern Linux distribution. Portable enough to take anywhere, it starts with a quick introduction to essential command line concepts, and then delivers all the modern Linux command examples, variations, and parameters you need to: 

  • View, manipulate, archive, and compress files
  • Control file ownership and permissions
  • Find anything on your systems
  • Efficiently use the Linux shell
  • Monitor system resources
  • Install software
  • Test, fix, and work with networks

Linux Phrasebook, Second Edition is the perfect quick command line reference for millions of Linux users and administrators at all levels of experience: people who want to get reliable information they can use right now -- with no distractions and no diversions!


Contents at a Glance

 

Part I: Getting Started


Chapter 1 Things to Know About Your Command Line

Everything Is a File

Maximum Filename Lengths

Names Are Case-Sensitive

Special Characters to Avoid in Names

Wildcards and What They Mean

Special Files That Affect Your Command Line

If There’s Too Much Stuff on Screen, Reset

Chapter 2 Navigating Your File System

List Files and Folders

List the Contents of Other Folders

List Folder Contents Using Wildcards

View a List of Files in Subfolders

View a List of Contents in a Single Column

View Contents As a Comma-Separated List

View Hidden Files and Folders

Visually Display a File’s Type

Display Contents in Color

List Permissions, Ownership, and More

Reverse the Order Contents Are Listed

Sort Contents by Date and Time

Sort Contents by Size

Express File Sizes in Terms of K, M, and G

Display the Path of Your Current Directory

Change to a Different Directory

Change to Your Home Directory

Change to Your Previous Directory

Chapter 3 Creation and Destruction

Change a File to the Current Time

Change a File to Any Desired Time

Create a New, Empty File

Create a New Directory

Create a New Directory and Any Necessary Subdirectories

Copy Files

Copy Files Using Wildcards

Copy Files Verbosely

Stop Yourself from Copying over Important Files

Copy Directories

Copy Files As Perfect Backups in Another Directory

Move Files and Folders

Rename Files and Folders

Understand How Linux Stores Files

Create a Link Pointing to Another File or Directory

Delete Files

Remove Several Files at Once with Wildcards

Prevent Yourself from Deleting Key Files

Delete an Empty Directory

Remove Files and Directories That Aren’t Empty

Deleting Troublesome Files

Chapter 4 Learning About Commands

Find Out About Commands with man

Quickly Find Out What a Command Does Based on Its Name

Search for a Command Based on What It Does

Read a Command’s Specific Man Page

Learn About Commands with info

Navigate Within info

Locate the Paths for a Command’s Executable, Source Files, and Man Pages

Find Out Which Version of a Command Will Run

Discover How a Command Will Be Interpreted

Chapter 5 Building Blocks

Run Several Commands Sequentially

Run Commands Only If the Previous Ones Succeed

Run a Command Only If the Previous One Fails

Plug the Output of a Command into Another Command

Understand Input/Output Streams

Use the Output of One Command As Input for Another

Redirect a Command’s Output to a File

Prevent Overwriting Files When Using Redirection

Append a Command’s Output to a File

Use a File As Input for a Command

Combine Input and Output Redirection

Send Output to a File and to stdout at the Same Time

Part II: Working with Files


Chapter 6 Viewing (Mostly Text) Files

Figure Out a File’s Type

View Files on stdout

Concatenate Files to stdout

Concatenate Files to Another File

Concatenate Files and Number the Lines

View Text Files a Screen at a Time

Search Within Your Pager

Edit Files Viewed with a Pager

View the First 10 Lines of a File

View the First 10 Lines of Several Files

View the First Several Lines of a File or Files

View the First Several Bytes, Kilobytes, or Megabytes of a File

View the Last 10 Lines of a File

View the Last 10 Lines of Several Files

View the Last Several Lines of a File or Files

View the Constantly Updated Last Lines of a File or Files

Chapter 7 Manipulating Text Files with Filters

Count the Number of Words, Lines, and Characters in a File

Number Lines in a File

Select an Entire Column of Data in a Delimited File

Sort the Contents of a File

Sort the Contents of a File Numerically

Remove Duplicate Lines in a File

Substitute Selected Characters with Others

Replace Repeated Characters with a Single Instance

Delete Matching Characters

Transform Text in a File

Print Specific Fields in a File

Chapter 8 Ownerships and Permissions

Become Another User

Become Another User, with His Environment Variables

Become root

Become root, with Its Environment Variables

Change the Group Owning Files and Directories

Recursively Change the Group Owning a Directory

Change the Owner of Files and Directories

Change the Owner and Group of Files and Directories

Understand the Basics of Permissions

Change Permissions on Files and Directories Using Alphabetic Notation

Change Permissions on Files and Directories Using Numeric Permissions

Change Permissions Recursively

Set and Then Clear suid

Set and Then Clear sgid

Set and Then Clear the Sticky Bit

Chapter 9 Archiving and Compression

Archive and Compress Files Using zip

Get the Best Compression Possible with zip

Archive and Compress Files of a Specified Type in Directories and Subdirectories

Password-Protect Compressed Zip Archives

Unzip Files

Test Files That Will Be Unzipped

Archive and Compress Files Using gzip

Archive and Compress Files Recursively Using gzip

Uncompress Files Compressed with gzip

Test Files That Will Be Unzipped with gunzip

Archive and Compress Files Using bzip2

Uncompress Files Compressed with bzip2

Test Files That Will Be Unzipped with bunzip2

Archive Files with tar

Archive and Compress Files with tar and gzip

Test Files That Will Be Untarred and Uncompressed

Untar and Uncompress Files

Part III: Finding Files, Words, and More


Chapter 10 Finding Files, Directories, Words, and Phrases

Search a Database of Filenames

Search a Database of Filenames Without Worrying About Case

Update the Database Used by locate

Searching Inside Text Files for Patterns

The Basics of Searching Inside Text Files for Patterns

Search Recursively for Text in Files

Search for Words and Highlight the Results

Search for Text in Files, Ignoring Case

Search for Whole Words in Files

Show Line Numbers Where Words Appear in Files

Search the Output of Other Commands for Specific Words

See Context for Words Appearing in Files

Show Lines Where Words Do Not Appear in Files

List Files Containing Searched-for Words

List the Number of Occurrences of Words in Files

Search for Words Inside Search Results

Chapter 11 The find Command

Find Files by Name

Find Files by Ownership

Find Files by File Size

Find Files by File Type

Find Files by Time

Show Results If the Expressions Are True (AND)

Show Results If Either Expression Is True (OR)

Show Results If the Expression Is Not True (NOT)

Execute a Command on Found Files

Execute a Command on Found Files More Efficiently

Execute a Command on Found Files Containing Spaces

Part IV: Your Environment


Chapter 12 Your Shell

View Your Command-Line History

Run the Last Command Again

Run a Previous Command Using Numbers

Run a Previous Command Using a String

Search for a Previous Command and Run It

Display All Command Aliases

View a Specific Command Alias

Create a New Temporary Alias

Create a New Permanent Alias

Remove an Alias

Create a New Temporary Function

Create a New Permanent Function

Display All Functions

Remove a Function

When to Use an Alias and When to Use a Function

Chapter 13 Monitoring System Resources

Discover How Long Your Computer Has Been Running

View All Currently Running Processes

View a Process Tree

View Processes Owned by a Particular User

End a Running Process

View a Dynamically Updated List of Running Processes

List Open Files

List a User’s Open Files

List Users for a Particular File

List Processes for a Particular Program

Display Information About System RAM

Show File System Disk Usage

Report File Space Used by a Directory

Report Just the Total Space Used for a Directory

Chapter 14 Installing Software

Install Software Packages (RPM)

Remove Software Packages (RPM)

Install Software Packages and Dependencies (RPM)

Remove Software Packages and Dependencies (RPM)

Upgrade Software Packages and Dependencies (RPM)

Find Packages Available for Download (RPM)

Install Software Packages (DEB)

Remove Software Packages (DEB)

Install Software Packages and Dependencies (DEB)

Remove Software Packages and Dependencies (DEB)

Upgrade Software Packages and Dependencies (DEB)

Find Packages Available for Download (DEB)

Clean Up Unneeded Installation Packages (DEB)

Troubleshoot Problems with APT (DEB)

Part V: Networking


Chapter 15 Connectivity

View the Status of Your Network Interfaces

Verify That a Computer Is Running and Accepting Requests

Trace the Route Packets Take Between Two Hosts

Query DNS Records

Configure a Network Interface

View the Status of Your Wireless Network Interfaces

Configure a Wireless Network Interface

Grab a New Address Using DHCP

Make a Network Connection Active

Bring a Network Connection Down

Display Your IP Routing Table

Change Your IP Routing Table

Troubleshooting Network Problems

Chapter 16 Working on the Network

Securely Log In to Another Compute

Securely Log In to Another Machine Without a Password

Securely Transfer Files Between Machines

Securely Copy Files Between Hosts

Securely Transfer and Back Up Files

Download Files Non-interactively

Download Websites Non-interactively

Download Sequential Files and Internet Resources


商品描述(中文翻譯)

在 Linux 命令行上更快地完成更多工作!這本暢銷的《Linux 短語手冊》在第二版中進行了全面更新,以反映最新的發行版,納入數百名活躍 Linux 使用者的反饋,並涵蓋當今最新的工具和技術——包括一個全新的文本文件操作章節。

《Linux 短語手冊,第二版》提供了一個簡明、方便的參考,涵蓋 Linux 命令,像語言短語手冊一樣,可以隨時使用。

不要浪費時間在不必要的事情上:這本直截了當的參考書提供了具體的信息和經過測試的命令,旨在與任何現代 Linux 發行版配合使用。它足夠便攜,可以隨身攜帶,首先快速介紹了基本的命令行概念,然後提供了所有現代 Linux 命令的示例、變體和參數,讓你能夠:

- 查看、操作、歸檔和壓縮文件
- 控制文件的擁有權和權限
- 在系統中查找任何東西
- 高效使用 Linux shell
- 監控系統資源
- 安裝軟件
- 測試、修復和處理網絡

《Linux 短語手冊,第二版》是數百萬 Linux 使用者和管理員的完美快速命令行參考,適合各種經驗水平的人:那些希望獲得可靠信息的人,隨時可以使用——沒有干擾,沒有分心!

**內容概覽**

**第一部分:入門**

**第 1 章** 你需要知道的命令行知識

- 一切都是文件
- 最大文件名長度
- 名稱區分大小寫
- 名稱中應避免的特殊字符
- 通配符及其含義
- 影響命令行的特殊文件
- 如果屏幕上顯示的內容太多,重置

**第 2 章** 瀏覽你的文件系統

- 列出文件和文件夾
- 列出其他文件夾的內容
- 使用通配符列出文件夾內容
- 查看子文件夾中的文件列表
- 以單列查看內容
- 以逗號分隔的列表查看內容
- 查看隱藏的文件和文件夾
- 直觀顯示文件類型
- 以顏色顯示內容
- 列出權限、擁有權等
- 反轉內容的列出順序
- 按日期和時間排序內容
- 按大小排序內容
- 以 K、M 和 G 表示文件大小
- 顯示當前目錄的路徑
- 切換到不同的目錄
- 切換到主目錄
- 切換到上一個目錄

**第 3 章** 創建與刪除

- 將文件更改為當前時間
- 將文件更改為任何所需的時間
- 創建一個新的空文件
- 創建一個新目錄
- 創建一個新目錄及其必要的子目錄
- 複製文件
- 使用通配符複製文件
- 詳細複製文件
- 防止自己覆蓋重要文件
- 複製目錄
- 在另一個目錄中作為完美備份複製文件
- 移動文件和文件夾
- 重命名文件和文件夾
- 理解 Linux 如何存儲文件
- 創建指向另一個文件或目錄的鏈接
- 刪除文件
- 使用通配符一次刪除多個文件
- 防止自己刪除關鍵文件
- 刪除空目錄
- 刪除不為空的文件和目錄
- 刪除麻煩的文件

**第 4 章** 了解命令

- 使用 man 獲取命令信息
- 根據命令名稱快速了解命令的功能
- 根據命令的功能搜索命令
- 閱讀命令的具體 man 頁面
- 使用 info 了解命令
- 在 info 中導航
- 定位命令的可執行文件、源文件和 man 頁面的路徑
- 確定將運行的命令版本
- 發現命令將如何被解釋

**第 5 章** 基本構建塊

- 按順序運行多個命令
- 只有在前一個命令成功時運行命令
- 只有在前一個命令失敗時運行命令
- 將一個命令的輸出插入到另一個命令中
- 理解輸入/輸出流
- 使用一個命令的輸出作為另一個命令的輸入
- 將命令的輸出重定向到文件
- 使用重定向時防止覆蓋文件
- 將命令的輸出附加到文件
- 使用文件作為命令的輸入
- 結合輸入和輸出重定向
- 同時將輸出發送到文件和 stdout

**第二部分:處理文件**

**第 6 章** 查看(主要是文本)文件

- 確定文件類型
- 在 stdout 上查看文件
- 將文件串聯到 stdout
- 將文件串聯到另一個文件
- 串聯文件並編號行
- 一次查看一個屏幕的文本文件
- 在你的分頁器中搜索
- 編輯使用分頁器查看的文件
- 查看文件的前 10 行
- 查看多個文件的前 10 行
- 查看一個或多個文件的前幾行
- 查看文件的前幾個字節、千字節或兆字節
- 查看文件的最後 10 行
- 查看多個文件的最後 10 行
- 查看一個或多個文件的最後幾行
- 查看不斷更新的文件或文件的最後行

**第 7 章** 使用過濾器操作文本文件

- 計算文件中的單詞、行和字符數
- 為文件中的行編號
- 在分隔文件中選擇整列數據
- 對文件內容進行排序
- 按數字對文件內容進行排序
- 刪除文件中的重複行
- 用其他字符替換選定的字符
- 將重複的字符替換為單個實例
- 刪除匹配的字符
- 轉換文件中的文本
- 打印文件中的特定字段

**第 8 章** 擁有權和權限

- 以其他用戶身份登錄
- 以其他用戶身份登錄,並帶上他的環境變量
- 以 root 身份登錄
- 以 root 身份登錄,並帶上其環境變量
- 更改擁有文件和目錄的組
- 遞歸更改擁有目錄的組
- 更改文件和目錄的擁有者
- 更改文件和目錄的擁有者和組
- 理解權限的基本知識
- 使用字母表示法更改文件和目錄的權限
- 使用數字權限更改文件和目錄的權限
- 遞歸更改權限
- 設置然後清除 suid
- 設置然後清除 sgid
- 設置然後清除 Sticky Bit

**第 9 章** 存檔和壓縮

- 使用 zip 存檔和壓縮文件
- 獲得 zip 的最佳壓縮效果
- 在目錄和子目錄中存檔和壓縮指定類型的文件
- 為壓縮的 zip 存檔設置密碼保護
- 解壓文件
- 測試將要解壓的文件
- 使用 gzip 存檔和壓縮文件
- 使用 gzip 遞歸地存檔和壓縮文件
- 解壓用 gzip 壓縮的文件
- 測試將用 gunzip 解壓的文件
- 使用 bzip2 存檔和壓縮文件
- 解壓用 bzip2 壓縮的文件
- 測試將用 bunzip2 解壓的文件
- 使用 tar 存檔文件
- 使用 tar 和 gzip 存檔和壓縮文件
- 測試將要解壓和解壓的文件
- 解壓和解壓文件

**第三部分:查找文件、單詞及更多**

**第 10 章** 查找文件、目錄、單詞和短語

- 搜索文件名數據庫
- 在不考慮大小寫的情況下搜索文件名數據庫
- 更新 locate 使用的數據庫
- 在文本文件中搜索模式
- 在文本文件中搜索模式的基本知識