Does anybody have a source code for the MORE filter used on Linux, because I am curious as to how it works.

Dani AI

Generated

For a small, studyable implementation start by identifying which more binary your system actually uses. As and pointed out, most distributions ship more as a packaged program — the fastest, reliable route is to find the package that provides /bin/more and then fetch that package's source.

Common, distro-agnostic steps:

which more
# Debian/Ubuntu:
dpkg -S $(which more)
# RPM systems:
rpm -qf $(which more)

Once you know the package name, fetch the source with your distro tools (enable deb-src on Debian/Ubuntu first). Examples:

apt-get source <package-name>     # Debian/Ubuntu
dnf download --source <package>   # Fedora (install dnf-plugins-core)
yumdownloader --source <package>  # older CentOS/RHEL (install yum-utils)

If you just want readable reference code, a few canonical places to read implementations and the expected behavior are useful. The POSIX description of more documents the user-visible behavior and options (POSIX more spec). A compact, easy-to-read implementation is available in the FreeBSD source tree (), which is helpful for learning how pagers use terminal ioctls/terminfo, detect window size, buffer input, and handle files vs pipes.

Notes and cautions: implementations differ — some are simple forward-only pagers, others support back-scroll by buffering the whole file. Check the package license before reuse. For a more fully featured pager to study as an alternative, see less (more features, widely used).

Recommended Answers

All 2 Replies

the entire source for the fedora core 3 distro is available. Im sure its in there.
(even though is linux im certain it will do)

fedora is available from a million mirror sites.
google fedora download

just make sure the one you download is for your architecture.. x86 (64 bit) or
x386 the "older" pc systems

and the same goes for all other linux and most bsd distros.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.