New Command (alias)
Charles T. Bell
cbell44 at cfl.rr.com
Wed Aug 27 20:20:12 UTC 2014
On 08/27/2014 02:11 AM, Loïc Grobol wrote:
> Why not just `cd ..` ?
>
> On 27 Aug 2014 08:00, "Bill Vance" <kbun at xpresso.seaslug.org
> <mailto:kbun at xpresso.seaslug.org>> wrote:
>
>
> Howdy Folks;
>
> While I haven't seen much of it, it seems logical
> to me, that this list is not just about problems,
> but also bout passing along the, "little goodies",
> that we come across. Well here's one for you.
>
> Cd-ing down into a long string of directories one
> dir name at a time is one thing, but using cd to
> try to negotiate back up a few dirs, can be
> downright cumbersome.
>
> Conversely, I've allways liked the way ftp
> handled this with it's, "cdup", command. After
> playing with it a while, I think I've found the
> most elegant version to date. After you've
> checked it out in a shell, you're probably
> going to want to cut/paste it in with the other
> aliases in your /home/$USER/.bashrc file. So anyway, here it is.
>
> alias cdup='cd $(dirname $PWD)'
>
> The dirname command simply chops the last name
> off of a directory string, in this case, the
> Present Working Directory, and there you have
> it. Enjoy.
>
> Bill
>
> --
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com <mailto:kubuntu-users at lists.ubuntu.com>
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/__mailman/listinfo/kubuntu-users
> <https://lists.ubuntu.com/mailman/listinfo/kubuntu-users>
>
>
>
I have always used the number of double periods to move up.
cd ../../otherdir
That command would move me up 2 directories and into a third
that is in the second directory up. I am not aware of a limit.
I have found it a useful command since DOS.
Oh, and "ls" works the same way when checking for directories to
move to.
Good luck!
Tom
--
"There is a sufficiency in the world for man's
need but not for man's greed."
-- Mahatma Gandhi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbell44.vcf
Type: text/x-vcard
Size: 149 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20140827/d833c76f/attachment.vcf>
More information about the kubuntu-users
mailing list