mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 11:25:16 +08:00
apt-get, aptitude, dpkg, strace, dd, arp: add sudo (#19270)
This commit is contained in:
+6
-2
@@ -5,12 +5,16 @@
|
||||
|
||||
- Show the current ARP table:
|
||||
|
||||
`arp`
|
||||
|
||||
- Show [a]lternative BSD style output format with on fixed columns:
|
||||
|
||||
`arp -a`
|
||||
|
||||
- [d]elete a specific entry:
|
||||
|
||||
`arp -d {{address}}`
|
||||
`sudo arp -d {{address}}`
|
||||
|
||||
- [s]et up a new entry in the ARP table:
|
||||
|
||||
`arp -s {{address}} {{mac_address}}`
|
||||
`sudo arp -s {{address}} {{mac_address}}`
|
||||
|
||||
@@ -7,23 +7,23 @@
|
||||
|
||||
- Update the list of available packages and versions (it's recommended to run this before other `apt-get` commands):
|
||||
|
||||
`apt-get update`
|
||||
`sudo apt-get update`
|
||||
|
||||
- Install a package, or update it to the latest available version:
|
||||
|
||||
`apt-get install {{package}}`
|
||||
`sudo apt-get install {{package}}`
|
||||
|
||||
- Remove a package:
|
||||
|
||||
`apt-get remove {{package}}`
|
||||
`sudo apt-get remove {{package}}`
|
||||
|
||||
- Remove a package and its configuration files:
|
||||
|
||||
`apt-get purge {{package}}`
|
||||
`sudo apt-get purge {{package}}`
|
||||
|
||||
- Upgrade all installed packages to their newest available versions:
|
||||
|
||||
`apt-get upgrade`
|
||||
`sudo apt-get upgrade`
|
||||
|
||||
- Clean the local repository - removing package files (`.deb`) from interrupted downloads that can no longer be downloaded:
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
- Remove all packages that are no longer needed:
|
||||
|
||||
`apt-get autoremove`
|
||||
`sudo apt-get autoremove`
|
||||
|
||||
- Upgrade installed packages (like `upgrade`), but remove obsolete packages and install additional packages to meet new dependencies:
|
||||
|
||||
`apt-get dist-upgrade`
|
||||
`sudo apt-get dist-upgrade`
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent `aptitude` commands:
|
||||
|
||||
`aptitude update`
|
||||
`sudo aptitude update`
|
||||
|
||||
- Install a new package and its dependencies:
|
||||
|
||||
`aptitude install {{package}}`
|
||||
`sudo aptitude install {{package}}`
|
||||
|
||||
- Search for a package:
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
|
||||
- Remove a package and all packages depending on it:
|
||||
|
||||
`aptitude remove {{package}}`
|
||||
`sudo aptitude remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to the newest available versions:
|
||||
|
||||
`aptitude upgrade`
|
||||
`sudo aptitude upgrade`
|
||||
|
||||
- Upgrade installed packages (like `aptitude upgrade`) including removing obsolete packages and installing additional packages to meet new package dependencies:
|
||||
|
||||
`aptitude full-upgrade`
|
||||
`sudo aptitude full-upgrade`
|
||||
|
||||
- Put an installed package on hold to prevent it from being automatically upgraded:
|
||||
|
||||
`aptitude hold '?installed({{package}})'`
|
||||
`sudo aptitude hold '?installed({{package}})'`
|
||||
|
||||
+3
-3
@@ -6,11 +6,11 @@
|
||||
|
||||
- Make a bootable USB drive from an isohybrid file (such as `archlinux-xxx.iso`) and show the progress:
|
||||
|
||||
`dd if={{path/to/file.iso}} of={{/dev/usb_drive}} status=progress`
|
||||
`sudo dd if={{path/to/file.iso}} of={{/dev/usb_drive}} status=progress`
|
||||
|
||||
- Clone a drive to another drive with 4 MiB block size and flush writes before the command terminates:
|
||||
|
||||
`dd bs=4M conv=fsync if={{/dev/source_drive}} of={{/dev/dest_drive}}`
|
||||
`sudo dd bs=4M conv=fsync if={{/dev/source_drive}} of={{/dev/dest_drive}}`
|
||||
|
||||
- Generate a file with a specific number of random bytes by using kernel random driver:
|
||||
|
||||
@@ -26,4 +26,4 @@
|
||||
|
||||
- Check the progress of an ongoing `dd` operation (run this command from another shell):
|
||||
|
||||
`kill -USR1 $(pgrep {{[-x|--exact]}} dd)`
|
||||
`progress`
|
||||
|
||||
+3
-3
@@ -7,11 +7,11 @@
|
||||
|
||||
- Install a package:
|
||||
|
||||
`dpkg {{[-i|--install]}} {{path/to/file.deb}}`
|
||||
`sudo dpkg {{[-i|--install]}} {{path/to/file.deb}}`
|
||||
|
||||
- Remove a package:
|
||||
|
||||
`dpkg {{[-r|--remove]}} {{package}}`
|
||||
`sudo dpkg {{[-r|--remove]}} {{package}}`
|
||||
|
||||
- List installed packages:
|
||||
|
||||
@@ -31,4 +31,4 @@
|
||||
|
||||
- Purge an installed or already removed package, including configuration:
|
||||
|
||||
`dpkg {{[-P|--purge]}} {{package}}`
|
||||
`sudo dpkg {{[-P|--purge]}} {{package}}`
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
- Start tracing a specific process by its PID:
|
||||
|
||||
`strace {{[-p|--attach]}} {{pid}}`
|
||||
`sudo strace {{[-p|--attach]}} {{pid}}`
|
||||
|
||||
- Trace a process and filter output by system call [e]xpression:
|
||||
|
||||
`strace {{[-p|--attach]}} {{pid}} -e {{system_call,system_call2,...}}`
|
||||
`sudo strace {{[-p|--attach]}} {{pid}} -e {{system_call,system_call2,...}}`
|
||||
|
||||
- Count time, calls, and errors for each system call and report a summary on program exit:
|
||||
|
||||
`strace {{[-p|--attach]}} {{pid}} {{[-c|--summary-only]}}`
|
||||
`sudo strace {{[-p|--attach]}} {{pid}} {{[-c|--summary-only]}}`
|
||||
|
||||
- Show the time spent in every system call and specify the maximum string size to print:
|
||||
|
||||
`strace {{[-p|--attach]}} {{pid}} {{[-T|--syscall-times]}} {{[-s|--string-limit]}} {{32}}`
|
||||
`sudo strace {{[-p|--attach]}} {{pid}} {{[-T|--syscall-times]}} {{[-s|--string-limit]}} {{32}}`
|
||||
|
||||
- Start tracing a program by executing it:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user