Linux: /usr/bin/rm: Argument list too long


If you’ve ever gone in to a directory, for example a mail or log directory, and wanted to clear it of its contents, but faced an error like this:

/bin/rm: cannot execute [Argument list too long]

We have a solution for you. It’s nice and simple, and easy to remember. Paste and run the command in the relevant directory to have it sniff out files in batches of 200 at a time, delete them, then search again until the directory is empty.

echo * | xargs -n 200 rm

You might also want to recursively delete all sub-directories / sub-folders too, in which case you’d add -rf (recursive, force) on the end, like so:

echo * | xargs -n 200 rm -rf

You can also adapt the command to look for particular extensions or strings, for example:

echo *.txt| xargs -n 200 rm

This will search through all files, list the first 200 files with .txt extension, delete them, and then keep searching until it’s gone through the entire directory removing all files that have the .txt extension on them.

How to Install the latest OpenSSL version from Source on Linux (Debian)

In this tutorial, I will show you step by step how to install the latest stable OpenSSL version from source on Debian servers.

Continue reading “How to Install the latest OpenSSL version from Source on Linux (Debian)”

What’s new in PHP 8

After a lot of to-ing and fro-ing as to when PHP 8 would be released, the developers have now announced that November 26th, 2020 is the date we’re waiting for.

The new version of PHP is expected to come with some new features that offer web developers many additional possibilities.

JIT Compiler, JSON extension always activated, Union Types, Static return type, WeakMap, Use ::class for objects, Stringable interface, Convert DateTime, Type annotations, Type errors…

Continue reading “What’s new in PHP 8”

Fixing postfix and saslauthd: cannot connect to saslauthd

If you are having issues getting postfix email server to authenticate with saslauthd, your solution might be found in a missing symlink. Remember that postifx runs in a chroot environment. Continue reading “Fixing postfix and saslauthd: cannot connect to saslauthd”

PHP list() and Shorthand for Array Destructuring

PHP construct list() or its shorthand can be useful in many cases. It can be very useful to use it with PHP functions that returns arrays. Supun Kavinda have interesting article about.

Continue reading “PHP list() and Shorthand for Array Destructuring”