Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Server Daily
IT Management Daily
Subscribe News
Subscribe PR
Subscribe Security

internet.com
Internet News
Small Business

Advertise
Newsletters
Tech Jobs
E-mail Offers

 






Current Newswire:

An Easy Step-by-Step to Installing and Running Roundcube Webmail on Ubuntu/Linux

Tech Comics: "Groundhog Day"

Want a Job? Learn Linux

PC-BSD 9 review – to FreeBSD what Ubuntu is to Debian

Time to dispel open source myths, says Liam Maxwell

SECURITY: Nmap Inside and Out

Eight features Windows 8 'borrowed' from Linux

Malware devs embrace open-source

A tale of two distros: Ubuntu and Linux Mint

Raspberry Pi benchmarked against Beagleboard, low price is long term



Applications Management Engineer Sr (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
:Unix Tip: Sed & Awk -- Still friendly after all these years
Unix Tip: Sed & Awk -- Still friendly after all these years
Mar 12, 2010, 15 :02 UTC (0 Talkback[s]) (5489 reads)

(Other stories by Sandra Henry-Stocker)

"Even after decades of using Unix on thousands of systems, I find that it's still fun to discover various convolutions of sed and awk commands to perform command line wizardry. There's a lot more to each of these tools than those uses I make of these commands on a routine basis. Let's take a look at some one-liners you might not yet have tried.

"One of my long-standing "tricks" for awk is using $NF to print the last field on every line. Since NF represents the number of fields on a line (e.g., 6), $NF represents the value of that last field (e.g., $6). Printing the last field of every line, therefore, might look like this:

$ awk '{print $NF}' myfile

"or this:

$ awk -F: '{print $NF}' /etc/passwd

"depending on whether the file is white space delimited or not."

Complete Story

Related Stories:
Ignoring Files and Directories in Subversion for Easier Linux Server Management(Mar 09, 2010)
Device Or Resource Busy Errors In Linux(Mar 05, 2010)
The Perils of Sudo With User Passwords(Feb 26, 2010)
Nine Linux projects in 90 minutes(Feb 25, 2010)
Easy folder sharing in KDE 4.4(Feb 19, 2010)
Regular Expressions In grep(Feb 18, 2010)
Linux fdupes: Get Rid (Delete) Of Double Duplicate Files In Directory(Feb 06, 2010)



No talkbacks posted.
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!

..............................




All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP