title: Use a select menu to navigate directories
body: <p>I am using <code>Ubuntu server</code> and I want to create <code>BASH</code> script that would help me to navigate through directories at ease. </p>
  
  <p>I found this piece of code and I am using:</p>
  
  <pre><code>#!/bin/bash
  cd ~/ftp/server/googledrive
  
  prompt="Please select a file:"
  options=( $(ls -1) )
  
  PS3="$prompt "
  select opt in "${options[@]}" "Quit" ; do
      if (( REPLY == 1 + ${#options[@]} )) ; then
          exit
  
      elif (( REPLY &gt; 0 &amp;&amp; REPLY &lt;= ${#options[@]} )) ; then
          echo  "You picked $opt which is file $REPLY"
          break
  
      else
          echo "Invalid option. Try another one."
      fi
  done
  </code></pre>
  
  <p>However it only lists the directories, each of them having a corresponding number. Is it possible to make it in such a way that I can actually navigate through my directories?</p>
  
  <p><strong>EDIT:</strong> Thank you the comments. I should have done this when I created the post. </p>
  
  <p>By "actual navigation" I mean this: the main goal was being able to select a .zip archive and unzip it in a specific folder, thus the navigation part. So you would have to navigate from Directory A to B and then to C. Starting from the first directory you would have all the directories listed and each of them having an unique number, by selecting a number you would then navigate to that specific directory. This would repeat until you would find the directory you need and then select an option like "Unzip here".</p>