Learn about everything there is to know about Linux Bash Scripting. A step by step process is used to explain every facet of these topics.
NOTE: This course includes information on application programming and design.
Gain a good understanding of the following concepts with this course:
What Bash scripting is?
Linux Certifications
How to develop using the Linux programming language
Features of the Linux programming language
Coding semantics
Application programming
Network programming
Learn about everything there is to know about Linux Bash Scripting. A step by step process is used to explain every facet of these topics.
NOTE: This course includes information on application programming and design.
Gain a good understanding of the following concepts with this course:
What Bash scripting is?
Linux Certifications
How to develop using the Linux programming language
Features of the Linux programming language
Coding semantics
Application programming
Network programming
Linux is the most popular platform in the world. These platforms are developed for by all companies such as Google, Facebook and Microsoft for mobile development. This course will ensure you are not left out as more and more companies request this awesome and powerful language. This course will teach you everything about programming Linux applications.
You will receive all the knowledge to use and leverage the powerful technology behind these amazing and wonderful platforms.
Over 400,000 students have enrolled on my courses and all of them are extremely satisfied. You will also be satisfied with this course. If you do not like the course, remember that within 30 days you can request a full refund. I guarantee you satisfaction.
If you have any questions regarding the topics covered in this course, please feel free to ask. I'm always happy to help those who want to learn.
To summarise this is what you get:
• Lifetime access to HD quality videos. No monthly subscription. Learn at your own pace, whenever you want.
• All videos are downloadable. Learn wherever you want, even without an internet connection.
• Downloadable starter code and final code for each section.
• Free helpful support in the course Q&A when you have questions or get stuck.
• Multiple coding challenges to practice your new skills (solutions included).
Sounds great? Then start this adventure today by clicking the “Take this course" button, and join me in the only Linux Programming course that you will need.
Course introduction
Learn about the differences between Bash, Shell, Command Line and Terminal.
Whenever it's required to take a look at the contents of a directory on the command line in Linux, ls is the command that's used. It lists the contents sorted in alphabetical order.
The pwd command, like ls and cd, is one of the most frequently used Linux utilities. Regardless of the kind of user you are (newbie or pro), you'll find yourself using this command line tool a lot. So in this tutorial, we will quickly discuss the basics of pwd through some easy to understand examples.
The cd command is one of the most frequently used commands in Linux, as it's used to change directories (one of the most basic command line operations). While most users restrict themselves to the basic usage of cd, there are many other features the tool provides.
The pushd command stores a directory path in the directory stack while the popd command removes the top directory path from the same stack. In addition, both these commands make the directory being working on as your new working directory.
While working on the Linux command line, there may be times when you'd encounter a file which is an archive (say a .zip file), but its extension (or lack of it) would suggest otherwise. It's in times like these, the file command proves helpful as it lets you determine the actual file type.
While find is no doubt one of the most popular as well as powerful command line utilities for file searching in Linux, it not fast enough for situations where-in you need instantaneous results. If you want to search a file on your system through the command line, and speed is the top most priority, then there's another command that you can use: Locate.
The which command in Linux lets users know about the absolute path of command line tools.
If your work involves running tools and scripts on the Linux command line, I am sure there are a lot of commands you would be running each day. Those new to the command line should know there exists a tool - dubbed history - that gives you a list of commands you've executed earlier.
Time to test your knowledge on navigation
Man pages are one of the most useful resources when it comes to understanding command line utilities. A man page, however, contains a lot of details about the command. There may be times when you'd want to quickly know - may be in a small line or so - what a command line tool does. Well, you'll be glad to know there exists a command that's specifically built for this purpose.
In Linux, if you ever need help regarding a command, all you need to do is to open its man page. But what if a situation arises wherein the requirement is to quickly search the names and descriptions of all available man pages? Well, Linux has got your covered, as there exists a command dubbed apropos that does exactly this for you.
A very useful aspect of the Linux command line is that the documentation for almost all command line tools is easily accessible. These documents are known as man pages, and you can easily access them through the command line using the man command.
Time to test your knowledge on getting help for commands
At any given time on the command line, you are in a directory. So it speaks for itself how integral directories are to the command line. In Linux, while the rm command lets you delete directories, it's the mkdir command that allows you create them in the first place.
Sometimes, while working on the command line in Linux, you might want to create a new file. Or, there may be times when the requirement is to change the timestamps of a file. Well, there exists a utility that can you can use in both these scenarios. The tool in question is touch, and in this tutorial, we will understand its basic functionality through easy to understand examples.
If you are new to Linux, it's worth knowing that command line is a very powerful tool, capable of doing almost all those tasks that you can do through the graphical interface. However, more often than not, you'll find yourself doing simple tasks on the command line. One such simple task is to copy files/directories.
Just like cp for copying and rm for deleting, Linux also offers an in-built command for moving and renaming files. It's called mv. In this article, we will discuss the basics of this command line tool using easy to understand examples.
Deleting files is a fundamental operation, just like copying files or renaming/moving them. In Linux, there's a dedicated command - dubbed rm - that lets you perform all deletion-related operations. In this tutorial, we will discuss the basics of this tool along with some easy to understand examples.
So we've already discussed the rm command that's primarily used for deleting files and directories from the Linux command line. However, there's another, related command line utility that is specifically aimed at removing directories. The tool in question is rmdir, and in this tutorial, we will discuss the basics of it using some easy to understand examples.
There are times when you create, say, a bash script on your Linux machine. But when you try running it, you get a permission error. What do you do? Simple, assuming you're on Ubuntu, right click on the file's icon, go to the 'Permissions' tab, and enable the 'Allow executing file as program' option.
Time to test your knowledge on working files
If you a regular Linux command line user, I am sure you must have used the cat command. The tool is mostly used for displaying contents of a file, although it provides many other small but useful features. In this article, we will discuss the cat command in detail, explaining some of its key features.
Sometimes, while working on the command line, you'll see outputs produced by commands in certain cases are so large that they don't fit into the screen area, and hence, you get to see only the last part of the output (as the initial part scrolls past the screen). Thankfully, there are utilities that are specifically designed to help you in such cases.
GNU nano is a text editor for Unix-like computing systems or operating environments using a command line interface. It emulates the Pico text editor, part of the Pine email client, and also provides additional functionality. Unlike Pico, nano is licensed under the GNU General Public License.
Time to test your knowledge of using text files
Sudo (superuser do) is a utility for UNIX- and Linux-based systems that provides an efficient way to give specific users permission to use specific system commands at the root (most powerful) level of the system. Sudo also logs all commands and arguments.
The main work of the su command is to let you switch to some other user during a login session. In other words, the tool lets you assume the identity of some other user without having to logout and then login (as that user).
If you are new to system administration in Linux, you'll gradually learn that user management is an important aspect of your work. The Linux command line offers several command-line utilities for this purpose, and one of them is the id command.
Time to test your knowledge on users
Ctrl + C is the interrupt signal. When you type this in a terminal, bash sends SIGINT to the job in the foreground.
We've already discussed the kill command that you can use in case you want to terminate processes in Linux. However, there exists another command line utility that you can use for the same purpose: killall. In this tutorial, we will discuss the basics of this command using some easy to understand examples.
If you are a Linux newbie, and your work involves doing stuff through the command line, then it goes without saying that you must be spending a lot of time on the terminal window. As you'd likely agree, there are some commands that we tend to use very frequently, like ls, cp, and rm. However, there are some others that are comparatively less used. In this tutorial, we will discuss one such, less frequently used command: Exit.
Time to test your knowledge for ending programs and logging out.
Ctrl D tells the terminal that it should register a EOF on standard input, which bash interprets as a desire to exit. Ctrl + D ( ^D ) means end of file.
Learn how to reduce clutter and clear the bash terminal screen.
Learn how to zoom in on the bash terminal.
Learn how to zoom out in the bash terminal.
Learn about moving the cursor in the terminal for advanced navigation.
Learn about deleting text in the bash terminal.
Learn about fixing typos in the bash terminal.
Learn about cutting and pasting in the bash terminal.
Learn about capitalising characters in the bash terminal.
Time to test your knowledge on shortcuts
Learn about the basic structure of a bash file.
In computing, echo is a command that outputs the strings it is being passed as arguments. It is a command typically used in shell scripts and batch files to output status text to the screen or a computer file, or as a source part of a pipeline.
You should be aware of the fact that you might not be the only person reading your code. A lot of users and system administrators run scripts that were written by other people. If they want to see how you did it, comments are useful to enlighten the reader.
Comments also make your own life easier. Say that you had to read a lot of man pages in order to achieve a particular result with some command that you used in your script. You won't remember how it worked if you need to change your script after a few weeks or months, unless you have commented what you did, how you did it and/or why you did it.
A variable in bash can contain a number, a character, a string of characters. You have no need to declare a variable, just assigning a value to its reference will create it.
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is generally considered as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. String may also denote more general arrays or other sequence (or list) data types and structures.
In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement.
In computer science, a for-loop (or simply for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly.
Use DO UNTIL loops when a condition is not true and you want to execute the loop until the condition is true. The DO UNTIL loop tests the condition at the end of the loop and repeats only when the condition is false. Otherwise the loop executes once and ends.
When a break statement is encountered, it terminates the block and gets the control out of the switch or loop. When a continue statement is encountered, it gets the control to the next iteration of the loop. A break causes the innermost enclosing loop or switch to be exited immediately.
User Input is one of the most important aspects of programming concepts. Every program should have some sort of user interaction, from getting a character's name for a game to asking for a password to log into a database.
IF Statement is one of the most popular instructions among the Decision Making statements. IF Statement gives the desired intelligence to a program, so that it can take decisions based on a criteria and most importantly decide the program flow.
CASE Statement. The CASE statement chooses from a sequence of conditions, and executes a corresponding statement. The CASE statement evaluates a single expression and compares it against several potential values, or evaluates multiple Boolean expressions and chooses the first one that is TRUE.
Command line argument is a parameter supplied to the program when it is invoked.Command line argument is an important concept in programming. It is mostly used when you need to control your program from outside.
In programming, a named section of a program that performs a specific task. In this sense, a function is a type of procedure or routine. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not return a value.
Global variables are declared outside any function, and they can be accessed (used) on any function in the program. Local variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions.
In computer programming, an array is a set of data elements stored under the same name. Arrays can be created to hold any type of data, and each element can be individually assigned and read. There can be arrays of numbers, characters, sentences, boolean values, and so on.
Environment variables such as $SHELL are valid systemwide. In a current Bash shell, $BASH points to the execution path of bash, whereas $SHELL points to the shell defined as default (which may be of the same value). For an explanation of environment variables see Environment Variables in Ubuntu Help.
Their primary purpose is to generate build artifacts through activities like compiling and linking source code. Build-automation servers. These are general web based tools that execute build-automation utilities on a scheduled or triggered basis; a continuous integration server is a type of build-automation server.
Aliases. A Bash alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence. If, for example, we include alias lm="ls -l. more" in the ~/.bashrc file, then each lm [1] typed at the command-line will automatically be replaced by a ls -l.
Alternatively referred to as a wild character or wildcard character, a wildcard is a symbol used to replace or represent one or more characters. The most common wildcards are the asterisk (*), which represents one or more characters and question mark (?) that represents a single character.
Using Multiple Commands. Linux allows you to enter multiple commands at one time. The only requirement is that you separate the commands with a semicolon. Running the combination of commands creates the directory and moves the file in one line.
Time to test your knowledge of Bash
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.