Saturday, April 26, 2014

awk


awk command examples


 Remove duplicate lines using awk

$ awk '!($0 in array) { array[$0]; print }' temp

Print all lines from /etc/passwd that has the same uid and gid

$ awk -F ':' '$3==$4' passwd.txt

Print only specific field from a file.

$ awk '{print $2,$5;}' employee.txt



Related Posts:

  • File and Directory Permissions Permissions is a type of good security features in Linux operating system. Permissions is used to assign on files as well as on directories. There are three types of files permissions: Read (r) - To view a file's … Read More
  • Chage Command with example to manage Linux password expiration v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} chage - change user password expiry information  chage ch… Read More
  • A-Z Index of the Mostly used Bash command line for Linux A      awk B      bzip2 C      cd       |     crontab  … Read More
  • Introduction of Shell Scripting What is Shell ?? A shell is simply a program that is used to start another program. Shell accepts your instruction or commands in English (mostly) and if its a valid command, it is pass to kernel. All oper… Read More
  • date date command examples Set the system date: $ date -s "01/31/2010 23:59:53" Once you’ve changed the system date, you should syncronize the hardware clock with the system date as shown below. $ hwcloc… Read More

0 comments:

Post a Comment