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

  • Bash shell
  • GNU Core Utilities
  • Package managers (e.g., apt, yum, dnf)
  • Text editors (e.g., Vim, Emacs, Nano)

Basic


view the linux os information

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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

1
top -b -n 1 > log.txt

File System usage

Check disk usage in linux system

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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

1
useradd -G {username}

View user group

1
groups {group name}

Modify user group

1
2
3
4
#-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}
Linux sudo bug - CVE-2021-3156
February 6, 2021 · Updated: February 6, 2021 · by Xeth · ~1 min read · English

Learn how to detect if your operating system is vulnerable to the critical CVE-2021-3156 exploit with our comprehensive guide. Stay informed and protect your system against …

#linux #migrated