System

System

Work with yum history

# List yum history (e.g install, update)
sudo yum history
# Example output:
# Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
# ID     | Login user               | Date and time    | Action(s)      | Altered
# -------------------------------------------------------------------------------
#     11 |  ... <myuser>       | 2020-04-10 10:57 | Install        |    1 P<
#     10 |  ... <myuser>       | 2020-03-27 05:21 | Install        |    1 >P
#      9 |  ... <myuser>       | 2020-03-05 11:57 | I, U           |   56 *<
# ...

# Show more details of a yum history (e.g. history #11)
sudo yum history info 11

# Undo a yum history (e.g. history #11, this will uninstall some packages)
sudo yum history undo 11

Audit files to see who made changes to a file [RedHat based system only]

Check out whether SELinux is enabled

Generate public key from private key

Copy your default public key to remote user

Copy default public key to remote user using the required private key (e.g. use your mykey.pem key to copy your id_rsa.pub to the remote user)

SSH Agent Forwarding

Set the default user and key for a host when using SSH

Follow the most recent logs from service

Eliminate the zombie

Show memory usage

Display CPU and IO statistics for devices and partitions.

Display bandwidth usage on an network interface (e.g. enp175s0f0)

Tell how long the system has been running and number of users

Check if it's root running

Change shell of a user (e.g. bonnie)

Change root / fake root / jail (e.g. change root to newroot)

Display file status (size; access, modify and change time, etc) of a file (e.g. filename.txt)

Snapshot of the current processes

Display a tree of processes

Find maximum number of processes

Show IP address

Change SysV runlevel (e.g. 5)

Display all available services in all runlevels,

Check system version

Linux Programmer's Manuel: hier- description of the filesystem hierarchy

Control the systemd system and service manager

List job

Run a program with modified priority (e.g. ./test.sh)

Export PATH

Make file executable

Surf the net

Add user, set passwd

Edit PS1 variable for bash (e.g. displaying the whole path)

Edit environment setting (e.g. alias)

Unalias (e.g. after alias ls='ls --color=auto')

Set and unset shell options

List environment variables (e.g. PATH)

List all environment variables for current user

Unset environment variable (e.g. unset variable 'MYVAR')

Show partition format

Inform the OS of partition table changes

Show hexadecimal view of data

Jump to different node

Check port (active internet connection)

List all functions names

List total size of a directory

Copy directory with permission setting

Store current directory

Show disk usage

check the Inode utilization

Show all file system type

Show current runlevel

Switch runlevel

Permanently modify runlevel

Become root

Become somebody

Report user quotes on device

Get entries in a number of important databases

Change owner of file

Mount and unmount

List current mount detail

List current usernames and user-numbers

Get all username

Show all users

Show all groups

Show group of user

Show uid, gid, group of user

Check if it's root

Find out CPU information

Set quota for user (e.g. disk soft limit: 120586240; hard limit: 125829120)

Show quota for user

Display current libraries from the cache

Check user login

Check last reboot history

Edit path for all users

Show and set user limit

Check status of each core

Show jobs and PID

List all running services

Schedule shutdown server

Cancel scheduled shutdown

Broadcast to all users

Kill all process of a user

Kill all process of a program

Set gedit preference on server

Add user to a group (e.g add user 'nice' to the group 'docker', so that he can run docker without sudo)

Pip install python package without root

Removing old linux kernels (when /boot almost full...)

Change hostname

List installed packages

Check for package update

Run yum update excluding a package (e.g. do not update php packages)

Check which file make the device busy on umount

When sound not working

When sound not working

List information about SCSI devices

Tutorial for setting up your own DNS server

http://onceuponmine.blogspot.tw/2017/08/set-up-your-own-dns-server.html

Tutorial for creating a simple daemon

http://onceuponmine.blogspot.tw/2017/07/create-your-first-simple-daemon.html

Tutorial for using your gmail to send email

http://onceuponmine.blogspot.tw/2017/10/setting-up-msmtprc-and-use-your-gmail.html

Using telnet to test open ports, test if you can connect to a port (e.g 53) of a server (e.g 192.168.2.106)

Change network maximum transmission unit (mtu) (e.g. change to 9000)

Get pid of a running process (e.g python)

Check status of a process using PID

NTP

Remove unnecessary files to clean your server

Increase/ resize root partition (root partition is an LVM logical volume)

Create a UEFI Bootable USB drive (e.g. /dev/sdc1)

Locate and remove a package

Create a ssh tunnel

Get process ID of a process (e.g. sublime_text)

Some benchmarking tools for your server

aio-stress - AIO benchmark. bandwidth - memory bandwidth benchmark. bonnie++ - hard drive and file system performance benchmark. dbench - generate I/O workloads to either a filesystem or to a networked CIFS or NFS server. dnsperf - authorative and recursing DNS servers. filebench - model based file system workload generator. fio - I/O benchmark. fs_mark - synchronous/async file creation benchmark. httperf - measure web server performance. interbench - linux interactivity benchmark. ioblazer - multi-platform storage stack micro-benchmark. iozone - filesystem benchmark. iperf3 - measure TCP/UDP/SCTP performance. kcbench - kernel compile benchmark, compiles a kernel and measures the time it takes. lmbench - Suite of simple, portable benchmarks. netperf - measure network performance, test unidirectional throughput, and end-to-end latency. netpipe - network protocol independent performance evaluator. nfsometer - NFS performance framework. nuttcp - measure network performance. phoronix-test-suite - comprehensive automated testing and benchmarking platform. seeker - portable disk seek benchmark. siege - http load tester and benchmark. sockperf - network benchmarking utility over socket API. spew - measures I/O performance and/or generates I/O load. stress - workload generator for POSIX systems. sysbench - scriptable database and system performance benchmark. tiobench - threaded IO benchmark. unixbench - the original BYTE UNIX benchmark suite, provide a basic indicator of the performance of a Unix-like system. wrk - HTTP benchmark.

Performance monitoring tool - sar

Reading from journal file

Show a listing of last logged in users.

Show a listing of current logged in users, print information of them

Show who is logged on and what they are doing

Stop tailing a file on program terminate

List all enabled services

Last updated

Was this helpful?