Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
-T
On 1/23/19 3:06 PM, Joe Zeff wrote:
On 01/22/2019 11:55 PM, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
Yes. It saves one keystroke from
cd ..
He said "previous" not "parent"
Try it yourself.
On 1/22/19 11:06 PM, Joe Zeff wrote:
On 01/22/2019 11:55 PM, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
Yes. It saves one keystroke from
cd ..
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
# pwd /home/linuxutil
# cd /home/CDs/Linux/Security/Metasploit-Armitage/
# pwd /home/CDs/Linux/Security/Metasploit-Armitage
# cd - /home/linuxutil
# pwd /home/linuxutil
On 1/23/19 3:12 PM, ToddAndMargo via users wrote:
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
And here is the man page snippet...
- is converted to $OLDPWD before the directory change is attempted.
On 1/22/19 11:15 PM, Ed Greshko wrote:
On 1/23/19 3:12 PM, ToddAndMargo via users wrote:
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
And here is the man page snippet...
- is converted to $OLDPWD before the directory change is attempted.
I have been using unix and then linux for untold years and I just discovered this. :-[
On Tue, 2019-01-22 at 22:55 -0800, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
This has been around since before Linux was even thought of. IIRC it goes back at least to the Unix System V shell and possibly earlier.
poc
On 1/23/19 2:36 AM, Patrick O'Callaghan wrote:
On Tue, 2019-01-22 at 22:55 -0800, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
This has been around since before Linux was even thought of. IIRC it goes back at least to the Unix System V shell and possibly earlier.
poc
I can only imagine the typing I would have avoided.
Mumble, mumble
On Wednesday, January 23, 2019 2:36:06 AM EST ToddAndMargo via users wrote:
On 1/22/19 11:15 PM, Ed Greshko wrote:
On 1/23/19 3:12 PM, ToddAndMargo via users wrote:
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
And here is the man page snippet...
- is converted to $OLDPWD before the directory change is
attempted.
I have been using unix and then linux for untold years and I just discovered this. :-[
It also has nothing to do with Linux. ☺
On Wednesday, January 23, 2019 5:36:40 AM EST Patrick O'Callaghan wrote:
On Tue, 2019-01-22 at 22:55 -0800, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
This has been around since before Linux was even thought of. IIRC it goes back at least to the Unix System V shell and possibly earlier.
Linux doesn't have any special handling of the parameter, and doesn't check to see what program you're trying to run. Please keep in mind that Linux is a kernel, not the userland. That said, this certainly is an old feature of most shells.
On 1/23/19 3:25 AM, John Harris wrote:
On Wednesday, January 23, 2019 2:36:06 AM EST ToddAndMargo via users wrote:
On 1/22/19 11:15 PM, Ed Greshko wrote:
On 1/23/19 3:12 PM, ToddAndMargo via users wrote:
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
And here is the man page snippet...
- is converted to $OLDPWD before the directory change is
attempted.
I have been using unix and then linux for untold years and I just discovered this. :-[
It also has nothing to do with Linux. ☺
cd, which is part of Bash, runs inside Linux, so I am not sure what point you are trying to make.
On Wednesday, January 23, 2019 6:58:09 AM EST ToddAndMargo via users wrote:
On 1/23/19 3:25 AM, John Harris wrote:
On Wednesday, January 23, 2019 2:36:06 AM EST ToddAndMargo via users wrote:
On 1/22/19 11:15 PM, Ed Greshko wrote:
On 1/23/19 3:12 PM, ToddAndMargo via users wrote:
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
And here is the man page snippet...
- is converted to $OLDPWD before the directory change is
attempted.
I have been using unix and then linux for untold years and I just discovered this. :-[
It also has nothing to do with Linux. ☺
cd, which is part of Bash, runs inside Linux, so I am not sure what point you are trying to make.
Linux is just a kernel. `bash` is a program, part of the GNU Operating System, that can be built to run on any kernel. Bash even runs on Windows. ☺
On 23/01/2019 07:55, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
-T
There is also a more powerful tool:
pushd DIR cd to DIR and push olddir on a stack popd cd to the DIR on top of stack and removes it dirs list the stack
So you can do several "pushd" and go back trough them with popd (each have options, look them up...)
G
On Wed, 2019-01-23 at 14:01 +0100, GianPiero Puccioni wrote:
On 23/01/2019 07:55, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
-T
There is also a more powerful tool:
pushd DIR cd to DIR and push olddir on a stack popd cd to the DIR on top of stack and removes it dirs list the stack
So you can do several "pushd" and go back trough them with popd (each have options, look them up...)
I'm aware of them. They originally appeared in the C Shell (csh) but frankly I could never be bothered. 'cd -' on the other hand, is always there and you don't need to think about it.
poc
On 23/01/2019 14:44, Patrick O'Callaghan wrote:
On Wed, 2019-01-23 at 14:01 +0100, GianPiero Puccioni wrote:
On 23/01/2019 07:55, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
-T
There is also a more powerful tool:
pushd DIR cd to DIR and push olddir on a stack popd cd to the DIR on top of stack and removes it dirs list the stack
So you can do several "pushd" and go back trough them with popd (each have options, look them up...)
I'm aware of them. They originally appeared in the C Shell (csh) but frankly I could never be bothered. 'cd -' on the other hand, is always there and you don't need to think about it.
Yes, I use "cd -" all the time but if I know I have to search several dirs and want to go back at will, "pushd" is very handy.
G
On 1/23/19 12:55 AM, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
-T
OK, then this will blow your mind:
dnf install autojump
https://www.linode.com/docs/tools-reference/tools/faster-file-navigation-wit...
On Tue, 22 Jan 2019 22:55:07 -0800 ToddAndMargo via users users@lists.fedoraproject.org wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
-T _______________________________________________
Or you could install cdargs and use cv and the arrow keys to move back and for through directories. Great little program. It was missing for a little while but it is back.
Peter
On Wed, Jan 23, 2019 at 03:58:09AM -0800, ToddAndMargo via users wrote:
On 1/23/19 3:25 AM, John Harris wrote:
On Wednesday, January 23, 2019 2:36:06 AM EST ToddAndMargo via users wrote:
On 1/22/19 11:15 PM, Ed Greshko wrote:
On 1/23/19 3:12 PM, ToddAndMargo via users wrote:
You don't understand what I said. I meant "previous" directory, not directory before the current direcorty. Here is an example:
And here is the man page snippet...
- is converted to $OLDPWD before the directory change is
attempted.
I have been using unix and then linux for untold years and I just discovered this. :-[
It also has nothing to do with Linux. ☺
cd, which is part of Bash, runs inside Linux, so I am not sure what point you are trying to make.
It is a feature of bash, zsh, ksh, ... It has nothing to do with UNIX or Linux.
jon
On Wed, Jan 23, 2019 at 08:43:11AM -0600, SternData wrote:
On 1/23/19 12:55 AM, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
-T
OK, then this will blow your mind:
dnf install autojump
https://www.linode.com/docs/tools-reference/tools/faster-file-navigation-wit...
For ksh users, there are a set of functions and aliases called mcd (menued cd) that I like. I've not tried to converted to bash.
$ mcd 1) ~/lib/kshfuncs 2) ~/lib 3) ~/Mail 4) ~ 5) /dev/mapper 6) /dev 7) /proc 8) /sys 9) / 10) /sys 11) ~ Select by number or enter a name:
It also has a "dirs" command that prints the list but does not do the query. This conflicts with the pushd/popd dirs command.
Jon
On Tue, Jan 22, 2019 at 10:55:07PM -0800, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -What a time saver!
... and really! - and I didn't know about it before, so: Thanks, lots! .. :)
Also a big Thanks to GianPiero for the pushd, popd etc. commands.
Nothing knowing about those commands is - in my case at least - the result of reading Linux/Unix books and technical literature in general very often only via the index of the book, instead of from first to last page ... :)
Thanks for the hints, and nice weekend! Wolfgang
I just pushd, popd, dirs all the time. 'dirs -v' is very handy navigating the stack. I put and alias in ~/.bashrc: alias dirs='dirs -v'
[0:root@c3po public_html]$ dirs 0 /home/webmaster/public_html 1 ~/config/apache 2 ~/config/network 3 ~/config/dhcp
To change to the 3rd directory,pushd +3
To remove the 2nd directory without changing the current directory, popd +2
Bill
On 1/23/2019 8:01 AM, GianPiero Puccioni wrote:
On 23/01/2019 07:55, ToddAndMargo via users wrote:
Hi All,
I just discovered this. To cd back to the previous directory
cd -
What a time saver!
-T
There is also a more powerful tool:
pushd DIR cd to DIR and push olddir on a stack popd cd to the DIR on top of stack and removes it dirs list the stack
So you can do several "pushd" and go back trough them with popd (each have options, look them up...)
G _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org