<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>leine.info &#187; bashrc</title>
	<atom:link href="http://leine.info/tag/bashrc/feed/" rel="self" type="application/rss+xml" />
	<link>http://leine.info</link>
	<description>Discover my public and private World.</description>
	<lastBuildDate>Thu, 22 Dec 2011 13:57:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Nützliche bashrc Funktionen</title>
		<link>http://leine.info/2009/02/nutzliche-bashrc-funktionen/</link>
		<comments>http://leine.info/2009/02/nutzliche-bashrc-funktionen/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 12:46:04 +0000</pubDate>
		<dc:creator>jleine</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bashrc]]></category>

		<guid isPermaLink="false">http://leine.info/?p=176</guid>
		<description><![CDATA[Da ich momentan gerne unter Linux entwickle, habe ich mir in letzter Zeit ein paar Bash Scripte erarbeitet, die einem das Leben ein wenig erleichtern. Aus diesem Grund poste ich meine Scripte einfach so wie sie sind. Die Bedeutung müsste &#8230; <a href="http://leine.info/2009/02/nutzliche-bashrc-funktionen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Da ich momentan gerne unter Linux entwickle, habe ich mir in letzter Zeit ein paar Bash Scripte erarbeitet, die einem das Leben ein wenig erleichtern. Aus diesem Grund poste ich meine Scripte einfach so wie sie sind. Die Bedeutung müsste jeweils klar erkennbar sein.<span id="more-176"></span></p>
<pre lang="bash">
====== .bashrc ======

HOSTNAME=`hostname`
USER=`id -un`

#export HOSTNAME USER DISPLAY

##
# find files
#
function ff() {
  local d=.
  if [ $# = 2 ]; then d=$1; shift; fi
  if [ $# != 1 ]; then
    echo usage: ff [dir] string
    return
  fi
  find $d -iname \*$1\*
}

##
# find word in files
#
function fw() {
  local d=.
  if [ $# = 2 ]; then
    d=$1; shift;
  fi
  if [ $# != 1 ]; then
    echo usage: fw [dir] string
    return
  fi
  find $d -maxdepth 1 -type f | xargs grep --color=auto -ni "$1"
}

##
# find programm
#
function psg() {
  ps auxw | sed -n -e 1p -e "/-e 1p/d" -e "/$1/p"
}

##
# translate a word
#
function translate()  {
    while [ -n "$1" ]
    do
        T=/tmp/$$.html;lynx -source "http://dict.leo.org/?search=$1" | grep results >$T &#038;&#038; w3m -dump $T
        rm $T
        shift
    done
}

##
# translation tool
#
function leo() {
    [ -n "$1" ] &#038;&#038; translate "$@" || while read -ep dict2\> W
    do
        t $W | less
    done
}

##
# get IP adresses
#
function my_ip()
{
    MY_IP=$(/sbin/ifconfig ppp0 | awk '/inet/ { print $2 } ' | \
sed -e s/addr://)
    MY_ISP=$(/sbin/ifconfig ppp0 | awk '/P-t-P/ { print $3 } ' | \
sed -e s/P-t-P://)
}

##
# get current host related info
#
function ii()
{
  echo -e "\nYou are logged on ${RED}$HOST"
  echo -e "\nAdditionnal information:$NC " ; uname -a
  echo -e "\n${RED}Users logged on:$NC " ; w -h
  echo -e "\n${RED}Current date :$NC " ; date
  echo -e "\n${RED}Machine stats :$NC " ; uptime
  echo -e "\n${RED}Memory stats :$NC " ; free
  my_ip 2>&#038;- ;
  echo -e "\n${RED}Local IP Address :$NC" ; echo ${MY_IP:-"Not connected"}
  echo -e "\n${RED}ISP Address :$NC" ; echo ${MY_ISP:-"Not connected"}
  echo
}

##
# searchs a programm  using apt
#
function sas()
{
  apt-cache search $1 | grep $1
}

alias sai="sudo aptitude install"
alias ls='ls --color=auto -hF'
alias ll='ls --color=auto -lhF'
alias la='ls --color=auto -lahF'
alias grep='grep --color=auto'
alias psx="ps -auxw | grep $1"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://leine.info/2009/02/nutzliche-bashrc-funktionen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

