CentOS Linux Useful Commands


1. Identify OS Version

$ lsb_release -a


2. Identify Open ports

$ sudo lsof -i -P -n

$ sudo lsof -i -P -n | grep LISTEN


3. Restart or Reboot server

$ sudo reboot

$ sudo shutdown -r = command restarts server

$ sudo shutdown -r +30 = command restart server in another 30 mins


4. Vi Text Editor – How to save the changes and quit the editor?

  1. After making changes, press Esc Key
  2. Press : (colon). You will notice your cursor appearing at the lower left corner of the screen beside a colon prompt.
  3. Enter any of these options as per your need.

wq! = write the changes to file and quit

q! = exit without writing the changes.

w! = write the changes to file without exiting




Related Articles & Comments

Thank you for visiting us. To continue receiving updates, please Subscribe to our Social Media Channels.

Menu Title
%d bloggers like this: