Skip to main content

Questions tagged [pushd]

0 votes
0 answers
72 views

I'm working on a modification of this approach to automatically saving and restoring bash's directory stack state when using pushd and popd. For some reason, my code to restore the saved state isn't ...
Dan Drake's user avatar
  • 151
1 vote
1 answer
57 views

I'm pushing directories to my stack using a while loop that reads the contents of a file. I've tried two approaches that should be equivalent, but they behave different. Approach 1 export ...
Jorge Ricardo Alonso Fernández's user avatar
2 votes
3 answers
550 views

I have a script which I source while in bash. It does various things and retains the $PWD I was in before sourcing it. pushd ~/.dotfiles >/dev/null || exit 1 # Do various things popd >/dev/...
paradroid's user avatar
  • 1,275
0 votes
1 answer
112 views

I have a file named filename.sh in different directories. I am trying to simultaneously submit this file to run on a number of cluster nodes. I need to find this file wherever they may be, cd into ...
Daniel Ajuzie's user avatar
2 votes
2 answers
424 views

I want to push a directory onto the directory stack in order to refer to it using "tilde shorthand" (eg. ~1 refers to the second entry in the directory list), but I don't want to actually ...
chb's user avatar
  • 708
1 vote
1 answer
101 views

I love bash (4.1.2(1)-release) but I strongly prefer the way tcsh implements pushd +N with the dextract option enabled, so much so that I refuse to use bash as my default shell because of it. Has ...
Vercingatorix's user avatar
7 votes
1 answer
878 views

In a related question somebody states that the directory stack of the pushd command is emptied when your shell terminates. But how is the stack actually stored? I use fish instead of bash and the ...
jallersma's user avatar
2 votes
2 answers
3k views

If I poorly write a script that uses pushd /etc but I don't finish it with popd: Will /etc still be in the pushd+popd directory stack/in RAM after the bash script has finished executing and Bash has ...
Bean6754's user avatar
0 votes
1 answer
117 views

I have aliased pushd in my bash shell as follows so that it suppresses output: alias pushd='pushd "$@" > /dev/null' This works fine most of the time, but I'm running into trouble now using it ...
Théophile's user avatar
3 votes
1 answer
121 views

What is the order for the pathnames of the directories stored in the stack shown by dirs -l? Are they ordered by their last pushd commands? Is it possible to order them so that they are ordered by ...
Tim's user avatar
  • 107k
-4 votes
2 answers
876 views

pushd push a directory into the directory stack, and change the working directory. I guess that is all we need. But besides, why does pushd always output the stack to stdout? I think that is ...
Tim's user avatar
  • 107k
2 votes
1 answer
2k views

I've been using pushd and popd for a long time while writing bash script. But today when I execute which pushd, I get nothing as output. I can't understand this at all. I was always thinking that ...
Yves's user avatar
  • 3,411
1 vote
1 answer
788 views

If I paste these lines into a command prompt on Debian... DIR=$(mktemp -d -t bbbrtc.XXXXXX) || exit 1 echo "tmpdir = $DIR" cd "$DIR" They make a new temp directory, print the directory name, and then ...
bigjosh's user avatar
  • 599
2 votes
2 answers
4k views

I'm trying to understand if there are any benefits of using: pushd my_dir make all # ... or something else popd vs ( cd my_dir make all # ... or something else ) or is it merely a ...
ahmet alp balkan's user avatar
0 votes
1 answer
75 views

I have a file whose content is the output of dirs -v, i.e. pathnames to directories: 0 ~/program_files/OS/dirs/recentVisitedDirs 1 ~/cs/security/computer security/OS security/user management/...
Tim's user avatar
  • 107k

15 30 50 per page