Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying The Ultimate Linux Shell Scripting Guide
  • Table Of Contents Toc
  • Feedback & Rating feedback
The Ultimate Linux Shell Scripting Guide

The Ultimate Linux Shell Scripting Guide

By : Donald A. Tevault
4.8 (5)
close
close
The Ultimate Linux Shell Scripting Guide

The Ultimate Linux Shell Scripting Guide

4.8 (5)
By: Donald A. Tevault

Overview of this book

Embark on a comprehensive journey through command shells with this hands-on manual. While Bash is a Linux staple, Z shell and PowerShell are rising stars, applicable to Linux, macOS, and Unix. Progress seamlessly through chapters, each building on the last, creating a solid foundation. Learn through a unique approach: concepts, examples, and interactive labs. These labs, nearly a hundred strong, form the core of experiential learning, essential for script creation. Focusing on Linux commands and their scripting applications, this manual is universally relevant across Linux and select Unix-like systems. It goes beyond theory, offering practical scripts for real-world Linux administration. Scripts are designed for manageability, aiding learning and troubleshooting. The goal is to nurture the ability to craft intelligent, functional shell scripts. While centered on Bash, this book offers a peek into the future with Z Shell and PowerShell, expanding your skills and adaptability. This book is systematically structured and engaging so that it will guide you to master command shells, equipping you for real-world Linux challenges.
Table of Contents (26 chapters)
close
close
24
Other Books You May Enjoy
25
Index

Using split

You can use split to break one large text file into two or more smaller ones. By default, it takes a large file and splits it into smaller files of 1,000 lines each. (Of course, the last file may be smaller.) Also by default, the names of these new small files will be xaa, xab, xac, and so on. Let’s begin by looking at the line-count of the public-domain ebook file that you downloaded from Project Gutenberg, like so:

[donnie@fedora ~]$ wc -l pg6409.txt
6019 pg6409.txt
[donnie@fedora ~]$

Since there are 6,019 lines in this file, split will break it into six files of 1,000 lines each, and one file of only 19 lines. Here’s how it works:

[donnie@fedora ~]$ split pg6409.txt
[donnie@fedora ~]$ ls -l x*
-rw-r--r--. 1 donnie donnie 38304 Sep 15 17:31 xaa
-rw-r--r--. 1 donnie donnie 48788 Sep 15 17:31 xab
-rw-r--r--. 1 donnie donnie 42676 Sep 15 17:31 xac
-rw-r--r--. 1 donnie donnie 42179 Sep 15 17:31 xad
-rw-r--r--. 1 donnie donnie 54845 Sep 15 17:31...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY