Sunday 14 March 2021

How to setup firewall in Linux? - Iptables Tutorial

Hi, firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. Linux firewall can be implemented using several tools such as iptables, UFW (Uncomplicated Firewall), firewalld, etc. In this tutorial, we will be focusing on iptables, which is the most commonly used firewall tool in Linux.

Step 1: Install iptables

In most Linux distributions, iptables is pre-installed by default. However, if it is not installed, you can install it using the following command:

sudo apt-get install iptables

Read more »

Labels: , ,

Monday 21 December 2020

Top 10 example of sort command in UNIX or Linux

Sorting is an essential task when working with data, especially large datasets. In Unix and Linux systems, the 'sort' command is used to sort files or data streams. In this blog article, we will explore ten examples of the 'sort' command that are frequently used in Unix and Linux systems.

Example 1: Sort a File Alphabetically

To sort a file alphabetically, you can use the following command:

sort file.txt

This command will sort the contents of 'file.txt' in alphabetical order and print the result on the console.

Read more »

Labels: , , ,

Sunday 13 December 2020

Finding IP address from hostname in UNIX and Linux

In Unix and Linux operating systems, it is often necessary to find the IP address associated with a hostname. This can be useful for a variety of reasons, such as troubleshooting network connectivity issues, configuring network services, or performing security audits. There are several commands available in Unix and Linux that can be used to find the IP address of a hostname, including nslookup, dig, and host. These commands query the DNS server to retrieve the IP address associated with a given hostname. In this way, they help to resolve human-readable domain names into machine-readable IP addresses. In this context, we will explore some examples of how to find the IP address of a hostname in Unix and Linux

In Unix and Linux operating systems, there are several ways to find the IP address of a hostname. Some of the most common methods are:

Read more »

Labels: , , ,

Thursday 12 March 2020

Top 10 Examples of scp command in Linux

The SCP (Secure Copy) command in Linux is used to securely transfer files between two hosts over a network. 

Here are the top 10 SCP commands with a brief explanation and code examples:


1.Copy a file from a local host to a remote host:

scp file.txt user@remotehost:/path/to/destination

Read more »

Labels: , ,

Thursday 5 March 2020

solaris command to show long argument of running process - Examples

In Unix-based operating systems like Solaris, each running process has a set of arguments that are passed to it when it is started. These arguments can include both short and long options, as well as values for those options.

The pargs command in Solaris is used to display the arguments of a running process. By default, it displays the short arguments of the process, but with the -l option, it can be used to display the long arguments as well.

This can be useful for troubleshooting and debugging, as it allows you to see exactly how a process was started and what options and values were passed to it. It can also be used to verify that a process is running with the correct options and values.

In Solaris, you can use the pargs command to display the arguments passed to a running process. The pargs command prints the complete argument list for a process, including the command name and any arguments passed to it.


Here's an example of how to use the pargs command:

First, find the process ID (PID) of the running process whose arguments you want to view using the ps command. For example, to find the PID of a process named myprocess, run:

$ ps -ef | grep myprocess


This will show a list of all processes that match the name myprocess, along with their PIDs.

Once you have the PID of the process, use the pargs command to view its arguments. For example, to view the arguments of a process with PID 1234, run:

$ pargs 1234



This will print the complete argument list for the process, including the command name and any arguments passed to it.

$ pargs 1234 /bin/bash /path/to/script.sh arg1 arg2 arg3



In this example, the pargs command shows that the process with PID 1234 was started with the command /bin/bash and the arguments /path/to/script.sh, arg1, arg2, and arg3.


Labels: , , ,

Wednesday 15 January 2020

top 10 examples of date command in Linux

The date command in Linux is used to display and set the system date and time. It is a powerful tool that can display the date and time in various formats, set the system date and time, and perform simple date calculations. 

Here are 10 examples of how the date command can be used in Linux:

Display the current date and time:

date Output: Thu Mar 24 13:25:36 EDT 2022

Read more »

Labels: , ,