Found 1437 Articles for Linux

How to Run a Command Multiple Times in Linux?

Mukul Latiyan
Updated on 19-Jul-2022 10:17:00

8K+ Views

There are scenarios where you would want to run a particular command for 'N' number of times. In normal programming, this can be done with the help of any of the loops constructs available in that programming language. In Linux bash too, we have loops available as some other ways with which we can repeat commands 'N' number of times. In this tutorial, we will explore different bash scripts that will allow us to run a certain command multiple times. The first step when you want to work with a bash script is to create one. On Linux or macOS ... Read More

Best Command Line HTTP Client for Linux

Mukul Latiyan
Updated on 22-Jul-2022 08:47:56

2K+ Views

In this tutorial, we will explore some of the most commonly used and famous HTTP clients that are present in Linux. A HTTP Client is a software that is mainly used to allow us to download files from the Internet. The primary reason for using HTTP clients is generally to download files, but these can also be used in case we want to debug or interact with a web server or multiple web servers.Now, let's consider the most famous HTTP Clients that are used.HTTPieWith the name that almost resembles of the famous web protocol (i.e., HTTP), HTTPie, is command line ... Read More

Array Operations in Linux bash

Mukul Latiyan
Updated on 18-Jul-2022 06:19:48

560 Views

Bash scripts are one of the most convenient approaches when we talk about making the command line processes automated in nature. They help us in doing a group of things in a simpler and more understandable manner, and we can do almost all theoperations that we could do in other languages as well.It is well known that the syntax of the bash can be tricky at first, and hence I will try to explain everything that I have used in this tutorial.We come across various situations where we would want to make use of bash scripts to perform different operations ... Read More

How to Create a New File in Linux from Bash?

Kiran Kumar Panigrahi
Updated on 16-Apr-2024 15:51:48

83K+ Views

Before getting into the ways of creating a file using Bash, let's first understand how Linux treats its files. Linux organizes all its data into files and files are organized into directories. Further, the directories are organized into tree-like structures called the file system. When you have to work in a Linux environment, you would definitely have to spend a lot of your time working on different types of files.There are various ways in which one can create a file in Linux. You can create a file from the Bash Shell or you can use the Desktop File Manager to ... Read More

Explain JMeter installation in macOS

Debomita Bhattacharjee
Updated on 08-Feb-2022 10:53:02

6K+ Views

JMeter installation is done in MacOS by following the below steps −Step1 − Navigate to the below URL −https://jmeter.apache.org/download_jmeter.cgiStep2 − Navigate to the section Apache JMeter , then click on the link with the .tgz file(to download) as highlighted below −Step3 − Click on the downloaded file, a folder named: apache-jmeter-5.4.3 gets created. Here, 5.4.3 is the JMeter version. Open the folder, we should have the content as shown below −Step4 − Open Terminal and navigate to the location of the bin folder(which is within the apache-jmeter-5.4.3 folder) and run the below command −sh jmeter.shAfter successfully running the above command, ... Read More

What are Alternative Ways to Reverse a String from Shell?

Prateek Jangid
Updated on 29-Nov-2021 10:51:44

462 Views

In the Linux shell, we have predefined commands to return a reversed string. Anyone can use these commands for reversing an output of the program.Perl CommandIt is a general-purpose programming language in Linux.Inputperl -ne 'chomp;print scalar reverse . "";'

How to Reverse a String using Unix Shell Programming?

Prateek Jangid
Updated on 29-Nov-2021 10:46:19

9K+ Views

Bash is a shell or command line interpreter. It is a layer programming language that understands and executes the command that a user enters or can read commands from a script. Essentially Bash or Shell allows users of Unix-like systems and Windows via a Windows subsystem for Linux to control the innermost components of the Operating system using text-based commands.In this article, we will discuss a problem to be solved by Shell scripting. We are given a String, and we need to print the reverse of that string using Shell Programming. For example, Input : str = “ Hello ” ... Read More

Resetting a Root Password in Linux without External Media

Prateek Jangid
Updated on 26-Nov-2021 06:56:45

354 Views

Discuss how to recover the root password of Linux without using any external media. The version of Linux we are working with is CentOS version 8.2. Still, the procedures we will see can work with any Linux distro and many others. You may find that it doesn’t work with some Debian-based distro.To do this exercise, you should have the following requisites Prerequisites −Willingness to work in the Linux command line environment.Physical access to the Linux server(it cannot do this across a network).Procedures to follow to change the root passwordRestart the computer and interrupt the boot process at the grub screen ... Read More

Where can I set environment variables that crontab will use?

Mukul Latiyan
Updated on 31-Jul-2021 12:29:08

882 Views

In normal cases we make use of the bash_profile or bashrc in case of Ubuntu and zshrc in case of Mac OS, to set our environment variables and then those variables are made available to us everywhere on the terminal we want.Let’s consider a simple example where we have some environment variable in bash_profile and we are making use of it in the terminal.Consider the bash_profile output shown below −immukul@192 dir1 % cat ~/.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$PATH:/usr/local/node/bin export GOROOT=/usr/local/go export GOPATH=/Users/immukul/go_projectsAs we can see there are many variables present in the bash_profile file, we can use these variables in ... Read More

What's the difference between nohup and ampersand (&) on Linux?

Mukul Latiyan
Updated on 31-Jul-2021 12:30:16

284 Views

Linux provides us with different utility commands that we can make use of to print a random line from any files in the Unix command line. Mostly we make use of either the shuf command or the sort command, and in this article I’ll explain both the commands and which one is better and why.Shuf CommandThe shuf command in Linux is used to write random permutations of the input lines to the standard output. The idea of randomizing the input is the same as one does when the cards are shuffled. On most of the Linux operating systems it is ... Read More

Advertisements