If I want to move a folder or file at some relative location, in Linux I use for example:

mv ../../<CTRL-d>

And that gives me a listing of files/folders at ../../ so I can quickly (using the TAB command as well) continue to build mv command path.

How do I emulate this same capability in Mac terminal?

I tried configuring stty eol, but that did not work.

I know I can first use ls to build the path, but I am looking for CTRL-d equivalent

  • What shells are you using? as that expansion depends on the shell
    – mmmmmm
    Commented Sep 9, 2019 at 18:37
  • I am using /bin/bash
    – R Blais
    Commented Sep 9, 2019 at 19:45
  • See jksoegaard;s answer In bash CTRL-d exits the shell. So we think you are not using bash on Linux? What shell are yoiu using in bith OSes?
    – mmmmmm
    Commented Sep 9, 2019 at 20:47

1 Answer 1


This actually works the same way on Linux as on macOS. You're simply using a different shell on Linux than you're using on macOS, and that's why it appears to be different for you.

Instead of using bash, which you're running right now on macOS, you should instead start up tcsh. This will give you the behaviour, you're looking for (i.e. ctrl-d for file expansion).

You can simply start Terminal.app and run:


to test it out.

If you like it, you can open Terminal.app Settings in the General tab, and set the shell to open with to: /bin/tcsh

  • That answers my question - thank you! I am happy using tcsh.
    – R Blais
    Commented Sep 9, 2019 at 20:52
  • @RBlais Perfect! - If your question was answered, please mark the answer as accepted!
    – jksoegaard
    Commented Sep 9, 2019 at 20:56
  • Got it! I thought I did, but I was moving the vote number (and system would not let me). A few newbie things out of the way...
    – R Blais
    Commented Sep 9, 2019 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .