wipefs [options] device
Flag | Usage |
---|---|
without -a or -o | list all visible filesystems and the offsets of their basic signatures |
-a --all | erase all available signatures |
-b --backup | backup the signature into the file $HOME/wipefs-device-offset.bak |
-f --force | force erasure, even if the filesystem is mounted
this is required in order to erase a partition-table signature on a block device
it is not yet completely clear to me when this option is required or not depending on the situation : primary partition / extended partitions / primary partitions used as LVM PVs / ...
|
-n --noheadings | do not print a header line |
-o offset --offset offset | erase the signature found at offset bytes from the specified device |
Usage | DON'T | DO |
---|---|---|
Count the lines of someFile (UUOC + UUOW combo !!! ) | cat someFile | wc -l |
|
Count the lines of someFile matching a regex | grep -E 'regex' someFile | wc -l | grep -Ec 'regex' someFile |
Flag | Usage |
---|---|
-c --bytes | print the byte counts |
-m --chars | print the character counts |
-l --lines | print the newline counts
This equals the number of lines only if every line has a trailing
\n , which is not always true :
echo -n 'hello world' | wc -l
0 |
-w --words | print the word counts |
Flag | Usage |
---|---|
(none) | Precedes the message by a banner. Bob running :
wall Hello world
will display Broadcast message from bob@hostname (pts/6) (Mon Jun 15 14:50:32 2015): Hello world |
-n | root only : do not display the banner. Instead display :Remote broadcast message (Mon Jun 15 14:54:38 2015): Hello world |
#!/usr/bin/env bash # Simple chat system for local users nick=${1?Usage: $0 nickname (e.g. $0 bob)} log="/tmp/$0.log" >"$log" chmod a+w "$log" echo "^D to exit chat." >&2 tail -F "$log" & tailPid=$! trap 'kill "$tailPid"' 0 while IFS='' read -er line; do echo "<$nick> $line"; done >> "$log"
$log
file at the end Flag | Usage |
---|---|
(void) | defaults to -s |
-a --all | same as -b -d --login -p -r -t -T -u |
-b | display date and time of latest boot |
-d --dead | print dead processes |
-H --heading | display column headers |
-l --login | list only the entries that correspond to processes via which the system is waiting for a user to login. The user name is always LOGIN. |
-m |
display hostname + user on current stdin
If who is launched with 2 arguments (whatever they are), -m is assumed. Try it :
|
-p --process | print active processes spawned by init |
-u --users |
|
-r --runlevel | display current runlevel |
-s --short | print only name, line and time |
-t --time | print last system clock change |
-T -w --mesg | add user's message status as :
|
whois is a utility designed to be used on the Internet to query the registrar databases. It outputs the name and contact information of the person / company who owns a domain name.
Looks like this utility is not part of the default Debian install.. It can be installed via the whois package.
cat "$listOfUrlsToDownload" | xargs -n 1 -P $numberOfParallelDownloads wget -q
(source)parallel -j $numberOfParallelDownloads "echo -n .; wget -c -q {}" < "$listOfUrlsToDownload"
http_proxy = http://proxyUser:proxyPassword@proxyHostname:proxyPort/ use_proxy = on wait = 15
If proxyPassword contains some special characters such as [SPACE]
, :
or @
, you'll have to url-encode them.
Flag | Usage | |
---|---|---|
-c | HTTP | continue getting a partially-downloaded file. |
--cache=on|off | HTTP | When set to off, disable server-side cache. In this case, wget will send the remote server an appropriate directive (Pragma: no-cache ) to get the file from the remote service, rather than returning the cached version. Default is on. |
--dns-cache=off | HTTP | Turn off caching of DNS lookups. Normally, wget remembers the addresses it looked up from DNS so it doesn't have to repeatedly contact the DNS server for the same (typically small) set of addresses it retrieves from. This cache exists in memory only; a new wget run will contact DNS again. |
--header | HTTP | Send an additional HTTP header. When using extra headers, make sure the various gateways/proxies on the line don't mangle/remove them. |
-E --html-extension | HTTP | Append a .html extension to the downloaded files which content is application/xhtml+xml or text/html. Thus, index.php will be saved as index.php.html |
--ftp-user=user --ftp-password=password | FTP | Authenticate as user / password when (... not tested yet) |
--http-user=user --http-password=password | HTTP | Authenticate as user / password when prompted by a ".htaccess restriction". Looks like there is nothing to do with the "realm" (window title / prompt) here. |
-i file --input-file=file | HTTP | Read URLs from file. With --force-html, file will be considered as an HTML file. |
-k --convert-links | HTTP | After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc. |
--local-encoding=encoding | HTTP | Use encoding as the default system encoding. That affects how wget converts URLs specified as arguments from locale to UTF-8 for IRI support. |
-l depth --level=depth | HTTP | Specify recursion maximum depth level. Defaults to 5. Use inf for infinite recursion. |
--max-redirect=n | HTTP | Follow at most n redirections for a resource (defaults to 20). (source) --max-redirect=0 disables redirections following. |
-m --mirror | HTTP | Equivalent to -r -N -l inf -nr, this is used to build a mirror of a web site. |
-N --timestamping | HTTP | Turn on time-stamping. |
-np --no-parent | HTTP | Don't try to climb into the parent directory |
--no-check-certificate | HTTP | Skip certificate check to access a server that has an invalid SSL certificate : self-signed, expired, not from a trusted issuer, ... |
-nr --dont-remove-listing | FTP | Don't remove the temporary .listing files generated by FTP retrievals. |
-nv --no-verbose | HTTP | Disable verbose output :
|
-O file | HTTP | write Output to file. To display the output rather than writing it to a file, specify /dev/stdout, or its shorter synonymous : -. |
-P /path/to/directory --directory-prefix=/path/to/directory |
HTTP | (AKA "destination directory") Save downloaded content to /path/to/directory (defaults to .) |
-p --pages-requisites | HTTP | Download all the files that are necessary to properly display a given HTML page : inlined images, sounds, and referenced stylesheets. (Somewhat overloads -r + -l used together, see man) |
--post-data | HTTP | Send data using the POST method. Example : --post-data="email=user@provider.com&password=123456&checkbox=on" Data sent by POST must be URL-encoded ! |
-q --quiet | HTTP | Turn off output. This is equivalent to -O /dev/null, and faster. |
-r --recursive | HTTP | recursive download : pages mentioned in hyperlinks will be downloaded too. |
--remote-encoding=encoding | HTTP | Use encoding as the default remote server encoding. This can be found in "Content-Type" HTTP header and in "Content-Type http-equiv" HTML meta tag. |
--restrict-file-names=unix|windows|ascii | HTTP | Specify which special characters found in the remote URLs will be escaped so that they comply with local file names. For instance, if using ascii, Wget will escape all non-ascii characters. |
-S --server-response | HTTP FTP |
display the server HTTP (or FTP) headers |
-T n --timeout=n | HTTP FTP |
Set the network timeout (time to DNS + Connect + Read) to n seconds. |
-t n --tries=n | HTTP FTP |
Retry n times. Defaults to 20. 0 and inf will cause infinite retrying |
-U userAgentString --user-agent=userAgentString |
HTTP | Identify as userAgentString to the HTTP server |
--user=user --password=password | HTTP FTP |
Specify credentials (single set of options for both protocols). Can be overridden by --http-user and --ftp-user (and the matching --XXX-password ). |
-w delay --wait=delay | HTTP | Wait delay seconds between requests to lighten the web server. delay defaults to seconds, but can be suffixed with m, h, d for minutes, hours or days. |
-Y on|off --proxy on|off (really works ?) --no-proxy |
HTTP | Toggle proxy support on or off (default is on). This disables wgetrc settings. |
wget --header="Authorization: Basic ZGJlcnJlYmlAcHJpc21hbWVkaWEuY29tOnByaXNtYTIwMTE=" ...
wget --header="Authorization: Basic "$(echo login:password | base64) ...
wget -q -S --header="Host: my.domainName.xxx" origin-my.domainName.xxx
This may not work if sent through a proxy, as this proxy may block HTTP requests having custom headers, or return the result of a previously cached request made without the custom header.
wget -k -r -E -np -p --restrict-file-names=ascii URL_of_start_page
WARNING: The certificate of 'www.example.com' is not trusted. WARNING: The certificate of 'www.example.com' hasn't got a known issuer.try :
which wget /usr/bin/wget which bc /usr/bin/bc
echo just to split pasted commands from their output and make this example more readable alias echo='echo "ECHO SAYS:"
' defines an alias for echo named exactlyecho, hence the need to discriminateecho
(the alias) fromecho
(/usr/bin/echo) echo 'hello world (with the alias)' $(which echo) 'hello world (regular echo from which)' unalias echo echo 'hello world (unaliased)'
ECHO SAYS: hello world (with the alias) hello world (regular echo from which) hello world (unaliased)
watch [options] command
Execute command periodically, showing output full screen.Keep in mind that command is passed to sh -c, so extra quoting may be necessary.
Flag | Usage |
---|---|
-d --differences | highlight what's different from the previous run. Example : watch -d date |
-g --chgexit | exit when the output of command changes
This is blocked by -d.
|
-n s --interval=s |
|
grep -i someWord logFile.log
'