-
-
Recent Posts
Recent Comments
Categories
- Bash
- BerkeleyDB
- Browsers
- Cable
- Chrome
- Cool Problems
- CPAN
- CSS
- Data Structures
- Databases
- DNS
- Editors
- Errors
- Everything Else
- Fedora
- Firefox
- Firewall
- Flash
- Forking
- Hardware
- HTML
- ImageMagick
- Images
- Internet Explorer
- IpTables
- Lingo
- Linux
- Log4perl
- Mediawiki
- Monitoring
- Munin
- MySQL
- Netgear
- Perl
- PHP
- PhpMyAdmin
- Postfix
- Regular Expressions
- Routers
- RPM
- Samba
- Screen
- SSH
- SSHFS
- Subversion
- Synergy
- Troubleshooting
- Ubuntu
- VIM
- Windows
- Windows Vista
- Wordpress
- YUM
Blogroll
Archives
Tags
September 2010 M T W T F S S « Aug 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Meta
CNN.com- Bonnie Blue actress from 'GWTW' dies
- President to aides: Find economic spark
- Hurricane Earl downgraded as it approaches East Coast
- Workers rescued after oil platform fire
- BP uncaps oil well in Gulf
- Mideast peace talks start
- Convicted killer spared death penalty
- Opinion: Social Security can help states
- U.S., Iran battle on basketball court
- She drops 100 pounds, gains new life
BBC- Europe agrees finance watchdogs
- ICC chief executive on cricket charges
- Explosion on Gulf of Mexico rig
- Tanker runs aground off N Canada
- DCAL cuts 'will mean job losses'
- Pakistan trio hit by ICC charges
- Strike 'kills Afghan civilians'
- Bid for Middle East peace begins
- The mint with a whole lot of food miles
- Man 'strangled wife and hid body'
AL JAZEERA ENGLISH (AJE)
Category Archives: Bash
How To Determine Directory of Sourced Bash Script
Sourcing a script can be useful for exporting variables in the current shell. However, you can’t use “dirname $0″ to get the directory of the script. Here’s how to get the same effect of dirname, but still allowing you to … Continue reading
Posted in Bash, Linux
Leave a comment
How to Fix an Empty Bash Shell Prompt
If you bash shell prompt is empty when logging in, here’s how to fix it. Create a ~/.bashrc file: if [ -f /etc/bashrc ]; then . /etc/bashrc fi Create a ~/.bash_profile file: if [ -f ~/.bashrc ]; then . ~/.bashrc … Continue reading
Posted in Bash, Linux
Leave a comment
How to Convert Seconds to Minutes in BASH
This is how to convert seconds into HH:MM:SS in bash: $ date -d ’1970-01-01 100 sec’ +’%H:%M:%S’ 00:01:40
Posted in Bash
Leave a comment
How to Monitor Multi-Core CPU Usage on Linux
Here’s how to monitor multiple cores on Linux: # mpstat -P ALL Example: Monitor all CPU’s in 1 second intervals forever # mpstat -P ALL 1
How To Get Yesterday's Date using BASH Shell Scripting
The new short way: $ date -d ’1 day ago’ +’%Y/%m/%d’ 2009/07/21 Or the longer way: Yesterday in epoch seconds $ yesterday=$((`date +’%s’` – 86400)) Get default formatted yesterday’s date $ date -d “1970-01-01 $yesterday sec” Tue Feb 17 01:27:32 … Continue reading
Posted in Bash, Linux
2 Comments
How to View a Specific Page or Section of Manpage
For example, the “kill” manpage shows: SEE ALSO bash(1), tcsh(1), kill(2), sigvec(2), signal(7) This is how to view section 7 of the “signal” manpage: man 7 signal
Posted in Bash, Linux
Leave a comment
Faster File Copy Using Tar and SSH
How to quickly copy a file or directory over SSH using tar: tar -cf – myfile | ssh target_host tar -xf – If you want to change the target directory, use this: tar -cf – myfile | ssh target_host “cd … Continue reading
Copying directory trees with tar pipe tar
# tar cf – source_dir | ( cd target_dir && tar xBf – )
Posted in Bash, Linux
Leave a comment
How to get the directory location of a shell script
dirname=`dirname $0`