Skip navigation

Tag Archives: bash

$du -ah /path/to/dir

The ‘ls’ program will show you file sizes but only 4k for directories (depending on machine, platform and other variables). Use ‘du’ as shown above to get the folder size.

Posted via web from Apphacker’s learning curve

You can view the character codes for the ASCII table on any unix or linux system easily by simply looking in the man.
On any command line type:

man ascii

voila! Before I figured this out I had always looked online and found only crappy ad spamming websites that uses images for ASCII tables so you can’t select or copy the values. As a JavaScript programmer I haven’t been all that aware of the power of my Mac OS X’s unix engine provides.

Posted via email from Apphacker’s learning curve

I have been using bash for many years but I haven’t really done too much with it except some simple setup scripts. I learned some things today and I just wanted to write this down to help me remember:

Separate multiple paths in a bash environment variable using a colon, not a semicolon:

PYTHONPATH='/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/:/Users/bjorn/projects/python/orsaur.us/trunk'
export PYTHONPATH

PYTHONPATH can be viewed in os.environ[ “PYTHONPATH”] ( not os.environ[ “PATH” ] ) and any of those paths should be visible in sys.path. If the paths added to PYTHONPATH in your .bash_profile on Mac OS X do not show up in sys.path then something is wrong.

Use the “source” command to reload your .bash_profile settings in your existing terminal:

source ~/.bash_profile

I also found this “Bash by Example” article helpful.