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, 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: , , ,