The purpose of this tutorial is to show various methods on how to rename or replace white space in multiple files. Some tools on a Linux system may not work properly with files that contain white spaces, which would give some users motivation to replace the white space with underscores, for example. Manipulating files without white space is much easier, as you do not have to worry about escaping the file name each time.
Programming & Scripting
How to extract a number from a string using Bash example
The purpose of this tutorial is to show how to extract a number from a string using Bash – that is, either in a Bash script or from the Linux command line. It is common to use Bash as a utility to process strings or other textual data, so it is well equipped for the task of separating numbers out of a string. There are numerous ways to achieve this; see some of the examples below to get started.
How to manage git repositories with Python
Neither Python nor Git need presentations: the former is one of the most used general-purpose programming language; the latter is probably the most used version control system in the world, created by Linus Torvalds himself. Normally, we interact with git repositories using the git binary; when we need to work with them using Python, instead, we can use the GitPython library.
Ping sweep script to scan and monitor network
In this tutorial, we will provide a few Bash scripts to scan and monitor the network using combination of commands such as ping
. Obviously, these scripts are no match to a full monitoring dedicated software like nagios, but they could be useful for small home brand networks, where implementing sophisticated monitoring systems can become too much overhead.
C++ : Understanding pointers
This tutorial is intended for all programing enthusiasts on all levels that wish to understand pointers in the C++ language. All code presented here is not compiler-specific, and all examples will be written in plain ANSI C++. Debates about pointers can stretch for miles, and you would need to go really far to master it all.
Write first bash script
After reading this short shell scripting tutorial, you will be able to to create and execute your own Bash shell script. No previous knowledge of shell scripting is required. However, you are expected to have some knowledge of how to start a command line terminal and how to edit text files with some text editor of your choice.
How to use bash array in a shell script
In this tutorial we will see how to use bash arrays and perform fundamental operations on them. Bash, the Bourne Again Shell
, it’s the default shell on practically all major linux distributions: it is really powerful and can be also considered as a programming language, although not as sophisticated or feature-reach as python or other “proper” languages. Furthermore, the Bash scripting is a must skill for any Linux system administration job.
Bash get yesterday date
The purpose of this tutorial is to show how to get yesterday’s date via the Bash command line on a Linux system. The date command gives us a few ways to accomplish this. Check out the examples below to see how to retrieve yesterday’s date in Bash.
Show Bash script usage
Is it best practice to include usage in every Bash script that you create. This gives the user an idea of what options the script is expecting, so they can use it as intended. It also gives the script some error checking ability to make sure that the user has supplied arguments in the expected way.
Bash script: While loop examples
The while
loop in a Linux Bash script is a type of loop that continues to execute as long as the programmed condition remains true.
Bash Scripting: Operators
Using operators in a Bash script is how you determine whether a condition is true or not. And testing for conditions is how we program a Bash script to be dynamic by giving it the ability to respond differently depending on a scenario.
Bash Scripting: Command line arguments
In some Bash scripts, there is an option to pass arguments to the script when you are executing it. This allows the user to specify more information in the same command used to run the script.