What are command line arguments Command line arguments are the values that are supplied to a shell script as input while executing it from the command line. Using command line arguments your script can read values directly from command line or terminal. Command line arguments are also called positional parameters. Command line arguments make a shell script dynamic and maintainable in that you can execute a shell script with different values supplied from outside and you do not need to write them inside the script. This means that for each set of values, you do not need to go and change the script. Passing argumentsRead More →

Read user input in shell script Getting user input is important for creating interactive and dynamic shell scripts so that they execute as user wants. For example, a file reader shell script which reads the file location from the user or a menu based script which performs actions based on user input. Linux and unix systems provide read command that can be used to capture user input and store it in variable. Syntax for reading user input in a shell script is given below read message Above command will wait for the user to enter characters and will keep on reading till enter key(or newRead More →

Many times you need to check the time a file or folder was last modified to ensure that you have the latest and required file in place. There are many ways to get the last modified date time of a file in linux, unix or mac systems from command line terminal and this article will list them out with examples. Method 1: Using stat command stat command is used for checking a file status and returns file details such as its size, permissions, date created, date on which it was last accessed and the last modified date of the file. stat command should be followedRead More →

Sometimes a program or an application stops responding or you are working on a terminal and want to stop a process. In such cases you need to terminate or kill that process. Linux provides a kill command that takes the PID or Process Id of the process and terminates it. In most cases, the only way to identify the process to be stopped or getting its PID is by using the specific port on which it is running or listening. Thus, first you must be able to find the process listening on a specific port and then kill it. This post will outline different commandsRead More →

Often we need to find out a process or a service running on some port. This is because we have to start a new instance of the same or different service on that port but we cannot until the current process is terminated. Thus, it is required to find out the PID of a process using its port so that the process can be terminated. There are many different ways in which a process can be checked using its port and this article will discuss them in detail with example. Method 1: Using lsof command lsof stands for List of open files and can beRead More →

Determining the size of a directory or its sub-directories is often required for the purpose of monitoring such as a folder which is taking space above some limit. du command in linux Linux provides du(stands for disk usage) command to list down the size of a folder and its sub-folders and files contained in them. By using this command, you can determine disk usage by folders list folders by their size retrieve the size of directory, subdirectories and even the files contained in them. du command has many options to generate different types of output such as list down the size of folders in blocks,Read More →

Every server runs at some pre-defined default ports. But you can also change the default setting so that the server listens at the configured port number. Default ports of Wildfly Following are the default ports of wildfly for http and https protocols. http: 8080 https: 8443 How to change ports in wildfly There are two methods to change default ports in wildfly 1. From configuration XML Navigate to the wildfly install location or where it was extracted and look for standalone.xml inside <wildfly location>/standalone folder. This is the configuration file for wildfly. Edit the file and search for socket-binding-group tag. It would normally be located atRead More →

What is context path in a web application Context path, also called context root is the name with which a web application is accessed in the browser. It is the string after the server ip and port in the application URL. Example, if the URL of a web application is http://127.0.0.1:8080/employee-manager, then employee-manager is the context path or context root of the application. Default context path By default, the name of WAR becomes the context path of the application. Thus, if the name of your WAR is temperature-converter.war, then your application will be accessed at URL http://127.0.0.1:8080/temperature-converter assuming that the server is running at ipRead More →

What is a WAR file A WAR file stands for Web Application Archive and is a bundle for distributing or hosting a java web application. It is used as a bundle of files required by the web application that is written in Java programming language. A war file may contain following file types: Application code in the form of class files Servlets(which are also class files), JSPs, Application’s deployment descriptor(web.xml), JAR files required by the application class files, Static files such as images and html files etc. A war file needs to be deployed in a web server or an application server so that theRead More →