[HN Gopher] Use Midnight Commander like a pro (2015)
___________________________________________________________________
Use Midnight Commander like a pro (2015)
Author : pangey
Score : 150 points
Date : 2024-01-21 03:43 UTC (19 hours ago)
(HTM) web link (klimer.eu)
(TXT) w3m dump (klimer.eu)
| tra3 wrote:
| I just used mc to transfer some pictures from my Mac to my Linux
| nas for later backup with rclone. I haven't found a better
| paradigm for dealing with files than the two way pane. Also
| enabling lynx like motion makes for really quick navigation.
| cyberax wrote:
| Or you can try FAR Manager. It kept me from switching from
| Windows to Linux for a long time, back in 2000-s.
|
| It's now available on macOS and Linux.
| shmerl wrote:
| Interesting. I don't see Far Manager in Debian repos.
| mmozeiko wrote:
| It is called far2l: https://packages.debian.org/search?keywor
| ds=far2l&searchon=n...
| shmerl wrote:
| Thanks for the pointer!
| oneshtein wrote:
| Double Commander is also good for those, who used to Total
| Commander.
|
| https://doublecommander.com/
|
| https://sourceforge.net/projects/doublecmd/files/latest/down...
| shmerl wrote:
| The nice thing about Midnight Commander is that it has a hex
| viewer and editor.
| oneshtein wrote:
| Moreover, editor allows to switch to console via Ctrl-O, which
| turns it into an simple IDE for console programs: edit code,
| Ctrl-O, run program, Ctrl-C Ctrl-O, repeat.
| amne wrote:
| I always thought the C-o subshell needed a status bar or
| something. Not once did I find myself launching mc again
| because I forgot it was already running. Luckily it warns you
| when launched from the subshell.
| JNRowe wrote:
| mc sets $MC_SID in the subshell, so you can query that in
| your prompt to mark prompts running under mc.
|
| Another option _might_ be to bind F10 to start mc, so that
| it acts as a toggle whether in mc or in a non-mc shell. You
| 'd need to wrap a zle widget in zsh, or add a '$if Bash'
| guard to your inputrc with bash.
| shmerl wrote:
| With neovim it's easy also with:
|
| * Ctrl+Z
|
| * Do something in the shell
|
| * fg
| pangey wrote:
| It also can open/browse archive files without unpacking first.
| hulitu wrote:
| It unpacks them in a temporary directory.
| JNRowe wrote:
| Depends on the archive type and how the vfs/extfs code was
| implemented for it1. It also depends on how the archive is
| treated if it is compressed container, which can be seen by
| looking at how a .tar and .tar.xz are handled for example.
| The zip handler is probably the easiest to understand, as
| it doesn't need to contend with external compression
| wrappers and is a simple perl script. (In some cases it
| would probably be nicer if it did extract the entire
| archive to tmpfs, such as when you independently pull a few
| files from a massive .deb for example)
|
| Implementing your own extfs scripts to wrap a simple menu
| around some task can be really useful, far beyond basic
| archives. I wrote one so that I can shuffle my todo list
| priorities by moving fake "task files" in to different
| pseudo-directories.
|
| 1 https://github.com/MidnightCommander/mc/tree/master/src/v
| fs/
| dang wrote:
| Related:
|
| _Use Midnight Commander like a pro_ -
| https://news.ycombinator.com/item?id=27086555 - May 2021 (1
| comment)
|
| _Use Midnight Commander like a pro_ -
| https://news.ycombinator.com/item?id=9472409 - May 2015 (11
| comments)
| mherrmann wrote:
| Shameless plug for my more modern, GUI alternative to Midnight
| Commander, https://fman.io.
| amne wrote:
| a for effort, but link to the terminal version of it if you
| want to call it an alternative
| mherrmann wrote:
| I rephrased my comment to make it clearer that it's a GUI
| tool, thanks.
| hulitu wrote:
| Minus points: gray on gray, automatic updates, (custom build
| system ?). On mc you can configure colors.
| anthk wrote:
| Well, among emelfm, gnome-commander, krusader, worker...
| usrbinbash wrote:
| Please explain, how is a GUI file manager an alternative to a
| CLI based one?
| oblio wrote:
| They're both orthodox file managers.
| wonger_ wrote:
| I used this for a year and really liked it! The change dir by
| frequency (frecency?) (Ctrl+P and search), the command palette
| (Ctrl+Shift+P and search), and immediate type-to-filter were
| great features. Everything felt pretty smooth and stable. I
| only switched because I started spending more time in the
| terminal, and fman was getting a tad slow on my machine.
|
| It was also my first exposure to a solo developer trying to
| make income with licenses, which at the time felt annoying, but
| now I understand completely. Thanks for making me more
| productive :) such a huge upgrade from the default OS file
| manager.
| msravi wrote:
| vifm is an awesome file manager for anyone familiar with vi. You
| can have single/multiple panes and can do operations on multiple
| files. Renaming/moving/copying multiple files is a breeze. You
| can also run shell commands on selected files using %f %a %d etc.
| Also allows filtering and sorting over a host of columns.
| busfahrer wrote:
| I don't often use a file manager, but when I do, I use ranger.
| It's mostly for use cases like "delete everything in this
| directory but these 3 files" and navigating deep directory
| structures with many files. However, recently I've also begun to
| use a mix of "z" and the "cd" feature/bash-binding of fzf.
|
| I like that ranger allows me to use vim key bindings, which
| matches nicely the rest of my system which is centered around i3
| and vimium.
| penguin_booze wrote:
| Ranger is my daily driver, too. It integreates well with the
| shell as well as Vim usages, as ranger can be used as a
| file/directory picker.
|
| One thing I regret of it, though, is that it's a Python
| application. Had it been a light weight, single-binary,
| application, I could have quickly scp'ed and used it on a
| remote ssh hosts. Likewise, had it been using async/await, it
| could have been snappier on directories with a ton of files.
| janandonly wrote:
| I loved using Total Commander back when I used windows.
|
| There is nothing like this for the macOS as far as I know.
| tomcam wrote:
| Ranger?
| neontomo wrote:
| Give Marta a shot. It gives Total Commander a run for its money
| imo. Free.
|
| https://marta.sh/
| prof-dr-ir wrote:
| I downloaded Marta and it looks and feels absolutely amazing.
|
| But then I noticed that it is not open source, the sole
| developer has been on a break for at least a year, and the
| issue tracker mentions two bugs that may lead to data loss.
|
| So I uninstalled it. I will look elsewhere for now.
| out_of_protocol wrote:
| Total Commander is just too great, never have seen anything
| coming close, maybe except Double Commander. Double Commander
| is the closest clone of TC, with many many features in place,
| but not as smooth and streamlined. Everything else i've tried
| on non-windows platforms is too barebones, including Marta.
|
| Copy from older comment, regarding Total Commander:
|
| powerful mass rename, advanced queue management for file
| operations, intelligent "resume" for larger file copying - it
| checks beginning/end bytes plus ~3 random points inside to to
| be sure you can continue on copying that huge file cut in the
| middle. You can color files/folders by conditions, e.g.
| files/folders created today are red and music files with
| bitrate 128 or lower are gray. Also, lister (built in preview
| on F3) - you can scroll through dozen-GB sized log file in
| seconds. Search is great, you can find duplicate images
| bigger than 512x512 and show them on file panel for any
| processing. And plugings. Lots of plugins. For archive
| formats, for lister, for mass-rename, for file system, for
| additional columns etc
| ihateolives wrote:
| Commander One. https://ftp-
| mac.com/?utm_source=c1app&utm_medium=software&ut...
|
| They advertise as secure ftp solution, but in fact it's a full
| featured dual pane file manager.
| oneshtein wrote:
| Double Commander is what you are looking for:
|
| https://sourceforge.net/projects/doublecmd/files/latest/down...
| SonOfLilit wrote:
| DoubleCommander is really good in terms of TCMD compatibility
| (they run TCMD plugins!) but it's useless on a Mac. It's
| extremely non-native in ways that matter.
|
| Nimble Commander (https://magnumbytes.com/) is almost 1:1 in
| terms of UX and does support the Mac filesystem well. Just be
| sure to press ^3 Tab ^3 ehe first time you open it.
| davikr wrote:
| On Windows, try Altap Salamander. It's free and open-source.
| pangey wrote:
| When I was on Windows, I paid for Total Commander. BTW, Altap
| Salamander is freeware, not open source. It is a decent
| alternative nonetheless.
| davikr wrote:
| It's licensed GPL-2 and on GitHub now.
|
| https://github.com/OpenSalamander/salamander
| ihateolives wrote:
| Does it support unicode in filenames yet? I ditched it for
| FreeCommander for that reason.
| lysp wrote:
| Another option for windows is ZTreeWin (a clone of the old
| XTree Gold).
|
| Fully keyboard based, and has a shortcut (F8) that goes into
| split screen mode if you need.
| HackerThemAll wrote:
| There's the free & open source clone of Total Commander -
| Double Commander. It's compatible with TC extensions, and just
| like TC also written in FreePascal.
| gattr wrote:
| And Unreal Commander (freeware), also compatible with TC
| plugins. I'm usually on Fedora, I use Krusader there.
| pangey wrote:
| If you prefer to watch video, I recommend this -
| https://www.youtube.com/watch?v=fJOkuaihAek
| jmlucjav wrote:
| there is a newcomer into the terminal file managers arena that
| looks like it's going to be what I was looking for
| https://github.com/sxyazi/yazi (sort of ranger/vifm written in
| rust, lots of momentum)
| christophilus wrote:
| Hm. That sixel support does look really nice. It's something I
| miss with vifm.
| csdvrx wrote:
| I had a project of baking in sixel support into nnn, but got
| too busy with other things :(
| clemensnk wrote:
| I've been using Marta on the Mac (https://marta.sh) and I really
| enjoy having a dual-pane file manager with an integrated terminal
| where navigating the folder hierarchy is synchronised in both
| directions.
|
| Marta doesn't seem to be actively developed anymore, so if anyone
| know of a good alternative I am all ears. fman (https:/fman.io)
| looks nice, but I don't think it has terminal integration.
| hahamaster wrote:
| You can install Midnight Commander on a Mac as well.
| pax wrote:
| It's not actively developed, but not abandoned either, if you
| judge by the closing of issues in the dedicated repository.
| It's also my file manager of choice (minimalist UI but
| reasonably featured).
| CTOSian wrote:
| some other shortcut: ALT+. -> hide/unhide dot files/directories
|
| other dualpane -way faster file operations eg like copy/move than
| mc- is the Worker
| http://www.boomerangsworld.de/cms/worker/index.html (Amiga
| `directory opus` look like)
| HackerThemAll wrote:
| Worker, being a graphical tool, is unusable over a SSH
| connection or where only a text terminal is available.
| jrm4 wrote:
| Yeah, this is the sort of thing that makes one wonder why we
| haven't been able to settle on a good "mostly text, but maybe
| a _little bit of graphics when necessary_ kind of a standard.
| "
|
| Like some kind of sixel + html thing or something.
| tangus wrote:
| It's usable over a SSH connection with X forwarding tho. It
| all depends on the quality of your connection.
| bakoo wrote:
| Directory Opus was great back in the day, remember the joy of
| binding a ton of scripts and cli and gui apps to various
| buttons.
| pantulis wrote:
| Some colleagues believed I was some kind of Unix demigod when
| they were working with SunOS ksh command line and I had my own
| copy of mc (probably downloaded from Solaris Freeware site or
| something like that).
|
| There's one powerful thing that mc does and almost any other dual
| file manager omits: it has the concept of "pop up menus" for
| commonly used commands --with the option of sending the selected
| file(s). Also, these menus can be global or _local_ , configured
| for each specific folder or in my case working copies of some
| proprietary version control repositories (Subversion was too cool
| then).
|
| Not only viewing files with F3 instead of using 'more' made you
| go significantly faster when there was no IDE to quickly grok a
| codebase, in ancient times where version control and diffing and
| merging was not exactly like today this was extremely powerful,
| only surpassed by Emacs.
|
| Edit: to add that in macOS Forklift has something like this in a
| specific "Tools" section.
| anthk wrote:
| mc was uber-fast on reading docs from /usr/share/docs, often in
| .gz format.
| TacticalCoder wrote:
| > There's one powerful thing that mc does and almost any other
| dual file manager omits: it has the concept of "pop up menus"
| for commonly used commands
|
| I never really used mc because once I switched to Linux I
| became an Emacs user but... I have fond memories of Norton
| Commander on my 386 PC (running DOS, before Windows 95 became a
| thing). I think Norton Commander was first and mc was a clone
| of Norton Commander (even copying the color scheme). And Norton
| Commander, IIRC, already had these "popup menus" (but my memory
| may be playing me tricks).
| red_admiral wrote:
| Yes, to the point that `mc` is wordplay on `nc`.
| Sakos wrote:
| I've experimented a lot with making my own CLI programs to
| change how I interact with the terminal, for example wrapping
| things like cp and mv in a stateful way. I feel like I'd
| reached some form of enlightenment when I was able to do
|
| > cp file
|
| > z folder (which is deeply nested somewhere else)
|
| > paste
|
| instead of having to type everything out.
|
| It feels to me like the possibilities of the CLI and how we
| interact with it have barely been explored.
| jackthetab wrote:
| Code? Detailed explanation of possibilities?
| butz wrote:
| For users prefering GUI applications, I would like to suggest
| Sunflower FM, a GTK3 based dual-pane file manager:
| https://sunflower-fm.org/ As usual with such applications it
| seems to be a bit on hiatus, but maybe some developers would be
| interested to lend a hand?
| mariusor wrote:
| Also double commander is pretty good, I remember it having both
| Qt and GTK interfaces. Also it's almost a one to one clone of
| Total Commander, the greatest orthodox file manager in
| existence.
| usrbinbash wrote:
| And for users of GUIs who are (understandably) fed up with
| GNOME and all the GTK Stuff, I can wholeheartedly recommend
| Dolphin, KDEs standard filebrowser.
|
| Which isn't on Hiatus, doesn't require GTK, and has switchable
| Split views (aka. dual-pane), and tabs (where each tab may have
| its own split view).
| anthk wrote:
| Krusader is made for that.
| keep320909 wrote:
| Dolphin isa a bit useless for serious operations. It uses KIO
| for file operations (copy, move...), that invokes separate
| API call for every file, and is very slow and unreliable for
| large number of files.
|
| Other file managers (Thunar in XFCE) do not have this
| problem.
| usrbinbash wrote:
| GUI file managers are usually used for things where speed
| is a non-issue. For anything else, Right-Click "Open
| Terminal Here".
| lelanthran wrote:
| I used Dolphin for a short while, but it's a bit slow and
| unreliable with large copying.
|
| Went back to caja.
| klez wrote:
| Last commit on github[0] seems to be from 2 days ago. And the
| previous one from last april. I'd say that the home page is on
| hiatus, not the project.
|
| [0] https://github.com/MeanEYE/Sunflower
| yashrk wrote:
| All GUI OFM-s I've seen missed the main (IMO) feature of
| Midnight Commander: seamless integration with the plain shell.
| In MC I can select files with Ins/*, then run command with %t
| macro to process selected files, then press Ctrl+o and look to
| the shell output, then maybe run some other shell commands in
| the full-screen mode, then press Ctrl+o again and return to the
| dual-panel mode. Moreover, I can edit shell script with the
| embedded editor (F4), then press Ctrl+o, run the script, read
| the output, press Ctrl+o and edit the script if needed.
| Fatnino wrote:
| My dad used to use Norton commander all the time on DOS.
|
| When I introduced him to midnight commander he was very happy to
| have basically the same thing but on linux.
| lencastre wrote:
| It's just frustrating to use autocomplete on the $ shell, it's so
| ubiquitous to to use Tab to autocomplete that within mc it
| switches panes. I cannot discover how to "Esc Tab", because
| pressing Esc then Tab does not autocomplete, pressing and holding
| Esc then Tab, also doesn't autocomplete, other than that it's the
| good'ol souped up norton commander.
| oneshtein wrote:
| In mc, Alt-Tab or Esc+Tab two times does autocomplete for
| command name, but it's much easier just to press Ctrl-O and use
| shell in full screen, with native autocompletion by Tab, then
| switch back to mc by Ctrl-C + Ctrl-O. (Without Ctrl-C, mc may
| not be able to synchronize directories between shell and panel,
| which often leads to confusion).
| glimshe wrote:
| No file manager has ever approached the productivity I had when
| using XTree Gold for DOS... ZTree is a modern, but commercial
| version.
| Lutzb wrote:
| My first DOS PC had XTG pre-installed (courtesy of my cousin).
| I was so fast using XTG, will check out ZTree now.
| jrm4 wrote:
| As something of an old-timer here, there's some amusement, but
| mostly appreciation that people are discovering that these very
| old ways of doing things have a lot of potential (and a lot of
| untapped ideas)
|
| Somewhat relatedly, recently I discovered the colorfully named
| fff. It's a solid file manager, but what I've used it for is a
| terminal based filespace navigator (by adding a function that
| just leaves you in the place you navigated to).
|
| It's funny how it's hard to break the habit of "cd" to move
| around, despite this being way faster, especially if you're not
| sure where you're going.
|
| https://github.com/dylanaraps/fff
| overbytecode wrote:
| I find NNN and Ranger a lot more ergonomic as a UX, but MC's
| virtual file system is so good, the ability browse folders
| seamlessly whether local, remote, zip, tar, jar in the same
| interface etc is really useful.
| SonOfLilit wrote:
| I recently had to use Windows a bit and went back to Total
| Commander after years on a mac.
|
| It felt amazing. "At last, my arm is complete again" level. I
| can't believe you could miss a file manager so much. It's one of
| the greatest tools you can't explain the usage of, you bust have
| to use it for a week.
|
| Then I discovered that since I last checked a passable Mac clone
| has appeared. Nimble Commander (https://magnumbytes.com/) is
| almost 1:1 in terms of UX and does support the Mac filesystem
| well. Just be sure to press ^3 Tab ^3 the first time you open it.
| jasperry wrote:
| Honest question about two-pane file managers: I understand that
| dual-pane is useful when you need to see the contents of two
| folders for copying and syncing multiple files. But for me, that
| seems like a minority part of my usage. More commonly, I have
| multiple tabs for different projects, and within those tabs,
| navigation is mostly up and down the folder hierarchy within each
| project. Opening the source and destination folders in the panes
| every time I want to copy seems like more work than just copy,
| navigate, and paste.
|
| Can anyone enlighten me about this? Is it just my poor
| organizational skills?
| sandworm101 wrote:
| If you are moving many or large files, the two-pane mode allows
| you to see the state of the move in real time. You can also see
| name conflicts more easily rather than wait for a popup. Sure,
| you could open up two tabs or two windows, but that is more
| cumbersome than a single window for the task.
| jasperry wrote:
| I agree with that. I guess my question is: do you always use
| two panes to copy? And does your file manager have something
| like tabs for different contexts where you would not
| necessarily be moving files between them?
| sandworm101 wrote:
| Moving a few files, no. But a professional move, say
| something that is going to take more than 30 minutes due to
| speed/size issues, yes i would use a two-pane tool. Another
| case would be if the destination had a dynamic ammount of
| free space, such as to a running server. I would use two
| panes so i could abort before filling the destination.
| pcbouman wrote:
| When you hit F5 (copy) or F6 (move) you typically get a
| dialog with the destination of the action where the other
| pane is pre-entered as a default so can just hit Return to
| start, but which you can also override by typing something
| before hitting Return. You can type whatever relative or
| absolute destination you want without having to navigate
| there explicitly in the other pane. For up/down one
| directory I personally type .. or the child-directory, if
| the destination is further away it is often more convenient
| to navigate there in the other pane.
| woobar wrote:
| When I don't need to copy files even when navigating in a
| single panel (and just ignoring content of the second one)
| still have advantages.
|
| - I get a free _ls_ when I navigate directory structure, and
| with the keyboard shortcuts I can move much faster.
|
| - If the panel is ordered by time the moment I open the folder
| I see most recent files (in some cases I only care about recent
| files when opening a folder). If ordered by size you see your
| biggest files first, etc. And all of this is stateful, you
| don't need to run a command to identify biggest/latest file, do
| something with it and then go back to check what as the second
| biggest/latest file.
|
| - it is easier to check content of the file or an archive
|
| - two panels also work seamlessly with ssh/ftp/archives/etc.
| You don't need to remember separate commands to copy files from
| other sources, you will use exactly same pattern for navigating
| and copying files.
|
| I also understand that people who mastered shell don't see this
| as a big advantage. But it really helps when jumping between
| mac/nix/windows.
| JNRowe wrote:
| Well, you don't have to use the two pane mode if you don't want
| anyway. You can switch to single pane mode, use the second pane
| for file info, use the second pane as a directory tree in the
| manner of a "regular" single pane explorer, etc.
|
| To perform your "copy, navigate, paste" task while in mc's
| single pane mode you could either:
|
| a) tag files, pop open the second pane temporarily, navigate
| and copy.
|
| b) tag files, swap the panes in the background, navigate and
| copy.
|
| c) tag files, use the bindings to copy them to the inbuilt
| command line, navigate and copy. Using the "quick cd" dialog
| would probably speed this up.
|
| d) any of the above with inverted target and source movement.
|
| e) probably a thousand other more sensible ways than the three
| or cheat-y six I just thought of ;)
| BeetleB wrote:
| Nice to see this. There is a more visual guide here:
|
| https://blog.nawaz.org/posts/2012/Dec/a-guide-to-midnight-co...
|
| (The guide is a PDF link on that page).
| Brian_K_White wrote:
| I always felt sort of embarassed that I use mc 24/7 for
| everything. I live in it. It might as well be my login shell. I
| even use mcedit for about 80% of text editing outside of geany or
| codeblocks.
|
| I don't have any actual reason to be embarassed, since I'm
| actually perfectly comfortable in vi and and the command line on
| some old sco box without mc available, it's got to be just
| because I started among guys who themselves were even older unix
| guys who never touched anything like mc. Also it felt kind of
| like still using training wheels when I had been using xtree on
| dos before encountering unix. But hell I started on xenix myself
| and still miss some features from ksh93 vs the latest bash5. I
| haven't needed to live up to anyone else since forever.
|
| But embarrassed or not, I used it all day every day since the
| late 90's at work and home. It just makes the most sense to be
| using essentially a browser for that.
|
| For one thing I simply see more stuff.
|
| In the past, every day at work I'd see random junk left all over
| the place by other employees who clearly didn't even know that
| they had created these junk files and directories all over the
| place from having flubbed the syntax of command lines, or botched
| quoting or escaping inside programs they were writing. Files with
| names that looked like various other bits of command syntax from
| quoting mistakes etc. And still sitting there because if you
| don't actively ls, then you don't see it. I was constantly
| cleaning up stuff like that back before we finally went to
| individual developer vms.
| wkat4242 wrote:
| Don't feel bad. It's a much better way of poking around than
| typing ls, cd etc.
|
| Also, a common usecase for me is having a folder full of files
| dumped together and I want to move some of them according to
| arbitrary criteria. Marking them with Insert in MC is so so
| much less work than typing everything.
|
| Being good at something is also using the right tool for the
| job. CLIs shine at some things. TUIs and GUIs at others.
| They're complementary. It's not like one is better than the
| other.
| who-shot-jr wrote:
| Take a look at broot https://github.com/Canop/broot
___________________________________________________________________
(page generated 2024-01-21 23:02 UTC)