New Command (alias)

Loïc Grobol loic.grobol at gmail.com
Wed Aug 27 06:11:03 UTC 2014


Why not just `cd ..` ?
On 27 Aug 2014 08:00, "Bill Vance" <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
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/kubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20140827/9f082c7a/attachment.html>


More information about the kubuntu-users mailing list