What are the minimum number of programs that someone can use to edit files with the Linux kernel?

I mean reading a file from some storage device, changing it, and storing it. Maybe by specifying the address on the storage device to save the file (if that will reduce the number of programs used).

EDIT: just to clarify. I am asking mainly for a list of programs (and their dependencies if there are) that are needed to just edit text files nothing else.

closed as unclear what you're asking by G-Man, Stephen Rauch, Jeff Schaller, sebasth, muru Oct 28 '17 at 0:17

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Would you include commands like ls that allow you to see what files you're dealing with? Or bash to give you a shell to work in? – glenn jackman Oct 27 '17 at 20:31
  • Actually, no. Is there an alternative to bash for editing files? @glennjackman – Ahmed Elsawy Oct 27 '17 at 20:33
  • 2
    take a look at busybox, it's the goto solution for most of embedded linux distributions with limited storage and memory – Dalvenjia Oct 27 '17 at 20:36
  • 3
    This sounds like an XY problem. Please tell us in more general terms what you're trying to do. – glenn jackman Oct 27 '17 at 20:38
  • 1
    One could argue that minimum is kernel itself, and edit files via syscalls, modules, etc, but that's redundant and not practical. And really depends on the extent ro which you want to edit files, whether or not you need to move file, use regex, etc. – Sergiy Kolodyazhnyy Oct 27 '17 at 23:56

The minimum number of programs is one: a text-based text editor. If you don't want user accounts, networking, a graphical user interface, backups, the ability to upgrade the editor, or the generally ability to do anything but edit files, then you can boot the Linux kernel with an argument like init=/bin/nano, and have absolutely nothing else on the system — just the nano executable, the libraries it depends on, and whatever files you've been typing.

This is not a very useful operating system, but it meets your requirements. A general-purpose operating system has a lot more functionality, which requires a lot more programs.

See also What are the minimum root filesystem applications that are required to fully boot linux?

Not the answer you're looking for? Browse other questions tagged or ask your own question.