Skip to content

Instantly share code, notes, and snippets.

@jackie-do
Last active October 2, 2018 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackie-do/e7021ecd7133f30f40879276d0838ca5 to your computer and use it in GitHub Desktop.
Save jackie-do/e7021ecd7133f30f40879276d0838ca5 to your computer and use it in GitHub Desktop.
Some commands to check the information of a server
  1. Check linux version
cat /etc/lsb-release   (for ubuntu)
cat /etc/debian_version (for debian)
cat /etc/redhat-release (CenOs/Redhat)

  1. Check disk space
df -H
  1. Check Ram and CPU
# Check CPU
less /proc/cpuinfo

# Check Ram size
less /proc/meminfo
  1. Check users
# List all users
compgen -u

# List all groups
compgen -g 

#Display information of an user
id <user_name>
  1. Set up Monitor app
sudo apt-get install htop
  1. Set up locale
# List current setting of locale
locale

# generate missing locale
sudo locale-gen "en_US.UTF-8"

# resetup the locale
sudo dpkg-reconfigure locales 

## Do it manually
export LC_ALL="en_US.UTF-8"

  1. Listening ports
netstat -an | grep "LISTEN "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment