
عنوان:
Effective Shell
نویسنده:
Dave Kerr
انتشارات:
No Starch Press
تاریخ انتشار:
2025
حجم:
4.9MB
معرفی کتاب:"Effective Shell: راهنمای عملی کاربر برای کار هوشمندانهتر در خط فرمان نسخه :1"
Effective Shell راهنمای عملی برای توسعهدهندگانی است که میخواهند خط فرمان را بهطور کامل یاد بگیرند — نه فقط برای جابهجایی در سیستم، بلکه برای ساخت یک محیط توسعه سریع، منعطف و قابل حمل.
این کتاب یک مرور ساده از دستورات shell نیست، بلکه نقشهای برای ایجاد جریانهای کاری ارائه میدهد که روی چند ماشین، تیم و پروژه مقیاسپذیر باشند. شما از کارایی سطح کلیدهای کیبورد شروع کرده و به سمت ترکیب پایپلاینهای قدرتمند، نوشتن اسکریپتهای قابل اعتماد و خودکارسازی کارهای تکراری توسعه حرکت میکنید. سپس فراتر میروید: مدیریت پیکربندی با Git، شخصیسازی تنظیمات shell و کار بدون مشکل در جلسات راه دور با ابزارهایی مانند Vim و tmux.
در پایان، shell شما فقط یک ابزار نخواهد بود؛ بلکه گسترشی از تفکر شما خواهد بود.
آنچه خواهید آموخت:
- یافتن، فیلتر کردن و بازسازی دادهها با استفاده از grep، regular expressions و پایپلاینهای shell
- نوشتن اسکریپتهایی که راهاندازی، پیکربندی و کارهای تکراری را خودکار میکنند
- ساخت ابزارهای CLI مبتنی بر Python برای دریافت و پردازش دادههای ساختاریافته
- مدیریت محیط با Git و فایلهای dot تحت کنترل نسخه
- ویرایش سریع با Vim و انجام چند وظیفهای با terminal multiplexers
- استفاده از ابزارهای AI برای تولید دستورات، اشکالزدایی سریعتر و بهبود اتوماسیون
به جای ارائه یک مجموعه ابزار یکسان برای همه، Effective Shell ابزارها، شیوهها و استراتژیهایی را آموزش میدهد تا محیط shell خود را مطابق با سبک کارتان بسازید — کارآمد، قابل حمل و کاملاً شخصی.
چه در حال ارتقا از مفاهیم پایه باشید و چه در حال بهبود مهارتها، این کتاب به شما کمک میکند بهطور واضح فکر کنید، با اطمینان خودکارسازی کنید و در shell مؤثرتر کار کنید.
فهرست مطالب
- Cover
- Title Page
- Copyright
- Dedication
- About the Author
- About the Technical Reviewer
- Brief Contents
- Contents in Detail
- Acknowledgments
- Introduction
- Part I: Core Skills
- Chapter 1: Flying on the Command Line
- Basic Navigation Techniques
- Search Commands
- Editing in Place
- Other Useful Shortcuts
- Summary
- Chapter 2: Thinking in Pipelines
- The IPO Pattern
- Pipelines in Action
- The T-Pipe
- Pipelines and the Unix Philosophy
- Summary
- Chapter 3: Finding Files and Folders
- Searching with the find Command
- Refining a Search with find
- Acting on Search Results
- Handling Symbolic Links
- Going Further with find
- Summary
- Part II: Manipulating Text and Streams
- Chapter 4: Regular Expression Essentials
- Regexes in a Nutshell
- Building Regexes
- Advanced Regex Concepts
- Summary
- Chapter 5: Getting to Grips with grep
- What Exactly Is grep?
- Searching Through Text
- Using grep with Regular Expressions
- Advanced grep Features
- Alternatives to grep
- Summary
- Chapter 6: Slicing and Dicing Text
- Extracting Heads and Tails
- Replacing Text
- Cutting Text
- Reversing Text
- Sorting Text and Removing Duplicate Lines
- Paging Through Text
- Summary
- Chapter 7: Advanced Text Manipulation with sed
- Transformations with sed
- Advanced Applications
- Alternatives to sed
- Summary
- Chapter 8: Building Commands on the Fly
- Introducing xargs
- Handling Whitespace, Special Characters, and Tracing
- Customizing How xargs Processes Input Lines
- Organizing the Parameters for Commands
- Running Commands Interactively
- Running a Command for Each Input
- Summary
- Part III: Shell Scripting
- Chapter 9: Shell Script Fundamentals
- Why Shell Scripts?
- Creating a Basic Shell Script
- Installing Scripts Locally
- Summary
- Chapter 10: Using Variables to Store, Read, and Manipulate Data
- Understanding Variable Scope: Environment vs. Shell Variables
- Exporting Shell Variables as Environment Variables
- Variable Syntax
- Common Variable Operations
- Enhancing the common Command with Variables
- Summary
- Chapter 11: Mastering Conditional Logic
- The if Statement
- The test Command
- Combining Statements on a Single Line
- The else Clause
- The elif Clause
- The case Statement
- Conditional Expressions
- Chaining Commands
- Extending the common Command to Handle Different Shells
- Summary
- Chapter 12: Using Loops with Files and Folders
- The for Loop
- The while Loop
- The until Loop
- The continue and break Statements
- Creating Compact Loops
- Updating the common Command to Loop Through Results
- Summary
- Chapter 13: Functions, Parameters, and Error Handling
- Creating a Function
- Passing Parameters to Functions
- Function Return Values
- Error Handling
- Simplifying the common Command with Functions
- Summary
- Chapter 14: Useful Patterns for Shell Scripts
- Ensuring Exit on Failure
- Debugging Shell Scripts with the Trace Option
- Checking for Existing Variables or Functions
- Unsetting Values
- Trapping Signals and Events
- Processing Complex Script Parameters
- Adding Syntax Highlighting
- Checking the Operating System
- Checking for Installed Programs
- Showing a Menu
- Running Commands in Subshells
- Anti-patterns
- Summary
- Part IV: Building Your Toolkit
- Chapter 15: Configuring Your Shell
- Interactive Shells
- Non-interactive Shells
- Login Shells
- Changing Your Shell
- Summary
- Chapter 16: Customizing Your Command Prompt
- The Command Prompt Structure
- Adding Color and Text Formatting to Your Prompt
- Adding Data to the Command Prompt
- Additional Shell Prompt Variables
- Writing a Shell Script to Customize the Command Prompt
- Summary
- Chapter 17: Managing Your Dot Files
- Dot Files Defined
- The Default Shell Dot File
- Creating Your Own Dot File
- Testing the Shell Dot File
- Sourcing the Shell Dot File
- Sourcing Files from a Folder
- A Dot File Installation Script
- Summary
- Chapter 18: Controlling Changes with Git
- What Is Git?
- Creating a Git Repository
- Adding and Resetting Changes to the Index
- Committing Changes
- Working with Branches
- The Git Log
- Resolving Conflicts
- Managing Files in Your Repository
- Restoring Your Working Tree
- Git Command Quick Reference
- Summary
- Chapter 19: Managing Remote Git Repositories and Sharing Dot Files
- Getting Started with GitHub
- Sharing Your Dot Files
- Collaborating with Other Users
- Writing a Shell Function to Open a Pull Request
- Showing Git Information in the Command Prompt
- Diving Deeper into Git
- Git at a Glance: A Recap of Key Concepts and Commands
- Summary
- Part V: Advanced Techniques
- Chapter 20: Shell Expansion
- Shell Expansion Operations
- Summary
- Chapter 21: Alternatives to Shell Scripting
- When to Avoid Shell Scripting
- Choosing a Programming Language
- Characteristics of Shell-Friendly Tools
- Writing a Dictionary Lookup Tool in Python
- Installing the Lookup Tool
- Improving the Lookup Tool
- Summary
- Chapter 22: The Secure Shell
- What Is SSH?
- Creating a Key Pair
- Setting Up an AWS Account
- Creating a Virtual Machine on AWS
- Using SSH to Connect to a Virtual Machine
- Dealing with Key Permission Errors
- Configuring SSH Hosts
- Running SSH Commands
- Handling Disconnections
- Transferring Files with scp
- Summary
- Chapter 23: The Power of Terminal Editors
- Why Use a Terminal Editor?
- Getting Started with Vim
- Navigating Through Text
- Adding a Command Count
- Inserting Text at Specific Positions
- Operating on a Range of Text
- Searching for Text Patterns
- Editing Commands
- Updating and Styling Your Vim Cheatsheet
- Going Further with Vim
- Summary
- Chapter 24: Mastering the Multiplexer
- Benefits of Using a Multiplexer
- Installing tmux
- Window Management with tmux
- Session Management with tmux
- Configuring tmux
- Collaboration with tmux
- A tmux Quick Guide
- Next Steps with tmux
- Summary
- Afterword: Generative AI and the Shell
- Installing and Running the Terminal AI Tool
- Chatting with ChatGPT
- Copying or Saving Results
- Executing AI-Generated Scripts
- Redirecting Responses to a File
- The Shell of the Future
- Appendix A: Setup
- Accessing the Shell
- Configuring the Shell
- Appendix B: Shell Basics
- Navigating Your Filesystem
- Managing Your Files and Folders
- The Clipboard
- Getting Help
- Index
- Colophon
- Resources
- Back Cover
مشخصات
نام کتاب
Effective Shell
نویسنده
Dave Kerr
انتشارات
No Starch Press
تاریخ انتشار
2025
ISBN
9781718504141
تعداد صفحات
475
زبان
انگلیسی
فرمت
حجم
4.9MB
موضوع
shell-scripting