Linux command line and shell scripting techniques master practical aspects of the Linux command line and then use it as a part of the shell scripting process

Practical and actionable recipes for using shell and command-line scripting on your Linux OS with confidence. Linux Command Line and Shell Scripting Techniques begins by taking you through the basics of the shell and command-line utilities. You'll start by exploring shell commands for file, dir...

Descripción completa

Detalles Bibliográficos
Otros Autores: Dakic, Vedran, author (author), Redzepagic, Jasmin, author
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, Limited [2022]
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009655509406719
Tabla de Contenidos:
  • Cover
  • Title Page
  • Copyright and Credits
  • Contributors
  • Table of Contents
  • Preface
  • Chapter 1: Basics of Shell and Text Terminal
  • Technical requirements
  • Accessing the shell
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Setting up the user shell
  • Getting ready
  • How to do it…
  • How it works…
  • Setting up the Bash shell
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using the most common shell commands
  • Getting ready
  • How to do it…
  • How it works...
  • Using screen
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Chapter 2: Using Text Editors
  • Technical requirements
  • Learning the basics of the Vi(m) Editor
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Learning the basics of the nano editor
  • Getting ready
  • How to do it…
  • There's more…
  • Going through the advanced Vi(m) settings
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Chapter 3: Using Commands and Services for Process Management
  • Technical requirements
  • Process management tools
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Managing background jobs
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Managing process priorities
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Configuring crond
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Chapter 4: Using Shell to Configure and Troubleshoot a Network
  • Technical requirements
  • Using nmcli and netplan
  • Getting ready
  • How to do it
  • How it works
  • There's more
  • Using firewall-cmd and ufw
  • Getting ready
  • How to do it
  • How it works
  • There's more
  • Working with open ports and connections
  • Getting ready
  • How to do it
  • How it works
  • There's more
  • Configuring /etc/hosts and DNS resolving.
  • Getting ready
  • How to do it
  • How it works
  • There's more
  • Using network diagnostic tools
  • Getting ready
  • How to do it
  • How it works
  • There's more
  • Chapter 5: Using Commands for File, Directory, and Service Management
  • Technical requirements
  • Basic file and directory-based commands
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Additional commands for manipulating file/directory security aspects
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Manipulating text files by using commands
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Finding files and folders
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Archiving and compressing files and folders
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Managing services and targets
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Chapter 6: Shell-Based Software Management
  • Technical requirements
  • Using dnf and apt for package management
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using additional repositories, streams, and profiles
  • Getting ready
  • How to do it…
  • How it works…
  • Creating custom repositories
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Compiling third-party software
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Chapter 7: Network-Based File Synchronization
  • Technical requirements
  • Learning how to use SSH and SCP
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Learning how to use rsync
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using vsftpd
  • Getting ready
  • How to do it…
  • How it works…
  • There's more
  • Chapter 8: Using the Command Line to Find, Extract, and Manipulate Text Content.
  • Technical requirements
  • Using text commands to merge file content
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Converting DOS text to Linux text and vice versa
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using cut
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using egrep
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using sed
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Chapter 9: An Introduction to Shell Scripting
  • Technical requirements
  • Writing your first Bash shell script
  • Getting ready
  • How to do it…
  • How it works…
  • Serializing basic commands - from simple to complex
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Manipulating shell script input, output, and errors
  • Getting ready
  • How to do it…
  • How it works…
  • Shell script hygiene
  • Getting ready
  • How to do it…
  • There's more…
  • Chapter 10: Using Loops
  • The for loop
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • break and continue
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • The while loop
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • The test-if loop
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • The case loop
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Logical looping with and, or, and not
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 11: Working with Variables
  • Technical requirements
  • Using shell variables
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using variables in shell scripting
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Quoting in the shell
  • Getting ready
  • How to do it…
  • How it works…
  • See also.
  • Performing operations on variables
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Variables via external commands
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 12: Using Arguments and Functions
  • Technical requirements
  • Using custom functions in shell script code
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Passing arguments to a function
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Local and global variables
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Working with returns from a function
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Loading an external function to a shell script
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Implementing commonly used procedures via functions
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 13: Using Arrays
  • Technical requirements
  • Basic array manipulation
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Advanced array manipulation
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 14: Interacting with Shell Scripts
  • Technical requirements
  • Creating text-based interactive scripts
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using expect to automate repetitive tasks based on text output
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using dialog for menu-driven interactive scripts
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 15: Troubleshooting Shell Scripts
  • Technical requirements
  • Common scripting mistakes
  • Getting ready
  • How to do it…
  • How it works…
  • See also…
  • Simple debugging approach - echoing values during script execution
  • Getting ready
  • How to do it…
  • How it works…
  • See also.
  • Using the bash -x and -v options
  • Getting ready
  • How to do it…
  • How it works…
  • See also…
  • Using set to debug a part of the script
  • Getting ready
  • How to do it…
  • How it works…
  • See also…
  • Chapter 16: Shell Script Examples for Server Management, Network Configuration, and Backups
  • Technical requirements
  • Creating a file and folder inventory
  • How to do it…
  • See also
  • Checking if you're running as root
  • Getting ready
  • How to do it…
  • See also
  • Displaying server stats
  • Getting ready
  • How to do it…
  • There's more…
  • Finding files by name, ownership, or content type and copying them to a specified directory
  • Getting ready
  • How to do it…
  • There's more…
  • Parsing date and time data
  • Getting ready
  • How to do it…
  • Configuring the most common firewall settings interactively
  • Getting ready
  • How to do it…
  • There's more…
  • Configuring network settings interactively
  • Getting ready
  • How to do it…
  • There's more…
  • Backing up the current directory with shell script arguments and variables
  • Getting ready
  • How to do it…
  • There's more…
  • Creating a current backup based on the user input for the backup source and destination
  • Getting ready
  • How to do it…
  • There's more…
  • Chapter 17: Shell Script Examples
  • Technical requirements
  • Implementing a web server service and security settings
  • Getting ready
  • How to do it…
  • See also
  • Creating users and groups and forcing users to change them on the next login
  • Getting ready
  • How to do it…
  • See also
  • Creating users and groups from a standardized input file and a random password for each user
  • Getting ready
  • How to do it…
  • See also
  • Scripted VM installation on KVM
  • Getting ready
  • How to do it…
  • See also
  • Using a shell script to provision SSH keys
  • Getting ready
  • How to do it…
  • See also.
  • A shell script for VM administration.