BITS(1)
๐ BITS(1) โ the girlies' guide to bit masks ๐
okay so bestie, welcome to bits โจ it's the user-commands era of your terminal and we're converting bit masks or lists from/to various formats. no cap, it's giving โจutilityโจ.
๐ธ NAME ๐ธ
bits โ convert bit masks or lists from/to various formats ๐
๐ฆ SYNOPSIS ๐ฆ
bits [-h] [-V] [-w number] [mode] [mask|list]...
like. that's it. that's the whole vibe check. ๐
๐ DESCRIPTION ๐
The bits utility converts between bit masks and bit lists. fr fr. and it also supports combining multiple masks or lists using bitwise operations, which is lowkey the main character energy of this whole thing. ๐
๐ POSITIONAL ARGUMENTS ๐
maskโ a set of bits specified as a hexadecimal mask value. for example:0xeec2๐ซlistโ a set of bits specified as a comma-separated list of bit IDs. for example:1,5,29,32๐
so if you pass no argument at all, the sets of bits will be read from standard input, one group per line. yes queen, stdin is a valid lifestyle. ๐ซถ
Consecutive IDs can be compressed as ranges โ for example: 5,6,7,8,9,10 โ 5-10. it's giving โจefficiencyโจ.
Optionally (the way that this is so fun), if an argument starts with a comma, it will be parsed as a single hexadecimal mask split in 32-bit groups. for example:
,00014000,00000000,00020000 โ 17,78,80
iconic. ๐
By default, all groups will be OR'ed together. but if a group has one of the prefixes &, ^, or ~, it will be combined with the resulting mask using a different binary operation. so here's the tea on each one ๐
&mask|&listโ the group will be combined with a binary AND operation. That is: all bits that are set to1in the group AND in the combined groups so far will be preserved as1. All other bits will be reset to0. ๐^mask|^listโ the group will be combined with a binary XOR operation. That is: all bits that are set to1in the group AND to0in the combined groups so far (or the other way around) will be set to1. Bits that are set both to1or both to0will be reset to0. literally a "we're different or we're nothing" situation ๐ญ~mask|~listโ All bits set to1in the group will be cleared (reset to0) in the combined groups so far. bye bestie, you're gone now ๐
โจ OPTIONS โจ
-w number,--width numberโ The maximum number of bits in the masks handled bybits. The default is8192. Any bit larger than this number will be truncated. ๐จ not me watching your bits get snipped ๐จ-h,--helpโ Display help text and exit. ๐ซถ-V,--versionโ Display version and exit. ๐
๐ CONVERSION MODE ๐
One of the following conversion modes can be specified. If not specified, it defaults to -m, --mask. the default is literally the default, we love a low-effort queen.
-b,--binaryโ Print the combined arguments as a binary mask value.0bgirlies rise up ๐-g,--grouped-maskโ Print the combined arguments as a hexadecimal mask value in 32-bit comma-separated groups. organized. โจ-l,--listโ Print the combined arguments as a list of bit IDs. Consecutive IDs are compressed to ranges. ๐-m,--maskโ Print the combined arguments as a hexadecimal mask value (default). ๐
๐ฅ EXAMPLES ๐ฅ
ok bestie, these are shown verbatim, do NOT come for me about the formatting, this is exactly what the page says ๐
~$ bits --mask 4,5-8 16,30
0x400101f0
~$ bits --list 0xeec2
1,6,7,9-11,13-15
~$ bits --binary 4,5-8 16,30
0b100_0000_0000_0001_0000_0001_1111_0000
~$ bits --list ,00300000,03000000,30000003
0,1,28,29,56,57,84,85
~$ bits --list 1,2,3,4 ~3-10
1,2
~$ bits --list 1,2,3,4 ^3-10
1,2,5-10
~$ bits --grouped-mask 2,22,74,79
8400,00000000,00400004
~$ bits --width 64 --list 2,22,74,79
2,22
like??? she ATE with these examples. ๐ โจ
๐ AUTHORS ๐
Robin Jarry. yes, the one and only. give her her flowers ๐
๐ญ REPORTING BUGS ๐ญ
For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues.
ngl bestie if you found a bug, go tell them, they wanna know. don't suffer in silence ๐ซถ
๐ AVAILABILITY ๐
The bits command is part of the util-linux package which can be downloaded from the Linux Kernel Archive at https://www.kernel.org/pub/linux/utils/util-linux/. ๐ธ
okay that's the whole page!! this came to you from the util-linux 2.42.4 release, dated 2026-09-21 โ go forth and mask your bits, bestie, you've got this ๐โจ๐๐ฆ
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms