If you recently started working on WebSphere or any other product suite of Middleware, then one of the very first things to get familiar is widely used Linux commands. In this article, I will talk about some of the often-used Linux commands by WebSphere or Middleware administrator on a daily basis.

Finding SystemOut.log

If you are working on the existing environment and if an administrator has redirected SystemOut.log to some other location then it would be challenging to find it. Tips: if you have multiple file systems then it may take time to search. So best would be to replace / with the actual file system where you think the log would be. Let’s say you believe log is in /opt file system so you can do this.

Know which process is holding a specific port number

Quite often you will have to deal with port conflict issues, especially in the shared environment. If there is a situation to find out which process is holding port number then here is how you can know. Ex Note: Above example shows nginx with PID 20924 is holding 443 port.

Server boot time

If you are performing auto-startup troubleshooting and would like to know when the server was rebooted, you can use this command. who -b command will give you the exact date and time of server reboot. Alternatively, you may also use up time to check how long the server is up.

Check CPU/Memory utilization in runtime

If you are having a performance issue, then you might want to know the current CPU/Memory utilization. This will help you to find out which process is taking high CPU/Memory in real-time. Tips: look for the CPU/Memory section for the first few PID to find out the utilization. Alternatively, you may also use the free command to find out total and free memory. As you can see above, there is 490 MB total memory, and only 46 MB memory is available. There is another command called SAR (System Activity Report), which is also very helpful to find the CPU and Memory stats. To check the CPU utilization To check the Memory utilization

Kill the process

Sometimes the process doesn’t stop gracefully if it’s hung or defunct. In this scenario, you can kill the process manually. If above doesn’t help, you can use -9 to kill the process forcefully. Note: PID is your process ID

Compression & Extraction

Most often you will have to deal with compressing the files as housekeeping activity for a file system. Compression gzip command can be used to compress the files. Tips: if you have multiple files to be compressed, you can use gzip * which will compress all the files available in that working directory. Extraction  gunzip command will help you to extract the gz file. Tips: you can use gunzip * which will help you to extract all gz file in that working directory.

Total CPU, Memory, File System

Often asked to provide server information, if you are working on migration or capacity planning. Here is the quick command to help you to find out total CPU, Memory, and File system details. CPU information Find out CPU Cores, MHz, CPU manufacturer, Model Name and much more by using Tips: if you have a high-end server then output of the above command will be long. So you can use grep to filter out the required information. Ex, just to find out cores, you can use Memory information To find out the total available memory, you can use one of the following commands. First one…. This will show you total, free & cached memory Second one… This will show you much more information along with total memory. File System information To find out file system size and usage, you can use df commands. Including –h will give you output in GB which is easy to understand.

Check out IP, Subnet Mask, MAC address and errors

Probably, one of the most widely used commands to find out IP related information. As you can see above, ifconfig will show the IP addresses, Ethernet details, a hardware address (MAC), subnet mask, errors, and other information. This is an extremely useful handy command if you are looking for this information. Tips: you can use –a with ifconfig to show all available Ethernet details. Ex:

Network commands like wget, telnet, traceroute

If you are doing application connectivity troubleshooting then most likely you will need to use these network commands. Check if you can access particular URL from a server You can quickly confirm if there is any connectivity issue on your server by using wget command. Ex: if you need to check if the server can access an external website like https://geekflare.com or not, you can use below. Tips: above you can see HTTP response code is 200 means there is no issue in connectivity. Verify if the server can connect to backend service with the particular port number If you are connecting to some other application like web service and need to verify if you can reach them, then you can use telnet command. This is very useful for a connectivity test. In the below example, I have checked if geekflare.com on 443 port can be reached or not. If you see “Connected” then that confirms there is nothing wrong with connectivity/firewall. However, if you see connection failed then you know, there is something like a firewall blocking your connection. Tracing connection details This may not be used all the time but extremely helpful when you have a latency issue or just want to find out the connection path between your server to the destination. Below example is to show the network path from my server to geekflare.com

Ownership modification

If you are dealing with multiple users on a server and having root permission too then most likely once in a while, you will screw with permission/ownership. Well, not to worry its part of learning. Here is the quick way to change the ownership or permission. Change ownership To change ownership of a particular file, you can use the chown command as below. Tips: above will change ownership of error.log to mentioned user and group. If you have a folder, then you can use –R, which will change recursively to all the files within the folder. Ex:- I hope the above commands help you with your work. If you are looking to learn more sysadmin skills then check out these resources.

Linux Commands for Middleware WebSphere Administration - 23Linux Commands for Middleware WebSphere Administration - 12Linux Commands for Middleware WebSphere Administration - 90Linux Commands for Middleware WebSphere Administration - 31Linux Commands for Middleware WebSphere Administration - 75Linux Commands for Middleware WebSphere Administration - 38Linux Commands for Middleware WebSphere Administration - 54Linux Commands for Middleware WebSphere Administration - 61Linux Commands for Middleware WebSphere Administration - 10Linux Commands for Middleware WebSphere Administration - 31Linux Commands for Middleware WebSphere Administration - 42Linux Commands for Middleware WebSphere Administration - 8Linux Commands for Middleware WebSphere Administration - 19Linux Commands for Middleware WebSphere Administration - 56Linux Commands for Middleware WebSphere Administration - 88Linux Commands for Middleware WebSphere Administration - 10Linux Commands for Middleware WebSphere Administration - 63Linux Commands for Middleware WebSphere Administration - 90Linux Commands for Middleware WebSphere Administration - 1Linux Commands for Middleware WebSphere Administration - 90Linux Commands for Middleware WebSphere Administration - 52Linux Commands for Middleware WebSphere Administration - 70Linux Commands for Middleware WebSphere Administration - 91