[kanchilug] 1D1C - pushd

  • From: Dhanasekar <tkdhanasekar@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx, kanchilug@xxxxxxxxxxxxx
  • Date: Tue, 3 Jan 2023 06:00:00 +0530

 pushd - is used to add directories onto the directory tree stack

syntax
$ pushd [OPTIONS] [DIRECTORY]

To add directories
$ pushd ~/Videos
$ dirs -l -v
$ pushd ~/Music
$ pushd ~/Downloads
$ pushd ~/Desktop
$ pushd ~/Templates

To add a new directory without modifying the current directory
$ pushd -n directory
$ pushd -n ~/Documents

To Move to a directory at any position in the stack
$ dirs -l -v
$ pushd +2
when executed the second position directory will now at the top of the stack



regards,
T.Dhanasekar

Other related posts:

  • » [kanchilug] 1D1C - pushd - Dhanasekar