This is a multi-part message in MIME format. ------=_NextPart_000_0059_01C2E6B2.BD9D3940 Content-Type: multipart/related; boundary="----=_NextPart_001_005A_01C2E6B2.BD9D3940" ------=_NextPart_001_005A_01C2E6B2.BD9D3940 Content-Type: multipart/alternative; boundary="----=_NextPart_002_005B_01C2E6B2.BD9D3940" ------=_NextPart_002_005B_01C2E6B2.BD9D3940 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Heya, I was exchanging Linux tricks with a friend and thought I'd share a few here. Please feel free to reply with your own, if you like. It'd be cool to see how other people are saving time and geeking out. :) Thanks! Steve .BEGIN. If you're still using cd to change directories, for shame! Well, sorta. :) Let me show you something. Let's say that you have a directory like /home/geoff/very/deeply/nested/stuff1 and let's say you have another: /home/geoff/very/deeply/nested/stuff2, right? And let's say you run a new interactive bash shell. How do you get to stuff1 or stuff2 without typing a lot? Put this in your .bash_profile: CDPATH=/home/geoff/very/deeply/nested export CDPATH Then, source the file ( . .bash_profile ) so that it picks up changes. Then, no matter where you are, simply type: cd stuff1 or cd stuff2 and it takes you there. cd always checks anything that you type against the base directories that you define in CDPATH. Cool, hey? :) Now, let's say that you're cd'ing all over the place. That's very inefficient. Instead, use pushd and dirs. But first, add this to your .bash_profile: alias pd='pushd' and source the file again. Anyway, here's what happens: pd /etc pd /home pd /usr pd /var/log/httpd pd /proc Now, type: dirs That's your stack of directories. The top of the stack is near the top of the screen. You can also type dirs -v Say you want to change to a particular directory. Simply say: pd +N where N is 0 (/etc), 1 (/home), 2 (/usr), etc. Once you've done that, type dirs again. See how the directory you've pushed has now become the top of the stack, and you've cd'd into it automagically? In case you ever want to remove a directory, you can use popd +N. That will blow away that particular directory from the stack. You really should never use cd again, unless you're using CDPATH. Always use pd and bash will remember where you've been. Much better than the stateless cd! Note that pushd and popd can also take negative arguments, like -4. The difference between +4 and -4 is that +4 starts counting from the top of the stack (0), whereas -4 starts counting from the bottom (taken as 0). So either way, it will target the fifth element either from the top or the bottom of the stack. Noumenaut Software Steve Jovanovic Director of Engineering http://dev.noumenaut.com 262.632.7755 "And the walls shall have eyes, and the doors shall have ears." - Bowie ------=_NextPart_002_005B_01C2E6B2.BD9D3940 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Heya,

 

I was exchanging Linux tricks with a friend and = thought I’d share a few here. Please feel free to reply with your own, if you like. = It’d be cool to see how other people are saving time and geeking out. :)

 

Thanks!

 

Steve

 

…BEGIN…

 

If you’re still using cd to change directories, for shame! Well, sorta. = :)

 

Let me show you = something…

 

Let’s say that you have a directory like /home/geoff/very/deeply/nested/stuff1 and let’s say you have = another: /home/geoff/very/deeply/nested/stuff2, = right?

 

And let’s say you run a new interactive bash = shell. How do you get to stuff1 or stuff2 without typing a = lot?

 

Put this in your .bash_profile:

 

CDPATH=3D/home/geoff/very/deeply/nested

export<= font size=3D2 face=3DArial> = CDPATH

 

Then, source the file ( . = .bash_profile ) so that it picks up = changes.

 

Then, no matter where you are, simply = type:

 

cd stuff1 or cd stuff2

 

and it takes you there. cd = always checks anything that you type against the base directories that you define in = CDPATH. Cool, hey? :)

 

Now, let’s say that you’re cd’ing all over the place. That’s very inefficient. Instead, use pushd and dirs.  But first, add this to your .bash_profile:

 

alias pd=3D’pushd

 

and source the file again.

 

Anyway, here’s what = happens:

 

pd = /etc

pd = /home

pd /usr

pd /var/log/httpd

pd = /proc

 

Now, type: dirs

 

That’s your stack of directories. The top of = the stack is near the top of the screen. You can also type dirs –v

 

Say you want to change to a particular directory. = Simply say: pd +N where N is 0 (/etc), 1 (/home), 2 = (/usr), etc.

 

Once you’ve done that, type dirs again. See how the directory you’ve pushed has now become the top = of the stack, and you’ve cd’d into it = automagically?

 

In case you ever want to remove a directory, you can = use popd +N. That will blow away that particular = directory from the stack.

 

You really should never use cd again, unless you’re using CDPATH.

 

Always use pd and bash = will remember where you’ve been. Much better than the stateless cd!

 

