Formatted all pages according to guidelines.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
# apt-cache
|
||||
|
||||
> Debian and Ubuntu package query tool
|
||||
> Debian and Ubuntu package query tool.
|
||||
|
||||
- Search for a package in your current sources
|
||||
- Search for a package in your current sources:
|
||||
|
||||
`apt-cache search {{query}}`
|
||||
|
||||
- Show information about a package
|
||||
- Show information about a package:
|
||||
|
||||
`apt-cache show {{package}}`
|
||||
|
||||
- Show whether a package is installed and up to date
|
||||
- Show whether a package is installed and up to date:
|
||||
|
||||
`apt-cache policy {{package}}`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# apt-get
|
||||
|
||||
> Debian and Ubuntu package management utility
|
||||
> Debian and Ubuntu package management utility.
|
||||
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent apt-get commands.
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent apt-get commands:
|
||||
|
||||
`apt-get update`
|
||||
|
||||
- install a new package
|
||||
- Install a new package:
|
||||
|
||||
`apt-get install {{package}}`
|
||||
|
||||
- remove a package
|
||||
- Remove a package:
|
||||
|
||||
`apt-get remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to newest available versions
|
||||
- Upgrade installed packages to newest available versions:
|
||||
|
||||
`apt-get upgrade`
|
||||
|
||||
- Upgrade installed packages (like "upgrade"), but remove obsolete packages and install additional packages to meet new dependencies
|
||||
- Upgrade installed packages (like "upgrade"), but remove obsolete packages and install additional packages to meet new dependencies:
|
||||
|
||||
`apt-get dist-upgrade`
|
||||
|
@@ -1,27 +1,27 @@
|
||||
# aptitude
|
||||
|
||||
> Debian and Ubuntu package management utility
|
||||
> Debian and Ubuntu package management utility.
|
||||
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent aptitude commands.
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent aptitude commands:
|
||||
|
||||
`aptitude update`
|
||||
|
||||
- install a new package
|
||||
- Install a new package:
|
||||
|
||||
`aptitude install {{package}}`
|
||||
|
||||
- search for a package
|
||||
- Search for a package:
|
||||
|
||||
`aptitude search {{package}}`
|
||||
|
||||
- remove a package
|
||||
- Remove a package:
|
||||
|
||||
`aptitude remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to newest available versions
|
||||
- Upgrade installed packages to newest available versions:
|
||||
|
||||
`aptitude upgrade`
|
||||
|
||||
- Upgrade installed packages (like `aptitude upgrade`) including removing obsolete packages and installing additional packages to meet new package dependencies.
|
||||
- Upgrade installed packages (like `aptitude upgrade`) including removing obsolete packages and installing additional packages to meet new package dependencies:
|
||||
|
||||
`aptitude full-upgrade`
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
> Encode or decode file or standard input, to standard output.
|
||||
|
||||
- Encode a file
|
||||
- Encode a file:
|
||||
|
||||
`base64 {{filename}}`
|
||||
|
||||
- Decode a file
|
||||
- Decode a file:
|
||||
|
||||
`base64 -d {{filename}}`
|
||||
|
||||
- Encode from stdin
|
||||
- Encode from stdin:
|
||||
|
||||
`{{somecommand}} | base64`
|
||||
|
||||
- Decode from stdin
|
||||
- Decode from stdin:
|
||||
|
||||
`{{somecommand}} | base64 -d`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# dd
|
||||
|
||||
> convert and copy a file
|
||||
> Convert and copy a file.
|
||||
|
||||
- Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso)
|
||||
- Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso):
|
||||
|
||||
`dd if={{file.iso}} of=/dev/{{usb_drive}}`
|
||||
|
||||
- Clone a drive to another drive with 4MB block and ignore error
|
||||
- Clone a drive to another drive with 4MB block and ignore error:
|
||||
|
||||
`dd if=/dev/{{source_drive}} of=/dev/{{dest_drive}} bs=4M conv=noerror`
|
||||
|
||||
- Generating a file of 100 random bytes by using kernel random driver
|
||||
- Generating a file of 100 random bytes by using kernel random driver:
|
||||
|
||||
`dd if=/dev/urandom of={{random_file}} bs=100 count=1`
|
||||
|
||||
- Benchmark the write performance of a disk
|
||||
- Benchmark the write performance of a disk:
|
||||
|
||||
`dd if=/dev/zero of={{file_1GB}} bs=1024 count=1000000`
|
||||
|
@@ -1,24 +1,23 @@
|
||||
# dnf
|
||||
|
||||
>Package management utility for RHEL, Feodra, and CentOS (replaces yum)
|
||||
> Package management utility for RHEL, Feodra, and CentOS (replaces yum).
|
||||
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent dnf commands.
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent dnf commands:
|
||||
|
||||
`dnf update`
|
||||
|
||||
- Install a new package
|
||||
- Install a new package:
|
||||
|
||||
`dnf install {{package}}`
|
||||
|
||||
- Install a new package and assume yes to all questions
|
||||
- Install a new package and assume yes to all questions:
|
||||
|
||||
`dnf -y install {{package}}`
|
||||
|
||||
- Remove a package
|
||||
- Remove a package:
|
||||
|
||||
`dnf remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to newest available versions
|
||||
- Upgrade installed packages to newest available versions:
|
||||
|
||||
`dnf upgrade`
|
||||
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
> A tool that shows information about installed packages.
|
||||
|
||||
- List all installed packages.
|
||||
- List all installed packages:
|
||||
|
||||
`dpkg-query -l`
|
||||
|
||||
- List installed packages matching a pattern.
|
||||
- List installed packages matching a pattern:
|
||||
|
||||
`dpkg-query -l '{{pattern}}'`
|
||||
|
||||
- List all files installed by a package.
|
||||
- List all files installed by a package:
|
||||
|
||||
`dpkg-query -L {{package_name}}`
|
||||
|
||||
- Show information about a package.
|
||||
- Show information about a package:
|
||||
|
||||
`dpkg-query -s {{package_name}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# dpkg
|
||||
|
||||
> debian package manager
|
||||
> Debian package manager.
|
||||
|
||||
- install a package
|
||||
- Install a package:
|
||||
|
||||
`dpkg -i {{/path/to/file}}`
|
||||
|
||||
- remove a package
|
||||
- Remove a package:
|
||||
|
||||
`dpkg -r {{package_name}}`
|
||||
|
||||
- list installed packages
|
||||
- List installed packages:
|
||||
|
||||
`dpkg -l {{pattern}}`
|
||||
|
||||
- list package contents
|
||||
- List package contents:
|
||||
|
||||
`dpkg -L {{package_name}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# du
|
||||
|
||||
> Estimate file space usage
|
||||
> Estimate file space usage.
|
||||
|
||||
- get a sum of the total size of a file/folder in human readable units
|
||||
- Get a sum of the total size of a file/folder in human readable units:
|
||||
|
||||
`du -sh {{file/directory}}`
|
||||
|
||||
- list file sizes of a directory and any subdirectories in KB
|
||||
- List file sizes of a directory and any subdirectories in KB:
|
||||
|
||||
`du -k {{file/directory}}`
|
||||
|
||||
- get recursively, individual file/folder sizes in human readable form
|
||||
- Get recursively, individual file/folder sizes in human readable form:
|
||||
|
||||
`du -ah {{directory}}`
|
||||
|
||||
- list the KB sizes of directories for N levels below the specified directory
|
||||
- List the KB sizes of directories for N levels below the specified directory:
|
||||
|
||||
`du --max-depth=N`
|
||||
|
@@ -1,31 +1,31 @@
|
||||
# emerge
|
||||
|
||||
> Gentoo Linux package manager utility
|
||||
> Gentoo Linux package manager utility.
|
||||
|
||||
- synchronize all packages
|
||||
- Synchronize all packages:
|
||||
|
||||
`emerge --sync`
|
||||
|
||||
- update all packages, including dependencies
|
||||
- Update all packages, including dependencies:
|
||||
|
||||
`emerge -uDNav @world`
|
||||
|
||||
- resume a failed updated, skipping the failing package
|
||||
- Resume a failed updated, skipping the failing package:
|
||||
|
||||
`emerge --resume --skipfirst`
|
||||
|
||||
- install a new package, with confirmation
|
||||
- Install a new package, with confirmation:
|
||||
|
||||
`emerge -av {{package-name}}`
|
||||
|
||||
- remove a package, with confirmation
|
||||
- Remove a package, with confirmation:
|
||||
|
||||
`emerge -Cav {{package-name}}`
|
||||
|
||||
- remove orphaned packages (that were installed only as dependencies)
|
||||
- Remove orphaned packages (that were installed only as dependencies):
|
||||
|
||||
`emerge -avc`
|
||||
|
||||
- search the package database for a keyword
|
||||
- Search the package database for a keyword:
|
||||
|
||||
`emerge -S {{keyword}}`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# findmnt
|
||||
|
||||
> Find your filesystem
|
||||
> Find your filesystem.
|
||||
|
||||
- List all mounted filesystems
|
||||
- List all mounted filesystems:
|
||||
|
||||
`findmnt`
|
||||
|
||||
- Search for a device
|
||||
- Search for a device:
|
||||
|
||||
`findmnt {{/dev/sdb1}}`
|
||||
|
||||
- Search for a mountpoint
|
||||
- Search for a mountpoint:
|
||||
|
||||
`findmnt {{/}}`
|
||||
|
||||
- Find filesystems in specific type
|
||||
- Find filesystems in specific type:
|
||||
|
||||
`findmnt -t {{ext4}}`
|
||||
|
||||
- Find filesystems with specific label
|
||||
- Find filesystems with specific label:
|
||||
|
||||
`findmnt LABEL={{BigStorage}}`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# firewall-cmd
|
||||
|
||||
> The firewalld command line client
|
||||
> The firewalld command line client.
|
||||
|
||||
- View the available firewall zones
|
||||
- View the available firewall zones:
|
||||
|
||||
`firewall-cmd --get-active-zones`
|
||||
|
||||
- View the rules which are currently applied
|
||||
- View the rules which are currently applied:
|
||||
|
||||
`firewall-cmd --list-all`
|
||||
|
||||
- Permanently open the port for a service in the specified zone (like port `443` when in the `public` zone)
|
||||
- Permanently open the port for a service in the specified zone (like port `443` when in the `public` zone):
|
||||
|
||||
`firewall-cmd --permanent --zone={{public}} --add-service={{https}}`
|
||||
|
||||
- Permanently close the port for a service in the specified zone (like port `80` when in the `public` zone)
|
||||
- Permanently close the port for a service in the specified zone (like port `80` when in the `public` zone):
|
||||
|
||||
`firewall-cmd --permanent --zone={{public}} --remove-service={{http}}`
|
||||
|
||||
- Reload firewalld to force rule changes to take effect
|
||||
- Reload firewalld to force rule changes to take effect:
|
||||
|
||||
`firewall-cmd --reload`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# free
|
||||
|
||||
> Display amount of free and used memory in the system
|
||||
> Display amount of free and used memory in the system.
|
||||
|
||||
- Display system memory
|
||||
- Display system memory:
|
||||
|
||||
`free`
|
||||
|
||||
- Display memory in Bytes/KB/MB/GB
|
||||
- Display memory in Bytes/KB/MB/GB:
|
||||
|
||||
`free {{-b/-k/-m/-g}}`
|
||||
|
||||
- Display memory in human readable units
|
||||
- Display memory in human readable units:
|
||||
|
||||
`free -h`
|
||||
|
||||
- Continuous monitor memory (refresh every X seconds)
|
||||
- Continuous monitor memory (refresh every X seconds):
|
||||
|
||||
`free -s {{X}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# head
|
||||
|
||||
> Output the first part of files
|
||||
> Output the first part of files.
|
||||
|
||||
- Output the first few lines of a file
|
||||
- Output the first few lines of a file:
|
||||
|
||||
`head -n {{count_of_lines}} {{filename}}`
|
||||
|
||||
- Output the first few bytes of a file
|
||||
- Output the first few bytes of a file:
|
||||
|
||||
`head -c {{size_in_bytes}} {{filename}}`
|
||||
|
||||
- Output everything but the last few lines of a file
|
||||
- Output everything but the last few lines of a file:
|
||||
|
||||
`head -n -{{count_of_lines}} {{filename}}`
|
||||
|
||||
- Output everything but the last few bytes of a file
|
||||
- Output everything but the last few bytes of a file:
|
||||
|
||||
`head -c -{{size_in_bytes}} {{filename}}`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# hostname
|
||||
|
||||
> Show or set the system's host name
|
||||
> Show or set the system's host name.
|
||||
|
||||
- Show current host name
|
||||
- Show current host name:
|
||||
|
||||
`hostname`
|
||||
|
||||
- Show the network address of the host name
|
||||
- Show the network address of the host name:
|
||||
|
||||
`hostname -i`
|
||||
|
||||
- Show all network addresses of the host
|
||||
- Show all network addresses of the host:
|
||||
|
||||
`hostname -I`
|
||||
|
||||
- Show the FQDN (Fully Qualified Domain Name)
|
||||
- Show the FQDN (Fully Qualified Domain Name):
|
||||
|
||||
`hostname --fqdn`
|
||||
|
||||
- Set current host name
|
||||
- Set current host name:
|
||||
|
||||
`hostname {{new_hostname}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# iostat
|
||||
|
||||
> Report stats for devices and partitions
|
||||
> Report stats for devices and partitions.
|
||||
|
||||
- Display disk statistics with disk IDs in human readable format
|
||||
- Display disk statistics with disk IDs in human readable format:
|
||||
|
||||
`iostat -h`
|
||||
|
||||
- Display disk statistics with disk names (including LVM) in human readable format
|
||||
- Display disk statistics with disk names (including LVM) in human readable format:
|
||||
|
||||
`iostat -Nh`
|
||||
|
||||
- Display CPU statistics
|
||||
- Display CPU statistics:
|
||||
|
||||
`iostat -c`
|
||||
|
||||
- Display extended disk statistics with disk names
|
||||
- Display extended disk statistics with disk names:
|
||||
|
||||
`iostat -xN`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# ip
|
||||
|
||||
> Show / manipulate routing, devices, policy routing and tunnels
|
||||
> Show / manipulate routing, devices, policy routing and tunnels.
|
||||
|
||||
- List interfaces with detailed info
|
||||
- List interfaces with detailed info:
|
||||
|
||||
`ip a`
|
||||
|
||||
- Display the routing table
|
||||
- Display the routing table:
|
||||
|
||||
`ip r`
|
||||
|
||||
- Make an interface up/down
|
||||
- Make an interface up/down:
|
||||
|
||||
`ip link set {{interface}} up/down`
|
||||
|
||||
- Add/Delete an ip address to an interface
|
||||
- Add/Delete an ip address to an interface:
|
||||
|
||||
`ip addr add/del {{ip}}/{{mask}} dev {{interface}}`
|
||||
|
||||
- Add an default route
|
||||
- Add an default route:
|
||||
|
||||
`ip route add default via {{ip}} dev {{interface}}`
|
||||
|
@@ -2,26 +2,26 @@
|
||||
|
||||
> BASH builtin for viewing information about processes spawned by the current shell.
|
||||
|
||||
- view jobs spawned by the current shell
|
||||
- View jobs spawned by the current shell:
|
||||
|
||||
`jobs`
|
||||
|
||||
- list jobs and their process ids
|
||||
- List jobs and their process ids:
|
||||
|
||||
`jobs -l`
|
||||
|
||||
- display information about jobs with changed status
|
||||
- Display information about jobs with changed status:
|
||||
|
||||
`jobs -n`
|
||||
|
||||
- display process id of process group leader
|
||||
- Display process id of process group leader:
|
||||
|
||||
`jobs -p`
|
||||
|
||||
- display running processes
|
||||
- Display running processes:
|
||||
|
||||
`jobs -r`
|
||||
|
||||
- display stopped processes
|
||||
- Display stopped processes:
|
||||
|
||||
`jobs -s`
|
||||
|
@@ -1,27 +1,27 @@
|
||||
# journalctl
|
||||
|
||||
> Query the systemd journal
|
||||
> Query the systemd journal.
|
||||
|
||||
- Show all messages from this boot
|
||||
- Show all messages from this boot:
|
||||
|
||||
`journalctl -b`
|
||||
|
||||
- Show all messages from last boot
|
||||
- Show all messages from last boot:
|
||||
|
||||
`journalctl -b -1`
|
||||
|
||||
- Follow new messages (like `tail -f` for traditional syslog)
|
||||
- Follow new messages (like `tail -f` for traditional syslog):
|
||||
|
||||
`journalctl -f`
|
||||
|
||||
- Show all messages by a specific unit
|
||||
- Show all messages by a specific unit:
|
||||
|
||||
`journalctl -u {{unit}}`
|
||||
|
||||
- Show all messages by a specific process
|
||||
- Show all messages by a specific process:
|
||||
|
||||
`journalctl _PID={{pid}}`
|
||||
|
||||
- Show all messages by a specific executable
|
||||
- Show all messages by a specific executable:
|
||||
|
||||
`journalctl {{/path/to/executable}}`
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# locate
|
||||
|
||||
> find filenames quickly
|
||||
> Find filenames quickly.
|
||||
|
||||
- Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily).
|
||||
- Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily):
|
||||
|
||||
`locate {{pattern}}`
|
||||
|
||||
- Recompute the database. You need to do it if you want to find recently added files.
|
||||
- Recompute the database. You need to do it if you want to find recently added files:
|
||||
|
||||
`sudo updatedb`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# lsb_release
|
||||
|
||||
> Provides certain LSB (Linux Standard Base) and distribution-specific information
|
||||
> Provides certain LSB (Linux Standard Base) and distribution-specific information.
|
||||
|
||||
- Print all available information
|
||||
- Print all available information:
|
||||
|
||||
`lsb_release -a`
|
||||
|
||||
- Print a description (usually the full name) of the operating system
|
||||
- Print a description (usually the full name) of the operating system:
|
||||
|
||||
`lsb_release -d`
|
||||
|
||||
- Print only the operating system name (ID), suppressing the field name
|
||||
- Print only the operating system name (ID), suppressing the field name:
|
||||
|
||||
`lsb_release -i -s`
|
||||
|
||||
- Print the release number and codename of the distribution, suppressing the field names
|
||||
- Print the release number and codename of the distribution, suppressing the field names:
|
||||
|
||||
`lsb_release -rcs`
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# md5sum
|
||||
|
||||
> Calculate MD5 cryptographic checksums
|
||||
> Calculate MD5 cryptographic checksums.
|
||||
|
||||
- Calculate the MD5 checksum for file(s) or files in a directory, one checksum per file
|
||||
- Calculate the MD5 checksum for file(s) or files in a directory, one checksum per file:
|
||||
|
||||
`md5sum {{filename1}}`
|
||||
`md5sum {{filename1}} {{filename2}}`
|
||||
`md5sum {{directory/\*}}`
|
||||
|
||||
- Read a file of MD5SUMs and verify all files have matching checksums
|
||||
- Read a file of MD5SUMs and verify all files have matching checksums:
|
||||
|
||||
`md5sum -c {{filename.md5}}`
|
||||
|
@@ -1,27 +1,27 @@
|
||||
# mdadm
|
||||
|
||||
> RAID management utility
|
||||
> RAID management utility.
|
||||
|
||||
- create array
|
||||
- Create array:
|
||||
|
||||
`mdadm --create {{/path/to/raid_device_file}} --level {{ raid level }} --raid-devices {{ number of disks}} {{/path/to/disk_device_file}}`
|
||||
|
||||
- stop array
|
||||
- Stop array:
|
||||
|
||||
`mdadm -S {{/path/to/raid_device_file}}`
|
||||
|
||||
- mark disk as failed
|
||||
- Mark disk as failed:
|
||||
|
||||
`mdadm {{/path/to/raid_device_file}} -f {{/path/to/disk_device_file}}`
|
||||
|
||||
- remove disk
|
||||
- Remove disk:
|
||||
|
||||
`mdadm {{/path/to/raid_device_file}} -r {{/path/to/disk_device_file}}`
|
||||
|
||||
- add disk to array
|
||||
- Add disk to array:
|
||||
|
||||
`mdadm {{/path/to/raid_device_file}} -a {{/path/to/disk_device_file}}`
|
||||
|
||||
- show RAID info
|
||||
- Show RAID info:
|
||||
|
||||
`mdadm -D {{/path/to/raid_device_file}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# nethogs
|
||||
|
||||
> Monitor bandwidth usage per process
|
||||
> Monitor bandwidth usage per process.
|
||||
|
||||
- Start nethogs as root (default device is eth0)
|
||||
- Start nethogs as root (default device is eth0):
|
||||
|
||||
`sudo nethogs`
|
||||
|
||||
- Monitor bandwidth on specific device
|
||||
- Monitor bandwidth on specific device:
|
||||
|
||||
`sudo nethogs {{device}}`
|
||||
|
||||
- Monitor bandwidth on multiple devices
|
||||
- Monitor bandwidth on multiple devices:
|
||||
|
||||
`sudo nethogs {{device1}} {{device2}}`
|
||||
|
||||
- Specify refresh rate
|
||||
- Specify refresh rate:
|
||||
|
||||
`sudo nethogs -t {{seconds}}`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# netstat
|
||||
|
||||
> Displays various networks related information such as open connections, open socket ports etc
|
||||
> Displays various networks related information such as open connections, open socket ports etc.
|
||||
|
||||
- List all ports
|
||||
- List all ports:
|
||||
|
||||
`netstat -a`
|
||||
|
||||
- List all listening ports
|
||||
- List all listening ports:
|
||||
|
||||
`netstat -l`
|
||||
|
||||
- List listening TCP ports
|
||||
- List listening TCP ports:
|
||||
|
||||
`netstat -t`
|
||||
|
||||
- Display PID and program names
|
||||
- Display PID and program names:
|
||||
|
||||
`netstat -p`
|
||||
|
||||
- List information continuously
|
||||
- List information continuously:
|
||||
|
||||
`netstat -c`
|
||||
|
@@ -1,35 +1,35 @@
|
||||
# pacman
|
||||
|
||||
> Arch Linux package manager utility
|
||||
> Arch Linux package manager utility.
|
||||
|
||||
- synchronize and update all packages
|
||||
- Synchronize and update all packages:
|
||||
|
||||
`pacman -Syu`
|
||||
|
||||
- install a new package
|
||||
- Install a new package:
|
||||
|
||||
`pacman -S package-name`
|
||||
|
||||
- remove a package and its dependencies
|
||||
- Remove a package and its dependencies:
|
||||
|
||||
`pacman -Rs package-name`
|
||||
|
||||
- search the package database for a keyword
|
||||
- Search the package database for a keyword:
|
||||
|
||||
`pacman -Ss icon theme`
|
||||
|
||||
- list installed packages and versions
|
||||
- List installed packages and versions:
|
||||
|
||||
`pacman -Q`
|
||||
|
||||
- list only the explicitly installed packages and versions
|
||||
- List only the explicitly installed packages and versions:
|
||||
|
||||
`pacman -Qe`
|
||||
|
||||
- find which package owns a certain file
|
||||
- Find which package owns a certain file:
|
||||
|
||||
`pacman -Qo filename`
|
||||
|
||||
- empty package cache to free up space
|
||||
- Empty package cache to free up space:
|
||||
|
||||
`pacman -Scc`
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# sha1sum
|
||||
|
||||
> Calculate SHA1 cryptographic checksums
|
||||
> Calculate SHA1 cryptographic checksums.
|
||||
|
||||
- Calculate the SHA1 checksum for file(s) or files in a directory, one checksum per file
|
||||
- Calculate the SHA1 checksum for file(s) or files in a directory, one checksum per file:
|
||||
|
||||
`sha1sum {{filename1}}`
|
||||
`sha1sum {{filename1}} {{filename2}}`
|
||||
`sha1sum {{directory/\*}}`
|
||||
|
||||
- Read a file of SHA1 sums and verify all files have matching checksums
|
||||
- Read a file of SHA1 sums and verify all files have matching checksums:
|
||||
|
||||
`sha1sum -c {{filename.sha1}}`
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# sha224sum
|
||||
|
||||
> Calculate SHA224 cryptographic checksums
|
||||
> Calculate SHA224 cryptographic checksums.
|
||||
|
||||
- Calculate the SHA224 checksum for file(s) or files in a directory, one checksum per file
|
||||
- Calculate the SHA224 checksum for file(s) or files in a directory, one checksum per file:
|
||||
|
||||
`sha224sum {{filename1}}`
|
||||
`sha224sum {{filename1}} {{filename2}}`
|
||||
`sha224sum {{directory/\*}}`
|
||||
|
||||
- Read a file of SHA224 sums and verify all files have matching checksums
|
||||
- Read a file of SHA224 sums and verify all files have matching checksums:
|
||||
|
||||
`sha224sum -c {{filename.sha224}}`
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# sha256sum
|
||||
|
||||
> Calculate SHA256 cryptographic checksums
|
||||
> Calculate SHA256 cryptographic checksums.
|
||||
|
||||
- Calculate the SHA256 checksum for file(s) or files in a directory, one checksum per file
|
||||
- Calculate the SHA256 checksum for file(s) or files in a directory, one checksum per file:
|
||||
|
||||
`sha256sum {{filename1}}`
|
||||
`sha256sum {{filename1}} {{filename2}}`
|
||||
`sha256sum {{directory/\*}}`
|
||||
|
||||
- Read a file of SHA256 sums and verify all files have matching checksums
|
||||
- Read a file of SHA256 sums and verify all files have matching checksums:
|
||||
|
||||
`sha256sum -c {{filename.sha256}}`
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# sha384sum
|
||||
|
||||
> Calculate SHA384 cryptographic checksums
|
||||
> Calculate SHA384 cryptographic checksums.
|
||||
|
||||
- Calculate the SHA384 checksum for file(s) or files in a directory, one checksum per file
|
||||
- Calculate the SHA384 checksum for file(s) or files in a directory, one checksum per file:
|
||||
|
||||
`sha384sum {{filename1}}`
|
||||
`sha384sum {{filename1}} {{filename2}}`
|
||||
`sha384sum {{directory/\*}}`
|
||||
|
||||
- Read a file of SHA384 sums and verify all files have matching checksums
|
||||
- Read a file of SHA384 sums and verify all files have matching checksums:
|
||||
|
||||
`sha384sum -c {{filename.sha384}}`
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# sha512sum
|
||||
|
||||
> Calculate SHA512 cryptographic checksums
|
||||
> Calculate SHA512 cryptographic checksums.
|
||||
|
||||
- Calculate the SHA512 checksum for file(s) or files in a directory, one checksum per file
|
||||
- Calculate the SHA512 checksum for file(s) or files in a directory, one checksum per file:
|
||||
|
||||
`sha512sum {{filename1}}`
|
||||
`sha512sum {{filename1}} {{filename2}}`
|
||||
`sha512sum {{directory/\*}}`
|
||||
|
||||
- Read a file of SHA512 sums and verify all files have matching checksums
|
||||
- Read a file of SHA512 sums and verify all files have matching checksums:
|
||||
|
||||
`sha512sum -c {{filename.sha512}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# shuf
|
||||
|
||||
> generate random permutations
|
||||
> Generate random permutations.
|
||||
|
||||
- randomize the order of lines in a file and output the result
|
||||
- Randomize the order of lines in a file and output the result:
|
||||
|
||||
`shuf {{filename}}`
|
||||
|
||||
- only output the first n entries of the result
|
||||
- Only output the first n entries of the result:
|
||||
|
||||
`shuf -n {{n}} {{filename}}`
|
||||
|
||||
- write output to another file
|
||||
- Write output to another file:
|
||||
|
||||
`shuf -o {{another_filename}} {{filename}}`
|
||||
|
||||
- generate random numbers in range
|
||||
- Generate random numbers in range:
|
||||
|
||||
`shuf -i {{low}}-{{high}}`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# shutdown
|
||||
|
||||
> Shutdown and reboot the system
|
||||
> Shutdown and reboot the system.
|
||||
|
||||
- Power off (halt) immediately
|
||||
- Power off (halt) immediately:
|
||||
|
||||
`shutdown -h now`
|
||||
|
||||
- Reboot immediately
|
||||
- Reboot immediately:
|
||||
|
||||
`shutdown -r now`
|
||||
|
||||
- Reboot in 5 minutes
|
||||
- Reboot in 5 minutes:
|
||||
|
||||
`shutdown -r +{{5}} &`
|
||||
|
||||
- Shutdown at 1:00 pm (Uses 24h clock)
|
||||
- Shutdown at 1:00 pm (Uses 24h clock):
|
||||
|
||||
`shutdown -h 13:00`
|
||||
|
||||
- Cancel a pending shutdown/reboot operation
|
||||
- Cancel a pending shutdown/reboot operation:
|
||||
|
||||
`shutdown -c`
|
||||
|
@@ -1,31 +1,27 @@
|
||||
# ss
|
||||
|
||||
> Utility to investigate sockets
|
||||
> Utility to investigate sockets.
|
||||
|
||||
- Dump all TCP/UDP/RAW/UNIX sockets
|
||||
- Dump all TCP/UDP/RAW/UNIX sockets:
|
||||
|
||||
`ss -a {{-t/-u/-w/-x}}`
|
||||
|
||||
- Show process(es) that using socket
|
||||
- Show process(es) that using socket:
|
||||
|
||||
`ss -p`
|
||||
|
||||
- Filter TCP sockets by states, only/exclude
|
||||
- Filter TCP sockets by states, only/exclude:
|
||||
|
||||
`ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}`
|
||||
|
||||
- Filter sockets by address and/or port
|
||||
- Filter sockets by address and/or port:
|
||||
|
||||
`ss -t dst 1.2.3.4:80`
|
||||
|
||||
`ss -u src 127/8`
|
||||
|
||||
`ss -t 'dport >= :1024'`
|
||||
|
||||
`ss -x "src /tmp/.X11-unix/*"`
|
||||
|
||||
`ss -t state established '( dport = :ssh or sport = :ssh )'`
|
||||
|
||||
- Only list IPv4 or IPv6 sockets
|
||||
- Only list IPv4 or IPv6 sockets:
|
||||
|
||||
`ss {{-4/-6}}`
|
||||
|
@@ -2,10 +2,10 @@
|
||||
|
||||
> Install your public key in a remote machine's authorized_keys.
|
||||
|
||||
- Copy the given public key to the remote
|
||||
- Copy the given public key to the remote:
|
||||
|
||||
`ssh-copy-id -i {{path/to/certificate}} {{username}}@{{remote_host}}`
|
||||
|
||||
- Copy the given public key to the remote with specific port
|
||||
- Copy the given public key to the remote with specific port:
|
||||
|
||||
`ssh-copy-id -i {{path/to/certificate}} -p {{port}} {{username}}@{{remote_host}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# strace
|
||||
|
||||
> Troubleshooting tool for tracing system calls
|
||||
> Troubleshooting tool for tracing system calls.
|
||||
|
||||
- Start tracing a specific process by its PID
|
||||
- Start tracing a specific process by its PID:
|
||||
|
||||
`strace -p {{pid}}`
|
||||
|
||||
- Trace a process and filter output by system call
|
||||
- Trace a process and filter output by system call:
|
||||
|
||||
`strace -p {{pid}} -e {{system call name}}`
|
||||
|
||||
- Count time, calls, and errors for each system call and report a summary on program exit.
|
||||
- Count time, calls, and errors for each system call and report a summary on program exit:
|
||||
|
||||
`strace -p {{pid}} -c`
|
||||
|
||||
- Show the time spent in every system call
|
||||
- Show the time spent in every system call:
|
||||
|
||||
`strace -p {{pid}} -T`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# systemctl
|
||||
|
||||
> Control the systemd system and service manager
|
||||
> Control the systemd system and service manager.
|
||||
|
||||
- List failed units
|
||||
- List failed units:
|
||||
|
||||
`systemctl --failed`
|
||||
|
||||
- Start/Stop/Restart a service
|
||||
- Start/Stop/Restart a service:
|
||||
|
||||
`systemctl start/stop/restart {{unit}}`
|
||||
|
||||
- Show the status of a unit
|
||||
- Show the status of a unit:
|
||||
|
||||
`systemctl status {{unit}}`
|
||||
|
||||
- Enable/Disable a unit to be started on bootup
|
||||
- Enable/Disable a unit to be started on bootup:
|
||||
|
||||
`systemctl enable/disable {{unit}}`
|
||||
|
||||
- Reload systemd, scanning for new or changed units
|
||||
- Reload systemd, scanning for new or changed units:
|
||||
|
||||
`systemctl daemon-reload`
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# tcpflow
|
||||
|
||||
> Capture TCP traffic for debugging and analysis
|
||||
> Capture TCP traffic for debugging and analysis.
|
||||
|
||||
- Show all data on the given interface and port
|
||||
- Show all data on the given interface and port:
|
||||
|
||||
`tcpflow -c -i {{eth0}} port {{80}}`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# timedatectl
|
||||
|
||||
> Control the system time and date
|
||||
> Control the system time and date.
|
||||
|
||||
- To check the current system clock time
|
||||
- To check the current system clock time:
|
||||
|
||||
`timedatectl`
|
||||
|
||||
- To set the local time of the system clock directly
|
||||
- To set the local time of the system clock directly:
|
||||
|
||||
`timedatectl set-time {{"yyyy-MM-dd hh:mm:ss"}}`
|
||||
|
||||
- To list available timezones
|
||||
- To list available timezones:
|
||||
|
||||
`timedatectl list-timezones`
|
||||
|
||||
- To change timezones
|
||||
- To change timezones:
|
||||
|
||||
`timedatectl set-timezone {{timezone}}`
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
> Display dynamic real-time information about running processes.
|
||||
|
||||
- Start top
|
||||
- Start top:
|
||||
|
||||
`top`
|
||||
|
||||
- Start top ignoring any idle or zombie processes
|
||||
- Start top ignoring any idle or zombie processes:
|
||||
|
||||
`top -i`
|
||||
|
||||
- Start top displaying only processes owned by given user
|
||||
- Start top displaying only processes owned by given user:
|
||||
|
||||
`top -u {{user-name}}`
|
||||
|
||||
- Get help about interactive commands
|
||||
- Get help about interactive commands:
|
||||
|
||||
`?`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# ulimit
|
||||
|
||||
> Get and set user limits
|
||||
> Get and set user limits.
|
||||
|
||||
- get the properties of all the user limits
|
||||
- Get the properties of all the user limits:
|
||||
|
||||
`ulimit -a`
|
||||
|
||||
- get hard limit for the number of simultaneously opened files
|
||||
- Get hard limit for the number of simultaneously opened files:
|
||||
|
||||
`ulimit -H -n`
|
||||
|
||||
- get soft limit for the number of simultaneously opened files
|
||||
- Get soft limit for the number of simultaneously opened files:
|
||||
|
||||
`ulimit -S -n`
|
||||
|
||||
- set max per-user process limit
|
||||
- Set max per-user process limit:
|
||||
|
||||
`ulimit -u 30`
|
||||
|
@@ -1,19 +1,19 @@
|
||||
# useradd
|
||||
|
||||
> Create a new user
|
||||
> Create a new user.
|
||||
|
||||
- Create new user
|
||||
- Create new user:
|
||||
|
||||
`useradd {{name}}`
|
||||
|
||||
- Create new user with a default home directory
|
||||
- Create new user with a default home directory:
|
||||
|
||||
`useradd -m {{name}}`
|
||||
|
||||
- Create new user with specified shell
|
||||
- Create new user with specified shell:
|
||||
|
||||
`useradd -s {{/path/to/shell}} {{name}}`
|
||||
|
||||
- Create new user with supplementary groups (mind the lack of whitespace)
|
||||
- Create new user with supplementary groups (mind the lack of whitespace):
|
||||
|
||||
`useradd -G {{group1,group2}} {{name}}`
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# userdel
|
||||
|
||||
> Remove a user
|
||||
> Remove a user.
|
||||
|
||||
- Remove a user and their home directory
|
||||
- Remove a user and their home directory:
|
||||
|
||||
`userdel -r {{name}}`
|
||||
|
@@ -1,15 +1,15 @@
|
||||
# usermod
|
||||
|
||||
> Modifies a user account
|
||||
> Modifies a user account.
|
||||
|
||||
- Change a user's name
|
||||
- Change a user's name:
|
||||
|
||||
`usermod -l {{newname}} {{user}}`
|
||||
|
||||
- Add user to supplementary groups (mind the whitespace)
|
||||
- Add user to supplementary groups (mind the whitespace):
|
||||
|
||||
`usermod -a -G {{group1,group2}} {{user}}`
|
||||
|
||||
- Create a new home directory for a user and move their files to it
|
||||
- Create a new home directory for a user and move their files to it:
|
||||
|
||||
`usermod -m -d {{/path/to/home}} {{user}}`
|
||||
|
@@ -1,16 +1,16 @@
|
||||
# wall
|
||||
|
||||
> write a message on the terminals of users currently logged in
|
||||
> only available to super-user
|
||||
> Write a message on the terminals of users currently logged in.
|
||||
> Only available to super-user.
|
||||
|
||||
- send a message
|
||||
- Send a message:
|
||||
|
||||
`echo "{{message}}" | wall`
|
||||
|
||||
- send a message from a file
|
||||
- Send a message from a file:
|
||||
|
||||
`wall {{file}}`
|
||||
|
||||
- send a message with timeout (default 300)
|
||||
- Send a message with timeout (default 300):
|
||||
|
||||
`wall -t {{seconds}} {{file}}`
|
||||
|
@@ -1,15 +1,15 @@
|
||||
# watch
|
||||
|
||||
> Execute a command repeatedly, and monitor the output in full-screen mode
|
||||
> Execute a command repeatedly, and monitor the output in full-screen mode.
|
||||
|
||||
- monitor files in the current folder
|
||||
- Monitor files in the current folder:
|
||||
|
||||
`watch {{ls}}`
|
||||
|
||||
- monitor disk space and highlight the changes
|
||||
- Monitor disk space and highlight the changes:
|
||||
|
||||
`watch -d {{df}}`
|
||||
|
||||
- monitor "node" processes, refreshing every 3 seconds
|
||||
- Monitor "node" processes, refreshing every 3 seconds:
|
||||
|
||||
`watch -n {{3}} "{{ps aux | grep node}}"`
|
||||
|
@@ -1,25 +1,25 @@
|
||||
# wpa_cli
|
||||
|
||||
> add and configure wlan interfaces
|
||||
> Add and configure wlan interfaces.
|
||||
|
||||
- scan for available networks
|
||||
- Scan for available networks:
|
||||
|
||||
`wpa_cli scan`
|
||||
`wpa_cli scan_results`
|
||||
|
||||
- add a network
|
||||
- Add a network:
|
||||
|
||||
`wpa_cli add_network {{number}}`
|
||||
|
||||
- configure the network, e.g. set SSID and passkey
|
||||
- Configure the network, e.g. set SSID and passkey:
|
||||
|
||||
`wpa_cli set_network {{number}} ssid {{SSID}}`
|
||||
`wpa_cli set_network {{number}} psk {{passkey}}`
|
||||
|
||||
- enable network
|
||||
- Enable network:
|
||||
|
||||
`wpa_cli enable_network {{number}}`
|
||||
|
||||
- save config
|
||||
- Save config:
|
||||
|
||||
`wpa_cli save_config`
|
||||
|
@@ -1,15 +1,15 @@
|
||||
# xargs
|
||||
|
||||
> execute a command with piped arguments
|
||||
> Execute a command with piped arguments.
|
||||
|
||||
- main use
|
||||
- Main use:
|
||||
|
||||
`{{arguments}} | xargs {{command}}`
|
||||
|
||||
- handling whitespace in arguments
|
||||
- Handling whitespace in arguments:
|
||||
|
||||
`{{arguments_null_terminated}} | xargs -0 {{command}}`
|
||||
|
||||
- example: list unneeded packages with deborphan and remove them with apt-get
|
||||
- Example: list unneeded packages with deborphan and remove them with apt-get:
|
||||
|
||||
`sudo deborphan | xargs sudo apt-get remove`
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# xrandr
|
||||
|
||||
> Set the size, orientation and/or reflection of the outputs for a screen
|
||||
> Set the size, orientation and/or reflection of the outputs for a screen.
|
||||
|
||||
- Display the current state of the system (known screens, resolutions, ...)
|
||||
- Display the current state of the system (known screens, resolutions, ...):
|
||||
|
||||
`xrandr --query`
|
||||
|
||||
- Disable disconnected outputs and enable connected ones with default settings
|
||||
- Disable disconnected outputs and enable connected ones with default settings:
|
||||
|
||||
`xrandr --auto`
|
||||
|
||||
- Change the resolution and update frequency of DisplayPort 1 to 1920x1080, 60Hz
|
||||
- Change the resolution and update frequency of DisplayPort 1 to 1920x1080, 60Hz:
|
||||
|
||||
`xrandr --output {{DP1}} --mode {{1920x1080}} --rate {{60}}`
|
||||
|
||||
- Set the resolution of HDMI2 to 1280x1024 and put it on the right of DP1
|
||||
- Set the resolution of HDMI2 to 1280x1024 and put it on the right of DP1:
|
||||
|
||||
`xrandr --output {{HDMI2}} --mode {{1280x1024}} --right-of {{DP1}}`
|
||||
|
||||
- Disable the VGA1 output
|
||||
- Disable the VGA1 output:
|
||||
|
||||
`xrandr --output {{VGA1}} --off`
|
||||
|
@@ -2,22 +2,22 @@
|
||||
|
||||
> Command line tool to change settings for Wacom pen tablets at runtime.
|
||||
|
||||
- List all the available wacom devices. The device name is in the first column.
|
||||
- List all the available wacom devices. The device name is in the first column:
|
||||
|
||||
`xsetwacom list`
|
||||
|
||||
- Set Wacom area to specific screen. Get name of the screen with `xrandr`.
|
||||
- Set Wacom area to specific screen. Get name of the screen with `xrandr`:
|
||||
|
||||
`xsetwacom set "{{device name}}" MapToOutput {{screen}}`
|
||||
|
||||
- Set mode to relative (like a mouse) or absolute (like a pen) mode.
|
||||
- Set mode to relative (like a mouse) or absolute (like a pen) mode:
|
||||
|
||||
`xsetwacom set "{{device name}}" Mode "{{Relative|Absolute}}"`
|
||||
|
||||
- Rotate the input (useful for tablet-PC when rotating screen) by 0|90|180|270 degrees from "natural" rotation.
|
||||
- Rotate the input (useful for tablet-PC when rotating screen) by 0|90|180|270 degrees from "natural" rotation:
|
||||
|
||||
`xsetwacom set "{{device name}}" Rotate {{none|half|cw|ccw}}`
|
||||
|
||||
- Set button to only work when the tip of the pen is touching the tablet.
|
||||
- Set button to only work when the tip of the pen is touching the tablet:
|
||||
|
||||
`xsetwacom set "{{device name}}" TabletPCButton "on"`
|
||||
|
@@ -1,24 +1,23 @@
|
||||
# yum
|
||||
|
||||
>Package management utility for RHEL, Feodra, and CentOS (for older versions)
|
||||
> Package management utility for RHEL, Feodra, and CentOS (for older versions).
|
||||
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent yum commands.
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent yum commands:
|
||||
|
||||
`yum update`
|
||||
|
||||
- Install a new package
|
||||
- Install a new package:
|
||||
|
||||
`yum install {{package}}`
|
||||
|
||||
- Install a new package and assume yes to all questions (also works with update, great for automated updates)
|
||||
- Install a new package and assume yes to all questions (also works with update, great for automated updates):
|
||||
|
||||
`yum -y install {{package}}`
|
||||
|
||||
- Remove a package
|
||||
- Remove a package:
|
||||
|
||||
`yum remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to newest available versions
|
||||
- Upgrade installed packages to newest available versions:
|
||||
|
||||
`yum upgrade`
|
||||
|
||||
|
@@ -1,23 +1,23 @@
|
||||
# zypper
|
||||
|
||||
> SUSE & openSUSE package management utility
|
||||
> SUSE & openSUSE package management utility.
|
||||
|
||||
- Synchronize list of packages and versions available
|
||||
- Synchronize list of packages and versions available:
|
||||
|
||||
`zypper refresh`
|
||||
|
||||
- Install a new package
|
||||
- Install a new package:
|
||||
|
||||
`zypper install {{package}}`
|
||||
|
||||
- Remove a package
|
||||
- Remove a package:
|
||||
|
||||
`zypper remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to newest available versions
|
||||
- Upgrade installed packages to newest available versions:
|
||||
|
||||
`zypper update`
|
||||
|
||||
- Search package via keyword
|
||||
- Search package via keyword:
|
||||
|
||||
`zypper search {{keyword}}`
|
||||
|
Reference in New Issue
Block a user