Tag: bash

Bash: Passing Arguments Through Curl

In this quick guide I will show you how to pass arguments to scripts while using curl. Sometimes you may have a script that you wish to curl multiple times or on multiple servers but also need to pass arguments to them. Rather than wget, chmod, and then execute, you can curl and pipe said script directly into bash with …

How To Use Background And Foreground Processes

Today I will be showing you how to use background and foreground processes in Linux. What is a background process? You can send processes to the background when you don’t need to interact with them right away in order to continue using your current shell. You can actually have multiple background processes at the same time and switch back and …

Running Commands Automatically Over SSH

In this quick and simple post I will be showing you an easy way to automatically run commands over SSH. This method works great with bash loops if you need to run the same commands over multiple servers. Using this method automatically disconnects once the command or commands are finished executing, you will receive the full output however.

How To Switch Between Shells In Linux

Today I will be showing you how to switch between the different shells on your system. This includes both temporarily entering a different shell (sub shell) as-well as permanently setting a different shell with the csch command.

Using CAT And Bash Redirection To Write To Files

In this post I will show you how to use bash redirection to write to a file using the cat command. This is a very simple trick that you can use for all sorts of things when it comes to bash scripting including setting up certain configuration files when more powerful options aren’t available or aren’t worth using. You can …

Using Basic Loops In Bash Scripts

In this post I will be showing you how to use some of the basic loop functions available in bash scripting. These loops (especially a basic for loop) come in handy and are used pretty much daily for me. You can run these loops directly from the terminal, you do not need to actually save them as a script to …

Using If Statements In Bash

In this post I will be showing you how to use if statements in bash. If statements are basically what they sound like, if this then that. That being said they can also be written with other conditions. Below I will show some of the examples of different if statements.