

While it may not help you get the formatted output you're looking for, The Art of UNIX Programming is a good read, and where I found sources for those quotes. Write programs to handle text streams, because that is a universal interface.

Write programs that do one thing and do it well. You don't usually see *NIX console programs providing a user interface as much as data to be piped into another program, or possibly a script utilizing shell commands like cut to create their own specifically tailored outputs.ĭoug McIlroy summarized his earlier statement years later: This is particularly evident in programs that output text, like lsof. Don't clutter output with extraneous information. Expect the output of every program to become the input to another, as yet unknown, program.To do a new job, build afresh rather than complicate old programs by adding new features. Your search for something that shows both network and file statistics - which would be provided by two different parts of the operating system - seems to be up against some tenants of 'The UNIX Philosophy:' On Ubuntu 20.04 and most of the latest Ubuntu releases, the htop. You can also launch the terminal in a quick way by using keyboard shortcut Ctrl + Alt + t. With some clever shell scripting, piped data, and a bit of manual formatting, you could get at least close to the output you're looking for. For this purpose, click on the Activities and search for the terminal in the application search bar and hit ‘Enter’.

What you're trying to accomplish is possible combining multiple commands as you're currently doing, though I don't know of other apps that would provide you data easier to parse (ed: another answer suggested iftop which I did not know added a pipe-able single line text output mode). If you only use 3GB today, you just wasted 1GB.As far as I know, no. It's not like if you use only 3GB today you can use 5GB tomorrow. The OS tries to keep as little memory free as possible, only enough to handle special situations such as bursts of data received from the network. Only memory that is being used can improve performance. The reason so much memory is used is because free memory is wasted memory. Should this be considered free memory or not? But if that memory is needed for some other purpose, the file data can be thrown away since it's on the disk. If the program runs again, however, the information can be used from memory so it doesn't have to be loaded from disk again.

The executable file that holds the program itself is still in memory. But it's free in the sense that the information can simply be discarded if the memory is needed.įor example, say you run a program. The memory is used in the sense that it contains information that may be useful. It's just the difference of whether you consider memory that contains discardable data as used or not.
