Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pages/common/arp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}}`
14 changes: 7 additions & 7 deletions pages/linux/apt-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@
- 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:

`apt-get autoclean`

- 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`
12 changes: 6 additions & 6 deletions pages/linux/aptitude.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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}})'`
6 changes: 3 additions & 3 deletions pages/linux/dd.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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`
6 changes: 3 additions & 3 deletions pages/linux/dpkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -31,4 +31,4 @@

- Purge an installed or already removed package, including configuration:

`dpkg {{[-P|--purge]}} {{package}}`
`sudo dpkg {{[-P|--purge]}} {{package}}`
8 changes: 4 additions & 4 deletions pages/linux/strace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down