Skip to content

Wednesday, February 10th, 2010

POSIX and PATH

January 30, 2009 by Sravan  
Filed under Computers

It has been nearly two months since I introduced Cygwin. We’ve seen how to install Cygwin, customize the terminal, a few text editors and a tabbed terminal emulator. Enough with the playfulness. One final configuration and let us move on to the geekier fun.

Directory Structure
Cygwin uses the POSIX notation standard in paths. That is, instead of ‘\’ as in Windows, it uses the more convenient ‘/’ as in Unix. The web follows the same notation. For instance, take http://thatdamnpc.com/category/cygwin-unix. On the web host, one might find a directory called “category” in the main directory and a sub-directory “cygwin-unix” along with other category names in it.

‘/’, the root directory, is considered the parent directory under which all directories fall, like /usr, /bin, /lib, /tmp, /var, etc. /A/B/C/D/E/F.txt would mean a file F.txt present in E, a sub-directory of D, which is a sub-directory of C, which is a sub-directory of B, which is a sub-directory of A, which is a sub-directory of /, the root.

If you look at the contents of / (ls / or dir /) in your Cygwin terminal, you will notice a sub-directory called cygdrive. This contains all the Windows drives in it. Your C: drive can be got to through /cygdrive/c.

For convenience, we can remove this /cygdrive prefix in the following ways:

1. $ cd /
    $ mkdir c e
    $ mount c: /c
    $ mount e: /e

2. $ mount –c /

In this way your main Windows drives will be direct sub-directories of /.

PATH
Check what your path is using echo $PATH command. It should have at least the following: /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/c/WINDOWS/
system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/SysinternalsSuite

Using this path setting, we can run even those programs that we could run from the MS Command Prompt. If you have any other files which can be run from command line, add them to the path using your .profile. We’ve already seen that.

Good to go from next week.

  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Reddit
  • Yahoo! Buzz
  • Slashdot
  • E-mail this story to a friend!
  • BallHype
  • YardBarker

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


About Us | Advertise with us | Blog for EveryJoe | Privacy Policy | Terms of Use
Get This Theme | Sitemap


All content is Copyright © 2005-2010 b5media. All rights reserved.