Mapping Remote Folders from the Command Line

Steve Ellwood
1 min readJul 16, 2020

--

Every now and again when I am using the command line I want to temporarily access a remote folder. For Windows users this can easily be done using net use but sometimes I am using my Mac or I may be in a Linux terminal.

Linux/Mac

In a Mac or Linux terminal the commands you need are popd and pushd.

~$ pushd /var/www

pushd will create the mapping and popd will remove it.

In fact there are more options for these commands. pushd actually pushes the mapping to the top of a stack of a directory stack and you can move around this stack using various command line switches. Similarly for popd.

Windows

Windows users can also use popd and pushd, personally this is my preference as I don’t need to remember differing commands. However Windows users also have net use

net use \\Server\Share

Again there are various command line switches e.g. to make the mapping persistent.

--

--

Steve Ellwood
Steve Ellwood

Written by Steve Ellwood

Senior Integrations Officer at Doncaster Council Any views expressed are entirely my own.

No responses yet