Showing posts with label linux and unix. Show all posts
Showing posts with label linux and unix. Show all posts

Monday, June 18, 2012

Displaying All Active Internet Connections In Linux

Friends it is  necessary to display what Internet connections are active on your Linux machine. For example, seeing the Apache service is actively running or not, and if running what network ports it's listening to. To do this run the below netstat command in the command line.

netstat -natp



If you have root privileges running the above command will give an output similar to the below example.



Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 16271/hpiod
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4917/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8030/apache2
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 15978/cupsd
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 16276/python
tcp6 0 0 :::5900 :::* LISTEN 5752/vino-server
tcp6 0 0 :::22 :::* LISTEN 5062/sshd
tcp6 0 148 ::ffff:192.168.2.102:22 ::ffff:192.168.2.1:3027 ESTABLISHED7534/sshd: hope [
tcp6 0 797 ::ffff:192.168.2.1:5900 ::ffff:192.168.2.1:2592 ESTABLISHED5752/vino-server


                                  
                           
                            
                   ***Thanks Friends***

Saturday, April 21, 2012

How can I Renew Or Release An IP In Linux?


If you love to work in Linux then this commands will really help you!!!!!!!!!!!!!!!!!!!!!

Coming from a Microsoft operating system to Linux you may be surprised to see there is not an option for ifconfig to release and renew an IP address. Below are two different methods of how this can be done at the command line.


ifconfig eth0 down:-

Running the above command would take the eth0 interface (the first network card) down. Which is the same as releasing the IP address from that network card.


ifconfig eth0 up:-

After the interface is taken down, typing in the above command would bring that interface back up.


      Thanking you Friends..........

How To Change The Prompt


Hello friends how are you?????today i will share to all of you something really interesting about prompts in DOS and  Unix and Linux....


Microsoft DOS users:-


To change the prompt in MS-DOS you must utilize the prompt command followed by special codes used in conjunction with the prompt command. Below are some commonly used prompts.

prompt $p$g

Changes the prompt to the standard used prompt in MS-DOS listing the drive with the current path, similar to what is seen below.
C:\>

prompt $t $d$_$p$g

Change the prompt to list the time and date above the standard prompt, similar to what is seen below.
13:38:49.78 Mon 02/17/2003
C:\>


Unix and Linux users:-


Changing the prompt in Unix and Linux varies depending on what shell you are using.
If you are using the C Shell, type:

set prompt="`hostname`>"

Displays the hostname in the prompt, similar to the below prompt:
Computer>

set prompt="`pwd`>"

Displays the working directory with the prompt:
/root>

set prompt="`hostname`(`pwd`)>"

Displays the hostname along with the working directory:
Computer(/root)>



------------------------Thanking You Friends--------------------------------

Popular Posts