w3reference home
AWK Tutorial


Bookmark and Share

AWK Select Multiple fields


  • fileds, $1 $2 ..., a whole line $0
  • Printing every line : cat /tmp/a.txt|awk '{ print $0 }'
$ awk -F":" '{ print $1 $3 }' /etc/passwd
stanford7
imcrazy9
test453
user7711
rootadmin4
....etc.

$ awk -F":" '{ print $1 " " $3 }' /etc/passwd

$ awk -F":" '{ print "username: " $1 "ttuid:" $3" }' /etc/passwd
username: stanford          uid:7
username: iamcrazy          uid:9
username: test45            uid:3
username: user77            uid:11
username: rootadmin         uid:4
....etc.
Code Validator
Learn FTP
Color finder
Link Checker
Free web designs
Coming soon!
Interview Questions...
'w3reference : Learn by examples ... Advanced to beginner's tutorials ...'
Ajax: AJAX tutorial1 | Apache: Apache HTTP Server | Restarting Apache | AWK: awk Select | CSS: CSS Border | CSS Syntax | CSS Selector | CSS Comment | CVS: CVS Release | CVS Login | CVS Logout | CVS Annotate | Databases: Rolap Tutorial | OLAP Tutorial | OLTP Tutorial | data warehousing | Expect: HTML: html | Linux: Dot (.) conf files | Linux Mount Point | Linux Filesystem | SSH Tutorial | Linux Commands: cal | cat | cfdisk | chroot | MySQL: MySQL Commands | PHP: PHP Basics | PHP Variables | PHP Output (echo/print) | PHP String Concat | PL/SQL: PL/SQL Data Types | PL/SQL Control Structures | PL/SQL File Extensions | PL/SQL DBMS_OUTPUT package | Python: My first Python program | SED: Shell: Starting Bash | Bash Redirection | Bash Pipes | Bash Variables | SQL: SQL Transactions | SQL Constraints | SQL Drop | SQL Union & Union All | SVN: svn architecture | SVN Repository | SVN Import | SVN Checkout | Tech: soap | Web Designing: Web Hosting | HTML/XHTML/CSS code validator | Learn FTP | Search Engine Optimization Tips | www: XML: XML vs HTML | XML Syntax | XML Tags, Elements and Attributes | XML Namespaces |
Sitemap | Disclaim | Privacy Policy | Contact | ©2007-2009 w3reference.com All Rights Reserved.