• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged print

Linux> Aliases

Jun08
2011
Written by Scott Rowley

Aliases can be a great way to more easily remember an oddball command or to shorten a long command. Aliases are stored in your .profile (or .bash_profile) or within a include file referenced from .profile.

A couple of quick examples before showing how to set them up:
READ MORE »

Posted in BASH, Ubuntu - Tagged alias, basic, conditional, epoch, ggrep, grep, if, include, linux, Perl, profile, reload, solaris, time, ubuntu, unix, whois

Linux> Command line shortcuts

Jun06
2011
Written by Scott Rowley

Another starter article to grow with my needs, we’ll start off with the shebang, or bang…or simply “!”. The first two commands I believe are the most useful and could be commonly used. Note that some of these can be a bit difficult to remember, we’ll also go over making aliases so we can use something a little easier to remember in a later article.
READ MORE »

Posted in BASH, Ubuntu - Tagged !, bang, command, date, exclamation, execute, home, last, previous, prior, shebang, shortcut, tilde

Perl> Get IP only from logfiles

Oct26
2010
Written by Scott Rowley

Being an ISP admin, I have regular need to find IP addresses listed in large logfiles. The following will grab anything that appears to be an IP and list it out for you, from there you can sort or whatever you want to do with the list.

perl -ne 'print "$&n" while m#d+.d+.d+.d+#g' <logfile>

Or just throw it in a bash script for easier remembering:

getip.sh

#!/bin/bash
perl -ne 'print "$&\n" while m#\d+\.\d+\.\d+\.\d+#g' $1;
Posted in Perl - Tagged BASH, IP, log, logfile, Perl

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top