How to find PID of process listening on a port in Linux? netstat and lsof command examples

In Linux, many times, you want to find out the PID of a process which are listening on a port e.g. if multiple tomcat servers are running on a host then, how do you find the PID of the tomcat listening on port 8080? There are many UNIX commands to find the process using a specific port, but I'll share what I use. I always use the netstat command with -p option, which displays process id of the process listening on a port. Btw, netstat is not the only command to find all processes using a particular port, you can also use lsof command for the same purpose. If you remember, we have used lsof earlier to find all the processes accessing a file but it can also be used to find all processes accessing a specific port. You will see the example of both netstat and lsof commands in this article to find PID of process listening on a specific port in Linux.

Top 20 Core Java Interview Questions and Answers from Investment Banks

Core Java Interview Question Answer
This is a new series of sharing core Java interview question and answer on Finance domain and mostly on big Investment bank.Many of these Java interview questions are asked on JP Morgan, Morgan Stanley, Barclays or Goldman Sachs. Banks mostly asked core Java interview questions from multi-threading, collection, serialization, coding and OOPS design principles. Anybody who is preparing for any Java developer Interview on any Investment bank can be benefited from these set of core Java Interview questions and answers. I have collected these Java questions from my friends and I thought to share with you all. I hope this will be helpful for both of us. It's also beneficial to practice some programming interview questions because in almost all Java interview, there is at-least 1 or 2 coding questions appear. Please share answers for unanswered Java interview questions and let us know how good these Java interview questions are? If you are seriously preparing for Java Interviews and attending interviews, then I also suggest to take a look at Java Programming Interviews Exposed by Markham. This is the Java specific book modeled on their earlier best seller, also about programming interviews. This book contains questions not just from Java but also from related technology stack e.g. JUnit, Maven, Design Patterns, JVM Internals, Android and Best practices. Questions are good and answers are crisp and very well explained, which makes it interesting read as well.

5 Free OCAJP8, OCPJP8 Mock Exams and Practice questions - 1Z0-808 809 (Java 8 Certification)

In order to do well on Java certifications, you need good books and a reasonable number of practice questions before you go for exams. Practice questions and mock exams will help you to assess your topic-wise preparation level and help you to identify your strong and weak areas. Based upon the result of the mock exams, you can concentrate on areas where you lack expertise e.g. multi-threading is one of the tricky areas. It will also expose you to exam patterns and different types of questions you can expect in examination e.g. multiple choice questions, rearranging code, fill in the blanks etc. Though I highly recommend commercial exam simulators like Whizlabs and Enthuware, I also suggest you take advantage of many mock questions which are freely available. In general, free practice questions are not as good as those from Whizlabs and they lack explanation, but still they provide a chance to identify your weak and strong area. Since Java 8 certification is still quite new and there are not many resources, sample questions, and mock exams are available, I thought to collect and publish some of the free Java 8 mock exams which you can take online.

How to find length of String in SQL SERVER? LEN() Function Example

You can use LEN() function to find the length of a String value in SQL Server, for example, LEN(emp_name) will give you the length of values stored in the column emp_name. Remember this is different than the length of the actual column which you specify while creating table e.g. emp_name VARCHAR(60). To give you an example, you have a column called emp_name VARCHAR(60), which means the length of this column is 60 character, it can hold names with maximum 60 character long, but not all names are 60 character.  In this SQL SERVER tutorial, I will teach you how to use the LEN() function to find out actual length or number of character in a VARCHAR or CHAR field. This function is also explained in detail on my favorite book Microsoft SQL SERVER 2012 T-SQL Fundamentals, one of the best books to learn SQL SERVER in general and SQL SERVER 2012 particular.