Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Shell Scripting Essentials

You're reading from   Linux Shell Scripting Essentials Learn shell scripting to solve complex shell-related problems and to efficiently automate your day-to-day tasks

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781785284441
Length 282 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. The Beginning of the Scripting Journey FREE CHAPTER 2. Getting Hands-on with I/O, Redirection Pipes, and Filters 3. Effective Script Writing 4. Modularizing and Debugging 5. Customizing the Environment 6. Working with Files 7. Welcome to the Processes 8. Scheduling Tasks and Embedding Languages in Scripts Index

Special files


The files other than regular files, directories, and link files are special files. They are as follows:

  • The block device file

  • The character device file

  • The named pipe file

  • The socket file

The block device file

A block device file is a file that reads and writes data in block. Such files are useful when data needs to be written in bulk. Devices such as hard disk drive, USB drive, and CD-ROM are considered as block device files. Data is written asynchronously and, hence, other users are not blocked to perform the write operation at the same time.

To create a block device file, mknod is used with the option b along with providing a major and minor number. A major number selects which device driver is being called to perform the input and output operation. A minor number is used to identify subdevices:

$ sudo mknod  block_device b 0X7 0X6

Here, 0X7 is a major number and 0X6 is a minor number in hexadecimal format:

$ ls -l block_device
brw-r--r--. 1 root root 7, 6 Aug 24 12:21 block_device...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime