Moving files around

At some point you will want to reorganize the many files and folders you have in your Jupyter Hub.

If you like Unix, you can always open a new terminal and move files around using the "mv" or "cp" commands.

If you want to avoid Unix, you can use the Hub's naming system to move files around.

Select a file in the Hub by clicking on the square box at the left of the file's name. You are then given the option to "rename" the file. Click on the rename button, and then enter one of the following:

  • newname -- to give the file the new name
  • ../oldname -- to move the file up and out of the current folder, into the previous forlder
  • foldername/oldname -- to move the file into the folder called "foldername." This folder should already exist (because you created it earlier with a "new folder" command).

These renaming methods also work to move folders and their contents.

To move across several branches in the directory tree, you need to know the full path name of your files and where they are to go. This means you need to find out the name of your root tree structure. A fast way to do this is to use the magic command %cd in a notebook.

Open a notebook, click on an empty cell, and type %cd, hit shift-return. It will return the director root name. Typically something like /home/username or /home/usernumber.

You can now use this to move a file into any folder. Just rename the file something like /home/username/folderA/filename. (the folderA better exist already, for you to move something into this.)

See the next section on Unix magic for more tips on moving files.

results matching ""

    No results matching ""