Some aliases I use

In my daily work I often find myself doing repetitiveĀ tasks, some simple others more advanced.

Here are some of my favorite aliases I use for some of the simple tasks.

#Listing my IP addresses in a format so that I can easily copy the IP address I need.

ips='/sbin/ifconfig | grep "Link encap" -A1 | sed "s/.*inet addr://" | sed "s/ .*//"'

#Listing targets in an ant build.xml

catb='cat build.xml | grep -e".*target name.*"'

#finding java files (often used in conjunction with grep to look in files)

findjava='find . -type f | grep -e".*\.java$"'

#finding log files

findlogs='export log=$$;find . -type f | grep -e".*\.log$" >/tmp/$log ; find . -type f | grep -e".*\.log\.[0-9]*$" >>/tmp/$log ; cat /tmp/$log | sort '

#Grepping in history (eg 'hgrep scp')

hgrep='history | grep -v hgrep | grep '

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s