This is my second article talking about Linux cloud computing server. As a full stack developer, it seems to be out of my scoop. However, as a beginner in Linux Cloud computing industry, I think it will be a good idea to share my problems and solutions when I am working on Linux cloud computing server.
Usually, here is the normal working process on Linux cloud computing server:

  1. Estimate hardware requirement including CPU, memory, storage, I/O, or GPU (more and more tasks use GPU now), and networking.
  2. Purchase cloud computing server from vendor such as Amazon, Microsoft, Google, etc.
  3. Use SSH to login Linux server and setup software and services.

However, things don’t always happen the way you plan them to happen. This time, I need a Linux cloud server to setup Web server with database. One of my friend have a free one and share that one with me. He passes me the username, password and IP address to access the server. I know nothing about the server but the system is Linux. So I login the server and try to find out following information about the server:

  1. CPU information
  2. Memory information
  3. Storage
  4. System information
  5. Software and Service
  6. Users and Groups

Get CPU Information in Linux Command Line

To get the CPU information of your Linux server, you can run following command:

cat /proc/cpuinfo

After running above command, you will get the information such as processor model name, cpu speed, cache size, number of cores, etc.

Get Memory Information in Linux Command Line

To get the memory information of your Linux server, you can run following command:

free

This command will return a brief information about the system memory. You can also run following command to get more details:

cat /proc/meminfo

Get Harddisk Information in Linux Command Line

To get the storage or hard-disk information of your Linux server, please try this command:

df –h

This command also will give a summary of your hard-disk information. If you want more details, please try following command. But this requires root permission:

sudo fdisk –l

To check the folder size, we can use following command:

du -hs /path/to/directory

Get Linux System Information

To start configure your Linux server, it is necessary to know your Linux system information, for example, the distribution name and Linux kernel version. To get the distribution name, you can run this command:

lsb_release -a

To get the Linux kernel version, please try this command:

uname -a

Users and Groups

To make your server safe and secure, we must need to know what users in the system and the existing groups in the system.

To get a user list in the Linux system, we can run following command:

cat /etc/passwd

To add a new user to a certain group, we can try this command:

sudo useradd -m james -g ftpaccess -s /usr/sbin/nologin

The above command will create a user named james and add this user into ftpaccess group. -m will indicate to create a home directory and -s will indicate the login shell for this user.

Then, we can use this command to set a password for the user:

sudo passwd james

To get a group list in the Linux system, we can run following command:

cat /etc/group

To add a group, we can try this command:

sudo groupadd ftpaccess

To let your VI editor show Unicode correctly, add following code in ~/.vimrc file:

set encoding=utf-8
set fileencoding=utf-8

To remove the bash warning, example below:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

we can add follow statement in /etc/environment:

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
Previous PostNext Post

2 Comments

  1. Hey james, you work a lot, thanks a lot man. You help people! I was unable to donate because my paypal payment sytem is not working! But hearty thanks! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *