dnf - Dandified YUM is a fork of YUM package manager
To install package
$ sudo dnf install <package_name>
$ sudo dnf install httpd
To list all repositories
$ sudo dnf repolist all
To list enabled repositories
$ sudo dnf repolist
To remove package
$ sudo dnf remove <package_name>
$ sudo dnf remove vsftpd
$ sudo dnf erase vsftpd
To update a package
$ sudo dnf update firefox
To check for full system update
$ sudo dnf check-update
To upgrade all system packages
$ sudo dnf upgrade
To list all group packages
$ sudo dnf grouplist
To Install group packages
$ sudo dnf groupinstall "Development Tools"
To Remove group packages
$ sudo dnf groupremove "Development Tools"
To search for packages
$ sudo dnf search httpd
To download only package and not to install
$ sudo dnf download bind
To show all available packages
$ sudo dnf list available
To show only installed package
$ sudo dnf list installed
To show all installed as well as available packages
$ sudo dnf list
To enable repo for installation
$ sudo dnf install --enablerepo=epel mariadb
To check which package provides the required function
$ sudo dnf provides httpd
$ sudo dnf provides /etc/vsftpd/vsftpd.conf
To view package information
$ sudo dnf info htop
To create a cache manually
$ sudo time dnf makecache
To delete a cache
$ sudo dnf clean all
To check the transaction history
$ sudo dnf history
To remove orphan packages
$ sudo dnf autoremove
To synchronize all the packages to latest stable releases
$ sudo dnf distro-sync
To reinstall a package
$ sudo dnf reinstall firefox
To upgrade to a particular version
$ sudo dnf upgrade-to httpd-<version>
regards,
T.Dhanasekar
sar - Collect, report, or save system activity information.
syntax
$ sar [option] [interval] [count]
To display the CPU utilization report.
$ sar -u
$ sar -u ALL
To report CPU utilization for each n seconds
$ sar -u 3
$ sar -u 10
To display memory utilization statistics
$ sar -r
To display I/O and transfer rate statistics
$ sar -b
To display statistics for the specified processor
$ sar -P 0
To reports statistics for each individual processor, and globally for all
processors
$ sar -P ALL
To view swap space utilization statistics
$ sar -S
To display 4 swap space utilization reports for every 3 seconds
$ sar -S 2 4
To display memory swapping statistics
$ sar -W
To display filesystems statistics
$ sar -F 2 4
To report network statistics
$ sar -n SOCK
$ sar -n DEV
To display all network statistics
$ sar -n ALL
To display block devices statistics
$ sar -d
To display queue length and load averages
$ sar -q
To display paging statistics
$ sar -B
To report task creation and system switching activity
$ sar -w 2 4
To report about kernel tables
$ sar -v 2 4
To display all statistics
$ sar -A
regards,
T.Dhanasekar
wdctl - show hardware watchdog status
To display the watchdog status
$ wdctl
To print raw output format
$ wdctl -r
To print help options
$ wdctl -h
To print the watchdog status in a single line in key-value pairs
$ wdctl --oneline
regards,
T.Dhanasekar
whiptail - is a program that will let you present a variety of questions or
display messages using dialog boxes from a shell script
To display a simple message
$ whiptail --title "ILUGC" --msgbox "message" 5 15
To display a boolean choice
$ whiptail --title "Learn Linux" --yesno "ILUGC" 5 20
To customise the text on the yes / no buttons
$ whiptail --title "FOSS" --yes-button "choose Ubuntu" --no-button "Choose
Centos" --yesno "message" 5 50
To display a text input box
$ result_variable_name="$(whiptail --title "FOSS" --inputbox "message" 5 20
3>&1 1>&2 2>&3)"
To display a password input box
$ result_variable_name="$(whiptail --title "password" --passwordbox
"message" 5 20 3>&1 1>&2 2>&3)"
To display a multiple-choice menu
$ result_variable_name=$(whiptail --title "title" --menu "message" 20 50 10
"option1" "ubuntu" "option2" "debian" "option3" "centos" 3>&1 1>&2 2>&3)
regards,
T.Dhanasekar
yum ( Yellowdog Updater Modified ) - is an interactive, rpm based,
package manager
To search for a package
$ sudo yum search <package_name>
$ sudo yum search htop
To install package
$ sudo yum install <package_name>
$ sudo yum install htop
To remove a package
$ sudo yum remove <package_name>
$ sudo yum remove bind
To update a package
$ sudo yum update <package_name>
$ sudo yum update firefox
To list a package
$ sudo yum list <package_name>
$ sudo yum list httpd
To get information about a package
$ sudo yum info <package_name>
$ sudo yum info openssh
To list all available packages
$ sudo yum list
To list all installed packages
$ sudo yum list installed
To find which package a specific file belongs to
$ sudo yum provides /etc/vsftpd/vsftpd.conf
To check for available updates
$ sudo yum check-update
To update the system
$ sudo yum update
To list all available group packages
$ sudo yum grouplist
To install group packages
$ sudo yum groupinstall "Development Tools"
To update a group packages
$ sudo yum groupupdate 'Development Tools'
To remove group packages
$ sudo yum groupremove 'Development Tools'
To list enabled Yum repositories
$ sudo yum repolist
To list all enabled and disabled Yum repositories
$ sudo yum repolist all
To invoke yum shell
$ sudo yum shell
> info httpd
To clean Yum cache
$ sudo yum clean all
To view history of Yum
$ sudo yum history
To read commands from text file and execute
$ cat yum_command.txt
info httpd
repolist
$ sudo yum shell yum_command.txt
regards,
T.Dhanasekar
setsid - is used to run a program in a new session
To show the help options
$ setsid -h
To set the controlling terminal to the current one
$ setsid -c ./sample.sh
To Execute a program even after log out
$ setsid ./example-script.sh
To make wait for the execution of the program to end and return
the exit value of this program as the return value of setsid
$ setsid -w ./sample.sh
regards,
T.Dhanasekar
urandom - kernel random number source devices
To generate password of length “15”
$ head -c 15 /dev/urandom | base64
To generate password of length "30"
$ head -c 30 /dev/urandom | base64
regards,
T.Dhanasekar