What is a batch file A batch file is a file that you can create in windows to perform some tasks. This file contains windows commands and can be used to automate manual actions. Example, suppose you have a folder that contains some junk files and after every couple of days you need to clean those files. One way is to select all the files that need to be removed one by one and then delete them by pressing delete key. Sounds boring, isn’t it? Another much simpler way is to create a batch file with commands to select those files and remove them. NowRead More →

If you create a shell script file on windows and copy it on linux for execution, you might get below error $’\r’: command not found This is because end of line character on windows is different than that on linux. End of line on windows is a combination of Carriage return and Line Feed characters(CR + LF) while that on linux is only Line Feed(LF). Thus, a script created on windows when executed on linux gives the above error. Solution There are 2 ways in which this problem can be solved. Method 1: Using dos2unix utility Install dos2unix program on the target linux system ifRead More →

Many times we know the port number and want to get the details of the process running on that port on windows. Reasons may be to find which program is using the port. the process name running on that port. to find the process id(PID) of the process using its port so that we can kill the process. Windows provides netstat command. This command has different options which can be used to extract port and process related information. Find process running on given port Use the below command if you know the port and want to get the PID of process running on it. netstatRead More →