Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Bash Shell Scripting Tutorial for Beginners
Rating: 4.5 out of 5(877 ratings)
9,144 students

Bash Shell Scripting Tutorial for Beginners

Learn Bash Shell Scripting to automate the frequently performed tasks
Created byYogesh Patel
Last updated 6/2018
English
English [Auto],

What you'll learn

  • By the end of it you will be familiar with most of the common tasks we normally do on Bash scripting
  • You will be comfortable, efficient, and effective at the shell scripting
  • Automate the frequently performed tasks.

Course content

2 sections87 lectures10h 1m total length
  • Introduction7:57

    Explore why the Linux command line matters, learn the shell and terminal roles, and practice basic navigation from root to home, using pwd, cd, and ls commands.

  • ls command in Linux17:14

    Learn how the ls command lists Linux directory contents, uses -l for long format and -a for hidden files, redirects output to a file, navigating with two dots.

  • cd command in Linux11:26

    Learn to use the cd command in Linux to change the current directory, navigate to home or root, and handle spaces with quotes or backslashes.

  • cat command in Linux9:14

    Explore the cat command in linux to display file contents, concatenate files, and create new text files, using options like -n, -b, -s, and -E, and consult man pages.

  • I/O Redirection8:50

    Master i/o redirection in bash by sending command output to files, appending with '>>', and combining file contents using cat and redirect operators.

  • mkdir Command6:14

    Learn how to use the mkdir command in bash to create directories and nested structures in Linux, including the -p flag for parent directories and brace expansion for multiple names.

  • rm and rmdir commands for linux12:29

    Learn to use rm and rmdir on Linux to delete files and directories, remove empty directories with rmdir, delete directories that contain files with rm -r, and view verbose output.

  • cp command11:52

    Learn to copy files and directories with the cp command in Linux, using -R for recursive copies and -i to prevent overwriting.

  • mv command11:33

    Learn how to use the mv command to rename and move files and directories, handle overwriting with interactive prompts, and create destinations when needed.

  • less command7:14

    Learn to use the less command to read and navigate large text files in Linux, with arrow keys, space for page down, B for page up, and / to search.

  • touch command5:03

    Learn how to use the touch command in Linux to create new empty files and update their timestamps, and view changes with a long listing of permissions and times.

  • nano command6:53

    Learn to use nano, a small Linux text editor, to create and edit files, save with ctrl+o, exit with ctrl+x, and cut/paste with ctrl+k and ctrl+u, with C++ syntax highlighting.

  • sudo command8:05

    Learn how to use the sudo command in Linux to run commands as administrator, solve permission denied issues, and install software with apt-get.

  • top command8:04

    Learn to use the top command in Linux to monitor processes and memory, view process IDs, adjust refresh rate, filter idle processes, and kill a process by PID.

  • kill command8:47

    Learn how to kill Linux processes using the kill command, locate PIDs with ps and top, and force termination with kill -9 or kill -KILL.

  • echo command7:50

    Learn to use echo command to display text and variables in bash, declare variables with no spaces around =, and show values with echo $var; explore escape sequences with -e.

  • file permissions, symbolic permissions and chmod12:27

    Master Linux file permissions by using symbolic permissions with chmod to grant or revoke read, write, and execute rights for user, group, and others.

  • directory permissions and chmod7:16

    Change directory permissions in Linux and inspect them with ls -l, observing how removing read, write, or execute rights affects access and file creation inside a directory.

  • Octal and Numerical permissions (chmod)9:33

    Learn how to use octal permissions and the chmod numeric notation to set read, write, and execute permissions for user, group, and others in Linux.

  • Introduction to Bash Scripting9:54

    Learn to create and run bash scripts in Linux, including hello world, using nano and the hash bang line, locate bash, grant execute permission with chmod, and run the script.

  • which and whatis command5:17

    Learn how to use the which command to locate the full path of commands and scripts, and how the whatis command displays brief descriptions from manual pages.

  • useradd command (Creating Users)7:02

    Learn to create Linux users with the useradd command, set a home directory, choose a shell, assign a group, and use sudo and passwd to set the password.

  • userdel command (Removing Users)5:00

    Shows how to delete a Linux user with sudo using the userdel command, preserving the home directory by default, and using -r to remove the home directory when desired.

  • Basic Group Management (groups, groupadd, groupdel)6:34

    Explore basic Linux group management using commands like groups, groupadd, and groupdel, then add or remove users from groups and verify group memberships.

  • .bashrc File7:13

    Learn how the .bashrc file runs at every new interactive terminal session and how to customize it with aliases, environment variables, and handy bash commands.

  • Viewing Resources (du , df, free command)9:51

    Learn to view disk and memory usage with df, du, and free, with human readable output using -h and quick summaries with -s.

  • watch command3:42

    Learn how to use the Linux watch command to run a command at set intervals, monitor resources, and adjust frequency from seconds to fractional seconds.

  • Head and Tail Commands6:49

    Learn head and tail commands in Linux to print the first or last lines of a file, with -n and -f/--follow options for log files.

  • find command7:14

    Learn to use the find command to search files in a directory hierarchy, using -name and wildcards, from home or root, with sudo, and filter by minus one day.

  • wc command4:20

    Learn to use the wc command to count lines, words, and characters, print bytes with -c, and find the longest line with -L, with practical examples.

  • cal command3:49

    Learn how to use the cal command on Linux to display calendars on the command line, including the current month, year views, and navigation with flags.

  • date command5:54

    Learn to use the date command to display the current date and time and format it with a plus string, and explore -s to set the system date.

  • How to Run multiple Terminal Commands9:15

    Learn to run multiple terminal commands in Bash by using a semicolon to sequence commands, and logical operators like && and || to control execution based on success or failure.

  • apt-get command to Install Software12:28

    Learn how to use apt-get on Debian-based systems to install, update, remove, and manage packages, including dependencies and common flags.

  • ifconfig command8:29

    Learn to view and configure Linux network interfaces with the ifconfig command, identify wired and wireless interfaces, read MAC and IP addresses, and manage up or down states with sudo.

  • tar command to Compress and Extract Files5:54

    Learn how to use tar to create and extract archive files, including options for creating, extracting, and naming archives, with compression as demonstrated.

  • grep command10:50

    Explore the grep command to search patterns in text files using global regular expression print, with case-insensitive searches, line-number output, and multi-file wildcard matching.

  • netstat command12:33

    Learn to use netstat on Linux to display network connections, routing tables, and interface statistics; filter by tcp, udp, and unix, view listening ports with -l, and addresses with -n.

  • How to Enable SSH in Ubuntu 16.04 LTS (Install openssh-server)5:04

    enable ssh on Ubuntu 16.04 LTS by installing openssh-server, verify ssh client and server, and learn to connect securely to remote or local hosts using ssh with optional port changes.

  • How to Install PuTTY on Windows + SSH Connections Using PuTTY on Windows5:44

    Install PuTTY on Windows and use SSH to log into a remote server with its IP address on port 22, using your username and password.

  • scp command - SCP to Securely Transfer Files/Folders in Linux10:14

    Master scp to securely transfer files and directories between local and remote Linux hosts in both directions, using recursive -r, port -P, and -i for private key authentication.

Requirements

  • Some knowledge of the terminal commands would be helpful, but not required.
  • Linux machine / Linux virtual machine.

Description

Linux has a variety of different shells Like Bourne shell (sh), C shell (csh), Korn shell (ksh), TC shell (tcsh), Bourne Again shell (bash). Certainly the most popular shell is “bash”. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh).  bash is not only an excellent command line shell, but a scripting language in itself. Shell scripting allows us to use the shell's abilities and to automate a lot of tasks that would otherwise require a lot of commands.

Bash scripting will help you automate routine tasks and save valuable time, whether you're a sys admin, Linux user or software developer. Shell script is much quicker than programming in any other languages.

The goal of this course is to provide you with a working knowledge of Bash scripting. We'll start with the basics, starting from creating our first Bash script and running it. Next you will learn about the bash environment, local variables, conditional statements, functions, loops, case statements, string operations, and coprocesses.


Who this course is for:

  • This course is designed for beginners, especially users who have never written bash script before
  • People thinking about a career as a Linux system administrator or engineer, but need the basics first.