News for hackers. Stuff that matters.

pixelbeat

Re:Big Fish: Exploiting a 37-Year-Old Kernel Bug in OpenBSD on Sunday October 18, 2026 @04:17AM (#50139055)
We take such reports seriously. I couldn't find any when searching again
Re:Big Fish: Exploiting a 37-Year-Old Kernel Bug in OpenBSD on Saturday October 17, 2026 @09:39AM (#50131087)
Where did you report those coreutils issues?
Re:Improving the integration between terminal and web on Friday February 13, 2026 @02:38PM (#47006805)
How the latest coreutils leveraged terminal hyperlinks to directly link to the full online documentation
Re:GNU Coreutils 9.8 Released with New Features on Tuesday September 23, 2025 @02:51PM (#45351224)
Phoronix didn't link the full NEWS: https://savannah.gnu.org/news/?id=10816

Some extra notes...

Accurate (cgroup aware) nproc is important, as detailed in: https://danluu.com/cgroup-throttling/

The new base58 encoding performs well being around 500 times faster than arbitrary int implementation internal to cpython 3.13 for example

Re:Default musl allocator considered harmful to performance on Monday September 08, 2025 @10:49AM (#45169028)
GNU coreutils can be built as a single binary with ./configure --enable-single-binary. One can install this variant on Fedora for example with the coreutils-single package, and this is used in some container images.
Re:Reservoir Sampling on Thursday May 08, 2025 @03:01PM (#43930022)
FWIW GNU coreutils' shuf uses reservoir sampling for larger inputs to give bounded memory operation
Re:One quantum transition makes light at 21 cm on Thursday April 24, 2025 @12:59PM (#43784938)
42/2
Re:Bash-ini-parser: Advanced bash INI parser library on Friday April 04, 2025 @06:39PM (#43588485)
For similar functionality have a look at crudini, which is a utility designed for interacting with ini files from shell scripts:

https://github.com/pixelb/crudini

Re:Why pipes sometimes get "stuck": buffering on Friday November 29, 2024 @01:57PM (#42276105)
Nice article. See also: https://www.pixelbeat.org/programming/stdio_buffering/

It's also worth mentioning a recent improvement we made (in coreutils 8.28) to the operation of the `tail | grep` example in the article. tail now notices if the pipe goes away, so one could wait for something to appear in a log, like:

    tail -f /log/file | grep -q match
    then_do_something
There are lots of gotchas to pipe handling really. See also: https://www.pixelbeat.org/programming/sigpipe_handling.html
Re:A mental model for Linux file, hard and soft links on Saturday November 23, 2024 @10:09AM (#42221295)
You might find my "symlinks, hardlinks and reflinks explained" article useful: https://www.pixelbeat.org/docs/unix_links.html
Re:Entering text in the terminal is complicated on Friday July 12, 2024 @04:19AM (#40943612)
The vi vs emacs thing permeates a lot of tools. I find it useful to map all tools to be consistent with one or the other. Personally I use vi. Unfortunately setting vi mode for readline has a few caveats, but I was able to work around all of them with the settings in:

https://www.pixelbeat.org/settings/.inputrc

Re:Why is /usr/bin/test 4kiB smaller than /usr/bin/[? on Friday June 28, 2024 @05:35PM (#40825523)
One might be wondering why 'test' and '[' are separate binaries at all. This is to give maximum flexibility wrt copying binaries etc. Note one can build coreutils like busybox as a single binary, by just `./configure --enable-single-binary` at build time. This is already available as an option on Fedora at least through the coreutils-single (1.2MB) package.
Sounds like a case of: https://www.pixelbeat.org/programming/sigpipe_handling.html

uutils uses the coreutils test suite, so it makes sense to add a test case for that, which uutils will eventually get to. I'll do that now.

yes(1) is the standard unix way of generating repeated data. It's good to do this as quickly as possible. I really don't understand why so many get annoyed with this code. 130 lines isn't that complicated in the scheme of things.
Re:Ftfy – fix Unicode that's broken in various ways on Tuesday January 09, 2018 @12:21PM (#16107796)
Nice. This handles the mangled example I discussed at:

http://www.pixelbeat.org/docs/unicode_utils/

Re:How to Print Integers Really Fast on Sunday December 24, 2017 @08:58AM (#15999528)
GNU seq uses this trick:

slow path:

    seq -f '%.1f' inf | pv > /dev/null
     ...[  12MiB/s]
fast path:

    seq inf | pv > /dev/null
     ...[ 491MiB/s]
Re:A Little Story About the `yes` Unix Command on Wednesday October 11, 2017 @10:51PM (#15455334)
The GNU variant was discussed recently at: https://news.ycombinator.com/item?id=14542938

The commit that sped up GNU yes has a summary of the perf measurements: https://github.com/coreutils/coreutils/commit/3521722

yes can be used to generate arbitrary repeated data for testing or whatever, so it is useful to be fast

Re:Parallel processing with Unix tools on Sunday September 24, 2017 @06:04PM (#15326732)
Very good point. I added a whole section to the article, implementing the counting lines example with `make -j`, which performs just as well as `xargs -P`
Re:Diaspora-common: does 'rm -rf /' on purge on Thursday March 23, 2017 @11:32AM (#13940628)
That really is a bash bug IMHO I've discussed this with upstream bash at http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00052....

I've some general notes on SIGPIPE mishandling at http://www.pixelbeat.org/programming/sigpipe_handling.html

Re:Dd is not a disk writing tool (2015) on Sunday January 08, 2017 @11:42AM (#13350536)
Yes this is true. Note BSD supports this better with Ctrl-T to generate SIGINFO, which one can send to any command even if not supported, in which case it's ignored. Using kill on linux, and having that kill processes by default is decidedly more awkward.

It's also worth noting the separate "progress" project which can be used to give the progress of running file based utilities.

We generally have pushed back on adding progress to each of the coreutils for these reasons, but the low overhead of implementation and high overlap with existing options was deemed enough to warrant adding this to dd

Re:Dd is not a disk writing tool (2015) on Sunday January 08, 2017 @06:58AM (#13349360)
Yes "D" is not for disk/drive/device/...

It comes from the DD (data definition) statement of OS/360 JCL, and hence why dd has the unusual option syntax compared to other unix utils

BTW if you are using dd to write usb drives etc. it's useful to bypass the Linux VM as much as possible to avoid systems stalls, especially with slow devices. You can do that with O_DIRECT. Also dd recently got a progress option, so...

    dd bs=2M if=disk.img of=/dev/sda... status=progress iflag=direct oflag=direct
Note dd is a lower level tool, which is why there are some gotchas when using for higher level operations. I've noted a few at:

http://www.pixelbeat.org/docs/coreutils-gotchas.html#dd

Re:ThinkPad X1 Carbon on Saturday December 31, 2016 @08:45AM (#13290978)
This machine isn't available yet :) But since Lenovo is the Red Hat corp laptop vendor, support is generally excellent. I've used Fedora 23+ on the Third gen X1 carbon with zero issues.
Re:Ripgrep – A new command line search tool on Friday September 23, 2016 @12:15PM (#12565692)
Yes ignoring .gitignore contents is a very useful feature. That could be added quite easily to findrepo though would probably have to be an opt as it is often useful to search intermediate build files etc. that aren't checked in. Whereas `git grep` handles the other use case of only searching checked in files.

Interesting info wrt efficient unicode processing for \w and -i.

cheers

Re:Ripgrep – A new command line search tool on Friday September 23, 2016 @11:13AM (#12565198)
Thanks for the detailed comparisons and writeup.

I find this simple wrapper around grep(1) very fast and useful:

http://www.pixelbeat.org/scripts/findrepo

Re:Common shell script mistakes on Monday September 19, 2016 @05:29PM (#12534902)
Note the #status anchor is best removed from the url
Re:What typing ^D does on Unix (2009) on Wednesday September 07, 2016 @05:36AM (#12441910)
Yes some of these useful functions should be bound by default IMHO. Here are my settings to bind ctrl-{left,right} and {up,down} to more useful defaults. I.E. jump as the shell tokenizes the line, and search history for what's already typed respectively
Re:Mosh: the mobile shell on Monday September 05, 2016 @08:15AM (#12429735)
mosh is fantastic for me when working remotely over vpn. I don't have to worry about reconnections, disconnections, packet lag (due to local echo feature). mosh in combination with screen (or tmux) gives scrollback support + other features

Older »