'Place the current dir on stack and change directory.
Usage:\
%pushd [\'dirname\']'

@line_magic
def pushd(self, parameter_s=''):

    dir_s = self.shell.dir_stack
    tgt = os.path.expanduser(parameter_s)
    cwd = os.getcwd().replace(self.shell.home_dir, '~')
    if tgt:
        self.cd(parameter_s)
    dir_s.insert(0, cwd)
    return self.shell.magic('dirs')
