code: def do_cd(self, arg):
          
          from os import chdir, path
          fullpath = path.abspath(path.expanduser(arg))
          if path.isdir(fullpath):
              chdir(fullpath)
          else:
              msg.err("'{}' is not a valid directory.".format(arg))
docs: Imitates the bash shell 'cd' command.