hexdump, logger, netstat, n, nm, pdfgrep: move to common (#6549)

This commit is contained in:
marchersimon
2021-09-18 23:05:08 +02:00
committed by GitHub
parent f79d8e56e3
commit 442a013cb8
17 changed files with 2 additions and 129 deletions

16
pages/common/hexdump.md Normal file
View File

@@ -0,0 +1,16 @@
# hexdump
> An ASCII, decimal, hexadecimal, octal dump.
> More information: <https://manned.org/hexdump>.
- Print the hexadecimal representation of a file:
`hexdump {{file}}`
- Display the input offset in hexadecimal and its ASCII representation in two columns:
`hexdump -C {{file}}`
- Display the hexadecimal representation of a file, but interpret only n bytes of the input:
`hexdump -C -n{{number_of_bytes}} {{file}}`

24
pages/common/logger.md Normal file
View File

@@ -0,0 +1,24 @@
# logger
> Add messages to syslog (/var/log/syslog).
> More information: <https://manned.org/logger>.
- Log a message to syslog:
`logger {{message}}`
- Take input from stdin and log to syslog:
`echo {{log_entry}} | logger`
- Send the output to a remote syslog server running at a given port. Default port is 514:
`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}`
- Use a specific tag for every line logged. Default is the name of logged in user:
`echo {{log_entry}} | logger --tag {{tag}}`
- Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
`echo {{log_entry}} | logger --priority {{user.warning}}`

23
pages/common/n.md Normal file
View File

@@ -0,0 +1,23 @@
# n
> Tool to manage multiple node versions.
- Install a given version of node. If the version is already installed, it will be activated:
`n {{version}}`
- Display installed versions and interactively activate one of them:
`n`
- Remove a version:
`n rm {{version}}`
- Execute a file with a given version:
`n use {{version}} {{file.js}}`
- Output binary path for a version:
`n bin {{version}}`

32
pages/common/netstat.md Normal file
View File

@@ -0,0 +1,32 @@
# netstat
> Displays network-related information such as open connections, open socket ports, etc.
> More information: <https://man7.org/linux/man-pages/man8/netstat.8.html>.
- List all ports:
`netstat --all`
- List all listening ports:
`netstat --listening`
- List listening TCP ports:
`netstat --tcp`
- Display PID and program names:
`netstat --program`
- List information continuously:
`netstat --continuous`
- List routes and do not resolve IP addresses to hostnames:
`netstat --route --numeric`
- List listening TCP and UDP ports (+ user and process if you're root):
`netstat --listening --program --numeric --tcp --udp --extend`

19
pages/common/nm.md Normal file
View File

@@ -0,0 +1,19 @@
# nm
> List symbol names in object files.
- List global (extern) functions in a file (prefixed with T):
`nm -g {{file.o}}`
- List only undefined symbols in a file:
`nm -u {{file.o}}`
- List all symbols, even debugging symbols:
`nm -a {{file.o}}`
- Demangle C++ symbols (make them readable):
`nm --demangle {{file.o}}`

23
pages/common/pdfgrep.md Normal file
View File

@@ -0,0 +1,23 @@
# pdfgrep
> Search text in PDF files.
- Find lines that match pattern in a PDF:
`pdfgrep {{pattern}} {{file.pdf}}`
- Include file name and page number for each matched line:
`pdfgrep --with-filename --page-number {{pattern}} {{file.pdf}}`
- Do a case-insensitive search for lines that begin with "foo" and return the first 3 matches:
`pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{file.pdf}}`
- Find pattern in files with a `.pdf` extension in the current directory recursively:
`pdfgrep --recursive {{pattern}}`
- Find pattern on files that match a specific glob in the current directory recursively:
`pdfgrep --recursive --include {{'*book.pdf'}} {{pattern}}`