Note that pushd and popd can also take negative arguments, like -4. = The difference between +4 and -4 is that +4 starts counting from the top of = the stack (0), whereas -4 starts counting from the bottom (taken as 0). So = either way, it will target the fifth element either from the top or the bottom = of the stack.

 

 

3D"Noumenaut

 

= Steve Jovanovic

= Director of Engineering

http://dev.noumenaut.com

= 262.632.7755

 

"And the walls = shall have eyes, and the doors shall have ears." - = Bowie

 

------=_NextPart_002_005B_01C2E6B2.BD9D3940-- ------=_NextPart_001_005A_01C2E6B2.BD9D3940 Content-Type: image/gif; name="image001.gif" Content-Transfer-Encoding: base64 Content-ID: R0lGODlhtgAlAOZ9AEpLS11eYVxgY3Fycn5/gTCWvhacyBCt2AW35yibwiiv1grR8xDr/TDO7y7p +kyZvH+BgHanvlKtzW+xykzT8lDp+m7N7XHt+6zbGanVKarTNrPeNqnjB6rgELnnCrjkFLnjJ73j N6bOS6zOWavSQq3QWbDTWazMZbDPaLLNdrXVaLfUc7ziR7/gdcvvGMryBszzFdb4B9z5F8nvJsvz Ic3yM935J9j2Oeb8Cun8F/D/DvD+Fuz9LMHfe8btRtP0S9XyWs7xb9j1ZdPwfOn7Ter7cIiJip2e oZ6gn42uv7e3uI22yKW5xLrMmLrQj5PF2I7Y8I7u/LTM1bHZ6LHp9cTdh8bbmcDPpsHLsMjXpMzW tdHfpNHavMrki8rhltLmjdXrl9vwh9r0m9Pqqtjluuv6j+36sMTFxs3O0MnX3NXaydbX1src5Nrk xN7h2N/1xNLx9+HpyuPn2ubxyuz11/f9yPP82Obo5+vu8Ov37en59vb76P7+/gAAAAAAAAAAACH/ C05FVFNDQVBFMi4wAwEAAAAh+QQFCgB9ACwAAAAAtgAlAAAH/oB8goOEhYaHiImKi4yNjo+QkZKT lJWWl5iZmpZrZ1KfoFJpU2lspmx3epurrK2ukp1MSRG0E7a3t09TcKqvvr/Am2uyDw8FBsjJygYF E1S9wdHS04lrUk9QFhIHBwje394HzBNw1Obn09ZsVFAUDQsLDPDz3gYPVOj5+q5raXBUFyg4YECw IDxx9/YpXGgJz5p1UQQWNFiPHMOLGB2xSUMlSgUHAw0uQGBAwrM9dvaozMiSJZ402DyGJA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qJN46r5ZGrHnnjyscYn+ivpYe9IAOwrgQa/jweEWJ/fAgYQNnaL7IuH3RUoUEHOeMgvw46 lOykGbQiGs0axG/u/OPKc17xIJccxGFuegM8hAAIIbvllO5FyzECBO6ABwJExg1HAwCibiOHtr1G EnNAQQY44IEY6E5+MrDBDYQghjfkbxr9c57j3hRAyfnveThcnPQ0l0DiDAICGSSfbATUNtldbxBr aBsE6kMA19yBR7lxQxPLl8FGsCUFI8zZC7aosxfAYAY+CIIYyCAx/XntjI2wgxVEkIEOwM8DH4hj HEGwARa0wApAW0PX0MhHQqjxBCIggQYGOUhBkoAEIjhBCpqABTTssY99RAkZvFCFHqygBStAwQpW L6CCFKAgBU64ghb0CMlSIgIldqDDHOZAhjiIS1xc4EIb3FAuU9rylrjMpS4zEQgAADs= ------=_NextPart_001_005A_01C2E6B2.BD9D3940-- ------=_NextPart_000_0059_01C2E6B2.BD9D3940 Content-Type: text/x-vcard; name="Steve Jovanovic (stevej@noumenaut.com).vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Steve Jovanovic (stevej@noumenaut.com).vcf" BEGIN:VCARD VERSION:2.1 N:Jovanovic;Steve FN:Steve Jovanovic (stevej@noumenaut.com) ORG:Noumenaut Software TITLE:Noumenaut Skribe Geek TEL;WORK;VOICE:(262) 632-7755 TEL;CELL;VOICE:(262) 930-9932 ADR;WORK:;;2918 Goold St.;Racine;WI;53404-1915;United States of America LABEL;WORK;ENCODING=3DQUOTED-PRINTABLE:2918 Goold St.=3D0D=3D0ARacine, = WI 53404-1915=3D0D=3D0AUnited States of America URL;WORK:http://dev.noumenaut.com EMAIL;PREF;INTERNET:stevej@noumenaut.com REV:20030213T140645Z END:VCARD ------=_NextPart_000_0059_01C2E6B2.BD9D3940--