Categories
linux unix

cd OLD NEW

Something I like in ksh is to change from /my/old/directory/path to /my/new/directory/path by typing cd old new. This does not work in bash

So I had to find a workaround 😉


$ ksh
$ cd /app/oracle/product/11.1.0.6/database/rdbms/admin
$ cd 6 7
$ pwd
/app/oracle/product/11.1.0.7/database/rdbms/admin
$ bash
$ cd 7 6
bash: cd: 7: No such file or directory
$ c() { cd ${PWD/$1/$2}; }
$ c 7 6
$ pwd
/app/oracle/product/11.1.0.6/database/rdbms/admin

By Laurent Schneider

Oracle Certified Master

8 replies on “cd OLD NEW”

[…] Link to the original site Tags: Directory C, Directory Path, No Such File Or Directory, Oracle, ORACLE BLOGS, Oracle Product, Pwd, Workaround […]

Leave a Reply

Your email address will not be published.