Score:0

Bash command based file manager

kn flag

Is there a way I could run 'ls' command, and be able to navigate through the results using the arrow keys, and selecting with spacebar, possibly going back by pushing escape?

Is it something that can be done using only bash commands?

I'm trying to create a simple bash command based operating system, so I guess this would be selectable from a menu

Artur Meinild avatar
vn flag
Why does it have to be "Bash-based" - what's your rationale? There are many good CLI file managers, like Midnight Commander and Ranger, but those are either made in C or Python. Bash scripting is not designed to do everything - it's a shell with scripting capabilities.
Gilles Quenot avatar
tn flag
Advice to newcomers: If an answer solves your problem, please accept it by clicking the large check mark (✓) next to it and optionally also up-vote it (up-voting requires at least 15 reputation points). If you found other answers helpful, please up-vote them. Accepting and up-voting helps future readers.
Raffa avatar
jp flag
@824NZ We are happy that you finally decided to join us … This community is powered by volunteers like you so the more the merrier :-) … Questions here, however, are expected to be focused and concise with context directly targeted at explaining the question … Therefore, I think if you remove the very last paragraph, that would make **a perfect** question … Welcome again to AskUbuntu
Score:2
tn flag

You can try mc aka Midnight Commander:

$ LANG=C apt-cache show mc
Package: mc
Section: universe/utils
Origin: Ubuntu
[...]

Homepage: https://www.midnight-commander.org
Description-en: Midnight Commander - a powerful file manager
 GNU Midnight Commander is a text-mode full-screen file manager. It
 uses a two panel interface and a subshell for command execution. It
 includes an internal editor with syntax highlighting and an internal
 viewer with support for binary files. Also included is Virtual
 Filesystem (VFS), that allows files on remote systems (e.g. FTP, SSH
 servers) and files inside archives to be manipulated like real files.

mc

cn flag
1st emotion that comes up: nostalgia
Score:2
jp flag

Is there a way I could run 'ls' command, and be able to navigate through the results using the arrow keys, and selecting with spacebar, possibly going back by pushing escape?

Is it something that can be done using only bash commands?

Sure, fff (Fucking Fast File-Manager) is what you need to look into ... It's not just a working console file-manager written entirely in bash but it is also a great learning resource as the author(thankfully) provides an extensively commented source code ... The main source file fff itself is a bash script that cab be simply run by e.g.:

bash fff
Score:0
tn flag

You can try ncdu.

It's purpose is to browse files/dirs, show where dirs takes the most space, then you can delete files or other options, like open a shell.

You can change the way files are sorted. By size, alphabetically...

ncdu

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.