Is production: true

Linux

Linux is a family of open-source Unix-like operating systems based on the Linux kernel, which was first released by Linus Torvalds on September 17, 1991. It is typically packaged as a Linux distribution, also known as a distro, which includes the kernel and supporting system software and libraries to create a complete operating system.

Linux was originally designed as a clone of Unix and is released under the copyleft GPL license. It is a prominent example of free and open-source software collaboration, with the Linux kernel often considered the largest open-source project. While initially developed for x86-based personal computers, it has been ported to more platforms than any other operating system and is used on a wide variety of devices, including PCs, workstations, mainframes, and embedded systems.

Linux is the predominant operating system for servers and is used on all of the world’s 500 fastest supercomputers. It also powers Android, one of the most popular platforms on the planet.

Web Site

Tools

Basic


view the linux os information

cat /etc/*-release

# ---------
# 
# (.venv) xeth@host-1:~/projects/file-changed-detector-xethhung12$ cat /etc/*-release
# DISTRIB_ID=Ubuntu
# DISTRIB_RELEASE=24.04
# DISTRIB_CODENAME=noble
# DISTRIB_DESCRIPTION="Ubuntu 24.04.3 LTS"
# PRETTY_NAME="Ubuntu 24.04.3 LTS"
# NAME="Ubuntu"
# VERSION_ID="24.04"
# VERSION="24.04.3 LTS (Noble Numbat)"
# VERSION_CODENAME=noble
# ID=ubuntu
# ID_LIKE=debian
# HOME_URL="https://www.ubuntu.com/"
# SUPPORT_URL="https://help.ubuntu.com/"
# BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
# PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
# UBUNTU_CODENAME=noble
# LOGO=ubuntu-logo

Check System Memory and CPU Usage

Below method is use top command to do some system resource logging.

[Link]

To extract the system date to log.txt

top -b -n 1 > log.txt

File System usage

Check disk usage in linux system

# show all size of files recursively(including sub folder's file)
du -h

# show all size of files recursively(including sub folder's file) under the path /usr
du -h /usr

# -s stand for summary
# show folder size of /usr
du -sh /usr

# show folder size of all subfolder of /usr/
du -sh /usr/*

#show folder size in the folder level
du -h --max-depth=1 /usr

#show folder size under /usr and limit the result to be 10 in sorted order
du -a /usr | sort -n -r | head -n 10

Script to manipulate the user in linux

[Link1]

[Link2]

Add user

useradd -G {username}

View user group

groups {group name}

Modify user group

#-a means append the user to group
#-G means create new list of group
#-aG can be considered as adding the user to new group and preventing remove the user from existing groups     
usermod -aG {group name} {user name}

Related articles:

How to Setup LetsEncrypt With NGINX
May 22, 2023 by Xeth [~3 mins]

Nginx is a very common web server used for reverse proxy and load …

#linux
#nginx
#lets_encrypt
#docker
centos Group management
March 17, 2023 by Xeth [~1 mins]

A snippet to manage cnetos group

#linux
#migrated
How to setup static IP
April 5, 2021 by Xeth [~1 mins]

To modify the linux to machine bind to static IP address. the example …

#migrated
#raspberry-pi
#linux
Linux sudo bug - CVE-2021-3156
February 6, 2021 by Xeth [~1 mins]

Learn how to detect if your operating system is vulnerable to the …

#linux
#migrated