Want to see all files a package puts on a system? rpm -ql nano shows every installed file—binaries, docs, man pages—so you can map exactly what the nano package touches. Other rpm options only highlight subsets, like docs with -qd or just the package name with -qa.

Multiple Choice

Which command lists all files installed as part of the nano package?

To see every file that a package placed on the system, you need to query the package and list its files. In rpm, the -q option means query, and the -l option means list the files installed by a package. So the command to show all files installed as part of the nano package is rpm -ql nano. It will print paths like the executable in /usr/bin/nano and related files such as documentation and man pages. Other rpm options don’t give the full package contents: -qd would show only documentation files, not the entire file set; -qa with a pattern might locate the package name but won’t list all of its files; -qf /path/to/file tells you which package owns a specific file, not the complete listing of that package’s files.

If you’re working with Red Hat-based systems, you’ll soon realize there are two sides to every package: what’s installed on the machine and what’s contained inside the package itself. When you’re curious about exactly which files a given package brought onto the system, there’s a simple, reliable tool for the job: RPM. And not just any RPM query, but the one that shows the full footprint of a package—the complete list of files it placed on the filesystem.

A practical question often pops up: how do you see every file that a package installed? The short answer is: rpm -ql [package-name]. For nano, that exact command is rpm -ql nano. Let me unpack what that means and why it’s so handy, plus a few nearby options that help you navigate the file landscape on a Linux box without getting your wires crossed.

What does rpm -ql do, exactly?

  • rpm as a tool: If you’ve ever peered into the world of Red Hat, Fedora, or CentOS, you’ve met RPM (RPM Package Manager). It’s the backbone of how software is installed, updated, and managed on these systems.

  • The -q flag means query: You’re asking RPM to report information about something—whether a package, a file, or a script.

  • The -l flag means list files: This option doesn’t just tell you the package name or version; it enumerates every path that the package placed on the system. Think of it as the package’s directory map—the road it took to plant itself on your disk.

So rpm -ql nano prints lines like:

/bin/nano

/usr/share/man/man1/nano.1.gz

/usr/share/doc/nano/CHANGELOG

/usr/share/doc/nano/README

…and so on. It’s a straightforward inventory, useful when you’re cleaning up, auditing, or simply learning how a piece of software is structured on the machine.

Why not the other options?

The temptation to use slightly different switches is real, especially when you’re juggling multiple tasks in a busy environment. Here’s a quick map of why the other options don’t give you the full picture in this scenario:

  • rpm -qd nano: This one teases out documentation-related files only. It’s great if you’re chasing user manuals or help docs, but it won’t show you the entire file set the package placed on the system. If you’re curious about what a package includes beyond docs, this is the quick detour you’ll regret later.

  • rpm -qa nano: This looks like a search for a package named nano among all installed packages. In practice, -q with -a asks “what installed packages match this query?” It won’t list files at all. It’s more about identifying whether nano is present and which version, not about its contents.

  • rpm -qf /usr/bin/nano: This is a different kind of query. It asks which package owns a particular file. It’s incredibly handy for tracing file ownership when you stumble on an unfamiliar path, but it stops at “which package owns this file?” It won’t give you the package’s entire file listing, which is what you want when you’re auditing the whole package footprint.

Real-world reasons to list all files

  • Auditing and cleanup: If you’re removing a package or diagnosing clutter, knowing every file helps you decide what else might be tied to it or what can be safely purged.

  • Troubleshooting: Sometimes a missing shared library or a docs file being in the wrong place triggers a problem. Seeing the full file map helps you spot anomalies, misplaced docs, or conflicting versions.

  • System hardening: You might be checking for files that shouldn’t be present or verifying that sensitive paths aren’t unexpectedly populated by a package.

A few practical tips to make RPM work for you

  • Ensure you’re querying the right package name: On some systems, a package may install under a specific name but be known by a different one in the RPM database. If your first attempt returns nothing, double-check the package name, or use rpm -qa | grep nano to confirm the exact name as registered in RPM.

  • Combine with other commands for a fuller picture: If you want to quickly compare what a package installed versus what’s currently on your system, you can script a small comparison. For example, you could run rpm -ql nano > /tmp/nano-files.txt and then use diff against a snapshot from another system or a previous state.

  • Use the -p option when you have a local package file: If you’ve got an RPM package file in hand (say nano-5.8-1.x86_64.rpm) and you want to know what it would install, rpm -qlp nano-5.8-1.x86_64.rpm shows the file list without actually installing it. Helpful for planning before deployment.

A quick side note on the broader RPM ecosystem

Beyond listing files, RPM’s query capabilities are fairly rich. There are flags to inspect file metadata, dependencies, and even scriptlets (the small chunks of code that run at install or removal time). But for many day-to-day tasks, the -ql switch is the most practical, immediately rewarding way to see the physical footprint of a package.

  • If you want to know what a package requires or provides in terms of dependencies, you can use rpm -qR nano (the R stands for requires).

  • If you’re troubleshooting ownership, rpm -qf /path/to/file answers which package placed a specific file on the system.

  • If you’re curious about the exact version and release details, rpm -qi nano gives you a nice human-readable package description, including version, release, architecture, and more.

Connecting the dots: from curiosity to clarity

Let’s bring it back to a simple scenario you’ll encounter in the real world. You’re studying a Linux server, and you type rpm -ql nano. The terminal spits out a tidy list of paths. Each line is a breadcrumb trail—the binary path, documentation, man pages, and perhaps a completion script or config sample. It’s not just data; it’s a map of how the software integrates with the system.

If you’re the kind of person who likes to see the story behind the numbers, you might follow one of these breadcrumbs. Open the corresponding man page under /usr/share/man/man1 and skim the usage notes. Peek into /usr/share/doc/nano or /usr/share/doc/nano/ to glimpse change logs or licensing details. It’s like poking under the hood of a car and spotting not just the engine, but the oil filter, the air intake, and those small-but-tell-tale screws.

A friendly nudge toward best practices

  • Stay curious, not overwhelmed: RPM’s file listing is a powerful tool, but you don’t need to memorize every option. Know the core commands—rpm -ql for a full file list, rpm -qR for dependencies, rpm -qi for package info—and you’ll handle most situations with confidence.

  • Build a habit of minimal, repeatable checks: When you’re auditing a server, run a quick rpm -ql [package] and capture the output into a log file. It creates a clean trace you can revisit or share with teammates if questions arise.

  • Embrace context with caution: A file listing doesn’t tell you everything about a package’s behavior, but it does tell you where things live. If something looks off—say, permissions on a config file or an unexpected doc directory—you have a concrete lead to investigate.

The bottom line

If you want to see every file that a package placed on your system, rpm -ql [package-name] is the straightforward, reliable choice. For the nano package, rpm -ql nano reveals the executable path, documentation, man pages, and all the other files that came along for the ride. The other options—-qd, -qa, or -qf—serve different purposes and won’t provide the complete footprint in one fell swoop.

In the end, it’s a small command with a big payoff. It turns a potentially murky installation story into a clear, navigable map. And when you’re managing systems day to day, that kind of clarity matters more than you might think. After all, understanding what’s on the box is the first step toward making the box work better for you.