Example like now if I run NodeJS on windows then I able to open 2 command prompt and run node server1.js and server2.js seperately but i am wondering how i can run this 2 server file on Linux ubuntu?
Because one is for websocket use and another one is for static web page use
What you are looking for is called a terminal multiplexer. There is a REALLY useful command called
screen. As of ubuntu release
jaunty it comes pre packaged. I highly recommend learning about it, because it can be used for so much more than just NodeJS.
Screen is a terminal multiplexer, which allows a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session (such as when using SSH).
Type screen - This will create a "second window". Once you are in, you can type any commands you want, just like normal cli. For example,
ctrl+a+d to exit the screen.
screen -lsto list screens and their individual ids.
screen -xto re-attach to a recent screen.
screen -r <id>to re-attach to a specific screen.
kill -9 <id>to end a specific screen.