Satish Kumar has Published 1032 Articles

fd An Alternative to the Linux find Command

Satish Kumar

Satish Kumar

Updated on 25-Jan-2023 10:30:32

3K+ Views

The fd command is a popular alternative to the find command in Linux. It is a faster and more user-friendly version of find, and is written in Rust for performance. Some of the key features of fd include the ability to search using regular expressions, a more natural syntax for ... Read More

Guide to Generate Random Numbers in Linux

Satish Kumar

Satish Kumar

Updated on 25-Jan-2023 10:24:42

13K+ Views

In Linux, you can generate random numbers using the random or urandom files in the /dev directory, which are special files that generate random data. To generate a random number between 0 and 32767, you can use the command echo $((RANDOM)). To generate a random number within a specific range, ... Read More

Remove Lines Which Appear in File B From Another File A in Linux

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:48:17

7K+ Views

You can use the grep command in Linux to remove the lines from file A that appear in file B. The basic syntax is − grep -v -f fileB.txt fileA.txt > outputFile.txt This command uses the -v option to invert the match, so that it returns lines that do ... Read More

Running Multi-Line Shell Code at Once From Single Prompt

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:47:32

24K+ Views

You can run multi-line shell code at once by using a shell script or by using a command line tool such as the bash or sh command to execute the code in a single prompt. To create a shell script, you can use a text editor to write the code ... Read More

Running Script or Command as Another User in Linux

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:46:40

29K+ Views

There are several ways to run a script or command as another user in Linux. One way is to use the "su" command, which stands for "switch user." For example, to run a command as the user "john, " you would use the following syntax: "su john -c 'command'" Another ... Read More

Storing a Command in a Variable in a Shell Script

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:36:54

692 Views

In a shell script, you can store a command in a variable by using the syntax − variable_name="command" For example − current_date="date" You can then execute the command stored in the variable by prefixing it with $ − $current_date This will execute the command date. Storing the ... Read More

Specify an Editor for Crontab on Linux

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:35:31

3K+ Views

The default editor for crontab on Linux is the vi editor. However, this can be changed by setting the VISUAL or EDITOR environment variable to the desired editor before running the crontab command. For example, to use nano as the editor for crontab, the command would be − export VISUAL=nano; ... Read More

Monitoring Network Usage in Linux

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:33:59

15K+ Views

Linux monitoring refers to the process of tracking and analyzing various aspects of a Linux system's performance, such as CPU usage, memory usage, disk usage, network traffic, and system uptime. The goal of Linux monitoring is to detect and diagnose any issues that may be impacting the performance or stability ... Read More

Delete the History of the Last n Commands on Linux

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:32:40

13K+ Views

In Linux, the command history is a record of previously executed commands. The command history is stored in a file called . bash_history, which is located in the home directory of each user. The history command can be used to view the command history, and the history command can also ... Read More

Run a Java Application as a Service on Linux

Satish Kumar

Satish Kumar

Updated on 24-Jan-2023 19:29:20

7K+ Views

A simple service in Linux is a program that runs in the background and performs a specific function or set of functions. These programs can be started automatically at boot time, and can be controlled using the command line or through a system service manager such as systemd or Upstart. ... Read More

Advertisements