Friday, July 24, 2020

openSUSE:Cheat sheet 13.1

openSUSE:Cheat sheet 13.1

openSUSE Cheat Sheet

YaST Administration Tool

Run YaST using Qt GUI
# yast –-qt
Run YaST using Gtk GUI
# yast --gtk
Run YaST in text-mode
# yast --ncurses
List available YaST modules
# yast -l
Use modules
# yast <modulename>

ZYpp Package Management

List repositories
# zypper lr
Add repository
# zypper ar -f <URL> <alias>
Refresh repositories
# zypper ref
Update installed packages
# zypper up
Perform a distribution upgrade
# zypper dup
Package information
# zypper if <package name>
Package search
# zypper se <package, pattern or dependancy name>
Which package owns a file
# zypper se --provides <file path>
List files in package
$ rpm -ql <package name>

Network

View network interfaces
$ ip a
$ iwconfig
Show routes
$ ip ru; ip route show table all
Show open TCP/UDP ports
# ss -anptu
Show all open ports
# ss -anp
Test host availability
$ ping hostname
Change host name
# hostnamectl set-hostname machine.network.name

Services

List all services
# systemctl list-units --type service
Service status
# systemctl status <service name>
Start/Stop/Restart service
# systemctl start <service name>
# systemctl stop <service name>
# systemctl restart <service name>
Show overriden config files
# systemd-delta
Anaylze boot times
# systemd-analyze blame
# systemd-analyze plot >filename.svg
Show the journal information
# journalctl -u <service name>
# journalctl -f (follow the output of the journal, similar to 'old' tail -f /var/log/messages)
# journalctl -b (only show messages since last boot)
Manage Time and Date
# timedatectl

CPU & Memory information

View CPU details
$ lscpu
$ less /proc/cpuinfo
$ uname -a
Show running processes
$ ps -ef
$ pstree
$ top -c
Show memory use
$ less /proc/meminfo
$ free
Enable/disable swap
$ swapon -a
$ swapoff -a
Show all open files & directories
# lsof | less
# lsof | grep -i filename

File Systems

List disks & partitions
# fdisk -l
# fdisk -l /dev/<h/s>d<a/z>
List mounted file systems
$ lsblk
$ findmnt
$ less /proc/self/mountinfo
Mount a partition
# mount -t <type> <device> <mount point>
Mount a CD/DVD iso image
# mount -t iso9660 -o loop dvd-image.iso <mount point>
Unmount file systems
# umount /dev/<device>
# umount /<mount point>
Inode and disk space usage combined, or output per field type
# df --o -h
# df --output=target,fstype,pcent
space occupied by a file or directory
# du -h
Show all directories occupying more space than 10M
# du -h -t10M

Accounts

Create user account
# useradd <name>
-u UID
-g GID
-d home directory
-c full user name
-s default shell
Delete user account
# userdel <name>
Change user password
# passwd <name>
Modify user account
# usermod <options> <name>

Build Service

Branch & Checkout a Package
$ osc bco <source project> <source package>
Commit changes to package
$ osc commit -m "<comment>"
Submit changed package
$ osc sr

No comments:

Post a Comment

Git branch show detached HEAD

  Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03)   00 2. Run re-set hard $ git reset --hard 3. ...