Flag | Usage |
---|---|
-P pager | use pager to display pages and scroll up / down / page forward-backward / search / ... |
Flag | Usage |
---|---|
-a pattern | load all modules matching the pattern conditions |
-c | display current configuration not equivalent to lsmod |
-r moduleName | remove (=unload) the module moduleName |
-t type | affect modules of the corresponding type Example, to list all i2c modules : modprobe -l -t i2c |
5d41402abc4b2a76b9719d911017c592 -
-n is required because echo appends a newline character to the output. Without this flag, the encoded string wouldn't be hello but hello\n, resulting in a different hash (source).
Flag | Usage |
---|---|
-m octalMask --mode=octalMask | Set file mode (as in chmod) using the mask octal notation format (i.e. : 644).
|
-p --parents | Make parent directories as needed, return no error if existing |
Flag | Usage | Details |
---|---|---|
-i --interactive | prompt before overwrite | |
-f --force | do not prompt before overwriting Looks like this is the default. See -i |
echo LEAD > lead; echo GOLD > gold; mv lead gold; cat lead gold; rm gold
cat: lead: No such file or directory missing because renamed LEAD this is gold, overwritten without prompting |
-n --no-clobber |
do not overwrite an existing file When this applies, no UNIX_FAILURE is generated |
echo LEAD > lead; echo GOLD > gold; mv -n lead gold; echo $?; cat lead gold; rm lead gold
0 UNIX_SUCCESS LEAD no file was altered GOLD |
mktemp [options] template
template must contain at least 3 consecutiveX
in last component.
Flag | Usage |
---|---|
-d --directory | create a directory, not a file |
-u --dry-run | do not create anything, just print the name of the would-be-created file/directory
This option is marked as unsafe because it leaves the possibility of a symlink exploit : in the time lapse between
Workaround : make a temporary directory with -d, and use names of your choice within that directory (source). |
--suff=suffix | append suffix to template. The same happens if template does not end with an X |
-p dir --tmpdir=dir |
Depending on the context, it _may_ be more appropriate to create temporary files into a RAM disk. This option doesn't exist in Bash 3.x. Use mktemp /path/to/dir/tmpFile.XXXX instead. |
Create a temporary file in ... | Command | Creates | Notes |
---|---|---|---|
the current directory | mktemp tmpFile.XXXX | ./tmpFile.4zxA | tmpFile=$(mktemp XXXXXXXX.tmp)
use temp file
rm "$tmpFile" |
any specified directory | mktemp --tmpdir=./testDir/ test_File_XXXXXXXXXXX | ./testDir/test_File_XTRr0VPklFg | |
the "temporary directory" |
|
|
|
the "temporary directory", by a script |
|
mtr (My traceroute, originally called Matt's traceroute) is a computer program which combines the functionality of the traceroute and ping programs in a single network diagnostic tool.
mtr probes routers on the route path by limiting the number of hops individual packets may traverse, and listening to responses of their expiry. It will regularly repeat this process, usually once per second, and keep track of the response times of the hops along the path.
Flag | Usage |
---|---|
-s | specify mail subject |
When sending a mail to a localhost user, specifying recipient@domain.com, recipient@localhost or just recipient has the same result.
Roses are #FF0000 Violets are #0000FF All of my base Are belong to you
When mailing a localhost recipient, the /var/mail/recipient file must exist and be writable by the sender.
MAILPATH=/var/mail/bob MAILCHECK=60For details on
MAILCHECK
: man bash, then search : / MAILCHECK
The Internetz are full of discussions like : What is the best filesystem ?
Flag | Usage |
---|---|
-b block-size | Specify the size of blocks in bytes. Valid block-size values are 1024, 2048 and 4096 bytes per block. If omitted, the block size will be determined from the filesystem size and usage (see -T)
mkfs.ext4 only
|
-I | set the Inode size |
-L | set the volume Label |
-m | Specify the percentage of the filesystem blocks reserved for the super-user (default is 5%) |
-T usageType | Specify how the filesystem will be used so that optimal parameters can be applied. Supported usageType values are listed in /etc/mke2fs.conf |