Disclosure: This article may contain affiliate links. When you purchase, we may earn a commission.

10 Examples of head and tail command in Linux

Hello guys, if you are wondering how to use head and tail command in Linux then you have come to the right place. Both head and command are great tool to view content from files in Linux. As the name suggest, "head" is used to view the top portion of the file and "tail" is used to see the file content from bottom. For example when you say "head data.json" then it will display first 10 lines of the file and when you say "tail data.json" then it will display last 10 lines of the file. As a Java developer, I find myself using tail more often than head while checking logs. As you can use tail to see the last few lines of the log file and you can also use tail -f application.log to see the logs rolling in real time. I often use this command to track request and see what application is doing at a particular time. 

Difference between JDK and JRE in Java Platform

Java Platform offers JRE and JDK to run Java programs. JRE stands for Java runtime environment and JDK stands for Java development kit. JRE is meant for normal users, who wants to run Java program in their computer. JRE is normally used to run Java programs downloaded over internet e.g. Java Applets and Java Desktop application built using AWT and Swing. The main difference between JRE and JDK, comes from the fact that they are different tools. JDK is created for Java programmers and contains tools required for Java programming, like javac for compiling Java source files to .class files. Without JDK, you can not create Java applications and programs. 

Difference between this and super keywords in Java

this and super are two special keywords in Java, which is used to represent current instance of a class and it's super class. Java Programmers often confused between them and not very familiar with there special properties, which is asked at various core Java interviews. A couple of questions, which I remember about this and super keyword is  that, Can we reassign this in Java?  and the difference between this and super keyword in Java. Do you want to try that? Ok, I am not giving the answer now, rather I will let you know the answer at the end of this post. 

10 Examples of more and less command in Linux

Hello guys, if you have been working on Linux then you must have come across less and more commands. They are the most popular command to view content of a file, particular log file in Linux.  In fact, less is my favorite command to see the logs in Linux because you can open both normal log file as well as a gzip or compressed log file using less command for viewing. It's also very well designed and fast command and you easily open even large log files using less which you would otherwise struggle to open using Windows tool like Notepad or Notepad++.  In the past, I have shared examples of lsofcurl, netstat, and ssh command and in this article, I am going to share common examples of both less and more command.

How to use String literals in switch case in Java? Example Tutorial

Switch Statements are not new for any Programmer, it is available in C, C++, Java and in all major programming language. The switch statement in Java allows you to a clear, concise, and efficient multiple-branch statement without lots and lots of messy if-else statements. But Java Switch and case statement have a limitation, you cannot use String in them. Since String is one of the most used classes in Java, and almost every program, starting from Hello World to a complex multi-tier Java application uses them, it makes a lot of sense to allow them in the Switch case. In Java 6 and before, the values for the cases could only be constants of integral type e.g. byte, char, short, int, and enum constants. If you consider Autoboxing then you can also use the corresponding wrapper class like Byte, Character, Short, and Integer.

10 Example of SSH Command in UNIX and Linux

SSH command stands for Secure Shell which allows user to securely login into remote machine. If you are working on network on UNIX and Linux machine, SSH command is your friend because with ssh in UNIX you can not easily navigate from one host to other. SSH Command or SSH client in UNIX not only allow you to login into remote host but also allows you to execute command on remote machine without going to into remote server. which is quite convenient while writing bash scripts or getting general information about server like uptime of remote server. This article shows examples of ssh command in UNIX and different usage of ssh in UNIX along with basic concept of ssh command.

10 Examples of wget command in Linux

Hey there! Today's article will explain the "wget" command in Linux and 10 different examples. If you are a Linux user, this is a command you will commonly use almost every now and then.


Wget emanated from the GNU project. It is a non-interactive tool used to download files from the web. It is called non-interactive because it does not need human interaction before it operates. the user does not have to log on before it works.  This means that it works in the background. Wget supports HTTP, HTTPS, FTPS,SFTP.

"wget" is very beneficial in such a way that, If you are downloading a file and unfortunately the network connection becomes unstable and slow, It keeps retrying until the file is fully recovered. 
Before you can start using "wget" command, you must have installed that on your Linux. if not It won't recognize that command if you type it.

10 Examples of netstat command in Linux and UNIX

Hello guys, if you are wondering how to check which application is listening to a particular port or wondering what are active UDP and TCP post on your machine then don't worry, you can use the "netstat" command in Linux to get these details. Along with lsof and curl, netstat is another important utility command which I use on almost daily basis as a server side Java developer. Since most of the application I create follow client server model and most of them run on Linux, I often use netstat command during post implementation checks and troubleshooting during any production issue.

How to Fix java.lang.ArrayIndexOutOfBoundsException in Java [Solution]

The ArrayIndexOutOfBoundsException, also known as java.lang.ArrayIndexOutOfBoundsExcepiton is one of the most common errors in Java programs. It occurs when a Java program tries to access an invalid index like. an index that is not positive or greater than the length of an array or ArrayList. For example, if you have an array of String like String[] name = {"abc"} then trying to access name[1] will give java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 error because index 1 is invalid here. Why? because the index in the Java array starts with zero rather than 1, hence in an array of just one element the only valid index is index zero.