Free Essay

Linux Awk

In:

Submitted By nap123
Words 439
Pages 2
Linux 2
5 min speech on awk

AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool. It is a standard feature of most Unix-like operating systems. Awk is a utility/language designed for data extraction. If the word "extraction" rings a bell, it should because awk was one of Larry Wall's inspirations when he created Perl. Awk is often used with sed to perform useful and practical text manipulation chores, and it depends on the task if you should use awk or Perl. Awk's funny name comes from the names of its original authors, Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger. Most of you probably recognize the Kernighan name; he is one of the fathers of the C programming language and a major force in the UNIX world. One of the most simple and popular uses of awk is selecting a column from a text file or other command's output. There are many different concepts.one basic concept is $ dpkg -l | awk ' /'vim'/ {print $2} ' This command would print all packages installed that have "vim" in their names. Awk uses some internal variables to assign certain pieces of information as it processes a file. The internal variables that awk uses are:

FILENAME: References the current input file.
FNR: References the number of the current record relative to the current input file. For instance, if you have two input files, this would tell you the record number of each file instead of as a total.
FS: The current field separator used to denote each field in a record. By default, this is set to whitespace.
NF: The number of fields in the current record.
NR: The number of the current record.
OFS: The field separator for the outputted data. By default, this is set to whitespace.
ORS: The record separator for the outputted data. By default, this is a newline character.
RS: The record separator used to distinguish separate records in the input file. By default, this is a newline character.By default, awk assumes that a space delimits the fields, or columns, in a file. If your file uses a different character, you can tell awk this by passing it the -F parameter with your delimiting character in double quotes. For example: -F”:” for a file delimited with colons.

References https://www.digitalocean.com/community/tutorials/how-to-use-the-awk-language-to-manipulate-text-in-linux http://www.grymoire.com/Unix/Awk.html http://linux.die.net/man/1/awk http://m.linuxjournal.com/article/8913
http://www.computerhope.com/unix/uawk.htm

Similar Documents

Premium Essay

Lux 211

...the command you used. 3. Sort the file by last name and display the output on your screen with the fields separated by blanks instead of colons. 4. Modify number three so that the last name is printed before the first name. Display records only for people in Michigan. 5. Create a directory called archives. Then create three files called first.memo, second.memo, and third.memo. Create a shell script that will move the files into the archives directory. The script should also change the names of the files to first.memo.old, second.memo.old etc. You will need to demonstrate this to me when you have finished it. 6. Create two files with the following contents. File 1 Windows 7 Solaris Open BSD File 2 Linux NetWare Windows 10 AIX 7. Combine the two files together in alphabetical order (use the sort command), with the results displayed on the screen. Each occurrence of the word Windows should be replaced with the phrase unstable OS. Show the command you used. 8. Modify number seven so the results are stored in a new file. Show the command you used. 9. Search the results file for all occurrences of the word unstable. Show the command you used. 10. How many users on our system are named Smith? Show the command you used. 11. Modify your .bashrc file so that it disables messaging, prohibits the accidental overwriting of files, and displays a greeting showing your login name each time you log in (hint: your login...

Words: 447 - Pages: 2

Premium Essay

Redhat

...edhat® ® Te r r y C o l l i n g s & K u r t W a l l UR ON IT OOLS IN Y T C E CD-R L TH O ED UD M Linux Solutions from the Experts at Red Hat ® ® P R E S S™ SEC Red Hat® Linux® Networking and System Administration Red Hat® Linux® Networking and System Administration Terry Collings and Kurt Wall M&T Books An imprint of Hungry Minds, Inc. Best-Selling Books G Digital Downloads G e-Books G Answer Networks e-Newsletters G Branded Web Sites G e-Learning New York, NY G Cleveland, OH G Indianapolis, IN Red Hat® Linux® Networking and System Administration Published by Hungry Minds, Inc. 909 Third Avenue New York, NY 10022 www.hungryminds.com Copyright © 2002 Hungry Minds, Inc. All rights reserved. No part of this book, including interior design, cover design, and icons, may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording, or otherwise) without the prior written permission of the publisher. Library of Congress Control Number: 2001093591 ISBN: 0-7645-3632-X Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 1O/RT/QT/QS/IN Distributed in the United States by Hungry Minds, Inc. Distributed by CDG Books Canada Inc. for Canada; by Transworld Publishers Limited in the United Kingdom; by IDG Norge Books for Norway; by IDG Sweden Books for Sweden; by IDG Books Australia Publishing Corporation Pty. Ltd. for Australia and New Zealand; by TransQuest Publishers Pte Ltd. for Singapore, Malaysia, Thailand...

Words: 220815 - Pages: 884

Free Essay

Linux Kernels and Shells

...Linux kernels and shells Windows and Mac computer systems have one central kernel that abstracts the hardware so the operating system can manage it. Linux is more customizable because it allows you to create your own kernel. I have been hired as an IT consultant and have been asked to write a manual on the kernel distributions of Linux. The kernel is a program that constitutes the central core of a computer operating system. It has complete control over everything that occurs in the system. The shell is the outermost part of the operating system thusly why it was given its name. The shell is a program that interacts with user commands while the kernel itself does not interact directly with the user, but instead it interacts with the shell and other programs as well as with the hardware devices on the system. While there are countless amounts of distributions available there is a distinct top five distributions that are used with Linux. The first one, rightly so as it is one of the earliest distributions that were created, is Red Hat. Red Hat is one of the most popular distributions for Linux, it is widely used for personal computers and with businesses also. It has a great community support division called the Fedora Core who does a great job with support and is a major reason for the popularity of Red Hat. The next distribution on the list is Debian. Debian is the most popular community created distribution for Linux. While it is really flexible and very reliable the user...

Words: 747 - Pages: 3

Free Essay

Case Project

...Project Student College Case Project Linux as an operating system is a powerful tool used in businesses for its secure kernel and command line interface. From a small business to a large enterprise, Linux is used to run servers, store vital information and documents. In Outdoor Adventures, this store needs a more efficient computing system. The system will need to keep information available and secure enough to ensure that the information can only be seen by the right people. To help keep things organized, a file structure will also be required to keep all the files with special permissions together for easy access. To better illustrate the security capabilities of Linux Ed Sawicki of Biznix.org said, “The Linux firewall has functionality that rivals expensive commercial firewalls. Its rules allow fine grained control over stateless and stateful packet filtering. The Linux firewall is extensible, allowing new filtering capabilities as the need arises.” This comparison is powerful when considering what would be the most cost effective direction for a business, but also the safest. Another advantage of linux is that it is generally free to try before applying it to a commercial setting. The product can in effect speak for its self by allowing itself to be made publicly available so there is no need to consider it a “business risk” when a technician can experiment with it first before applying it on a much grander scale. “Linux…is a freely available multitasking and multiuser...

Words: 1333 - Pages: 6

Free Essay

Virtual Desktop Infrastructure

...Assignment 3: Evaluate Virtual Work Software Virtual Desktop Infrastructure Jeanette Johnson Lawrence Technological University MIS 7463 – Virtual Work Environments – Spring 2013 Dr. Anne Kohnke, Assistant Professor of IT, College of Management April 13, 2013 Contents Product Description and Application 3 Major Issues 4 Why the Need for VDI? 4 Is VDI for Everyone? 5 Successful Application of VDI 5 What Exactly Does VDI Offer Organizations? 5 Oracle Virtual Desktop Infrastructure Specifications….at a Glance 7 Reviews 8 What Oral Roberts University has to say about VDI 8 Scripps Networks’ Review of VDI 10 What Small Business Computing Reviewer, Joe Moran, Thinks of VDI 10 Summary and Interpretation of Reviews 11 Implementation 12 VDI Project Plan: Start with Using the Proper Apps and Utilize Pilot Program 13 VDI Licensing: Be Wary about Going for the $40 (or less) per Desktop Guarantee 13 Ensure you Tackle VDI Storage Challenge with Network-Attached Storage (NAS) System and Data Deduplication 14 Factors to Consider When Considering Whether or Not to Implement VDI 15 Conclusion 16 VDI offers Better Support 16 VDI Helps Strengthen Security 16 The BYOD Crowd will Be Happier with VDI 17 Product Description and Application Virtual Desktop Infrastructure (VDI) is simply the practice of hosting desktop operating systems (OS) in a virtual...

Words: 4825 - Pages: 20

Premium Essay

Operating Systems

...software applications can operate accordingly. Operating systems can be found in almost any type of a computer device such as personal computers, supercomputers, cellular telephones, and video game consoles as stated by Linux Systems (2011). As the research was being conducted for this paper, it raised a question whether the internet uses the operating system? It proved to be a challenge to actually pin point the most common operating systems on the Internet, but as the research continued, it was obvious that these three, Windows, Mac OS X, and Linux are considered to be the most common operating systems used on the Internet today. Background of each Operating System Windows Privately owned operating systems, Microsoft Windows is generally used on personal computers and as of today, the most commonly used version is Windows XP with the new version of Windows 7 for personal computers and Windows Server 2008 R2 for servers is entering the market. Mac OS X Mac OS X is a graphical operating system which is designed and distributed by Apple Incorporated is considered to be partially privately owned. Its latest version of software is pre-loaded on all of the Macintosh Computers and is also a UNIX operating system that uses advanced technology. Linux Is an operating system that can be used on a variety of devices such as personal computers, supercomputers, and some hand...

Words: 1150 - Pages: 5

Free Essay

Random Walk Shoes

...disk storage, 6.5G RAM and Intel or AMD company’s Dual-core CPU. However, today most companies sell at least 500GB disk storage on market. For example, Dell sell T320 tower server series is good choice. 2. Most Web server software runs on Microsoft Windows Server products, Linux, or other UNIX-based operating systems such as FreeBSD. They have both advantages and disadvantages. ----- | advantages | disadvantages | Microsoft | Simpler for their information systems staff to learn and use than UNIX-based systems. | Security weaknesses | Linux | An open-source operating system, Fast, efficient, easy to install. Downloaded free from web, user-friendly like Microsoft, Secure and stable | Compatibility | UNIX | Secure and stable operating system | user-friendly is not good, need type the command code, | I will recommend Amy choose Linux because it is an open-source operating system. Linux can be downloaded free from the Web. For some small and medium-sized companies, they don’t need to buy window. Linux system security is very high, unlike Windows system often update and close loophole. Especially, LAMP is very popular combination for Web server computer construction today. That means Linux + Apache + MySql + PhP. 3. The two commonly used Web server programs is Apache Http Server and Microsoft Internet Information Server (IIS). The NetCraft Web server surveys show that...

Words: 462 - Pages: 2

Premium Essay

Cis 210 Term Paper

...Benjamin Porter 12/13/13 Benjamin Porter 12/13/13 Abstract Developing and designing an effective in house e-commerce website for Tony’s Chips. Abstract Developing and designing an effective in house e-commerce website for Tony’s Chips. Website MIGRATION PROJECT [Document subtitle] Website MIGRATION PROJECT [Document subtitle] Introduction Tony’s Chips has been acquired by a new independent company. The new company’s intention is to focus on the e-commerce website that they have planned. Currently, the old website is externally hosted and it is required to be moved to an internal one. This new system will store, retrieve, and have data recovery solutions for the company. An additional backup site will need to be created as a failover if the main site goes down. The new and improved site will need to allow customers access to order products online. Project Goal This project has an overall goal of producing a system and website that is in accordance to the demands of Tony’s Chips. The systems architecture will involve all of the systems requirements in its design. The architecture will make use of programs that perform efficiently and properly. Application compatibility is also key to for all of the system components that are going to be used in the system. The project is also aimed at creating a reliable backup and recovery solution for the system. Available system component alternatives The requirements for the system is one that has a system architecture...

Words: 2669 - Pages: 11

Free Essay

Assignment 1

...Accessing the Oracle Server Adewale Sonubi Professor Brian Smith CIS 111: Introduction to Database Management System October 13, 2013 Through this assignment, I was able to experience logging into the Strayer University Oracle Server. The process started a little rough for me because I did not have the necessary credentials, but once I received them from I was able to log in. the screen I attained at the end of the exercise is shown below: I googled putty on the google search engine and found www.putty.org; I was able to save the download on my desktop for future use. One I opened it, I entered “unix-online.strayer.edu” in the host section using port 22. I also entered “Student UNIX Server” I the saved session and saved it also for future use. After entering both required information, I clicked “OPEN” and the command screen opened. I was prompted for a login and password of which I entered the information provided to me by the professor and I was able to log into the UNIX server. I also typed in the oracle command provided to me and I was able to log into the oracle server. I made sure I tried the process more than once to ensure I properly understand the process. After finishing the exercise, I searched for the snipping tool on my desktop, and was able to take a snapshot of the screen and save to my desktop. I then copied and pasted the screen into this document to show that the assignment was done and that my credentials...

Words: 276 - Pages: 2

Free Essay

Capstone Final Documentation

...CNS Capstone A COMPREHENSIVE NETWORK DEVELOPMENT PROJECT SUBMITTED TO THE IT / COMPUTER NETWORKS SYSTEMS PROGRAM IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE ASSOCIATE DEGREE By Instructor – Roman Danyew Table of Contents Introduction to Cornerstone Communications………………………….................. 3 STAR MEDICAL’s Proposal Overview ……………………………….................. 4 Executive Summary………………………………………………………………... 6 Assumptions and Constraints………………………………………………………. 7 Deliverables………………………………………………………………………... 8 Project Details Implementation and Timeline……………………………………………… 9 Network Topology........................................................................................ 11 IP Schema…………………………………………………………………. 16 Security…………………………………………………………………….. 17 Active Directory Structure…………………………………………………………. 18 Active Directory and Exchange……………………………………………………..19 Website hosting and developing…………………………………………………… 20 Maintenance and Training Plan …………………………………………………….22 Risk Analysis………………………………………………………………………. 23 Backup Plan…………………………………………………………………………24 Cost Analysis………………………………………………………………………. 25 Appendix…………………………………………………………………………… 26 Appendix A: Cost Analysis…………………………………………………27 Appendix B: Hardware…………………………………………………….. 29 Introduction to Cornerstone Cornerstone Communications has been providing networking and data communications...

Words: 7795 - Pages: 32

Free Essay

A Small Clothing Store

...Network Security Fundamentals CIS 333 Showcase: Security Deployment of a small network infrastructure for DRE Inc. Submitted By Rene Dell Submitted To Dr. Lawrence Joseph March, 2012 Table of Content Abstract ……………………………………………………………………….I Introduction……………………………………………………………..……..II The Problem Statement………………………………………………….……..III The Proposed Solution………………………………………………………….IV The Methodology………………………………………………………………..V The Result……………………………………………………………………….VI The Conclusion………………………………………………………………….VII References……………………………………………………………………….VIII Abstract DRE Inc is a company that produces wrist watches for men and women. The company started in 1999 with just about 10 member staffs in Takoma, Maryland. Now more than 12 years later, DRE has grown to a company of over 500 employees, and has departments in Washington DC, Virginia, Maryland and the head quarters in New York City. This growth has allowed for an increased problem in the network infrastructure and management for the company. Introduction: DRE Inc has four major departments, sales in Maryland, Manufacturing in Washington Dc, Warehouse in Virginia, and the Accounting Department in New York City. The proposed network will have four routers, to serve each location. The Proposed Solution Figure 1a DRE Inc Organizational Chart The Proposed solution will include the following: 5 Cisco routers 1 Cisco PIX 500 Firewall 4 Cisco switches Mail Server, Print Server, database...

Words: 855 - Pages: 4

Free Essay

Miss

...Contribute • Submit an Article • Submit a Poll Current Poll What is your /etc/mtab? a regular file a link to /proc/mounts something else... ( 620 votes ~ 5 comments ) Recent Weblogs TCP weirdness, IMAP, wireshark, and perdition by dkg 6 comments mod-fcgi terminated by calling exit() by simonw Brief updates and some advice by kumanna Linux/Ubuntu on an Asus UL30A (QX130V) by mnaumann 1 comment Installing Debian onto an Asus A6Q00KM by ajt 1 comment Ingo Steinke by fraktalisman Popularity vs. stagnation by Steve 11 comments Lenny guest and Hyper-V by e5z8652 Burst of GET / requests on Apache2 by k2 3 comments Munin 1.4.0 alpha released by stab More Weblogs • Archived Weblogs Debian Administration System Administration Tips and Resources [ About | Adverts | Archive | FAQ | Hall of Fame | Search | Tag Cloud | Securely erasing files, by filling your disk Posted by Steve on Sat 2 Jan 2010 at 14:34 Tags: filesystems, secure-delete, security, utilities With modern filesystems securely deleting files isn't always easy, but one approach which stands a good chance of working is to write random patterns over all unused areas of a disk - thus erasing the contents of files you've previously deleted. ( Read 293 more words ~ 11 comments posted ) Creating Bind DNS-Entries with regular dyndns-clients in routers Posted by stefanbauer on Thu 31 Dec 2009 at 10:46 Tags: bind, dynamic dns, perl Recently there was a message posted upon the debian-user-german...

Words: 987 - Pages: 4

Premium Essay

Linux Operating System

...Joseph Silva 4/1/12 Linux Operating System Assignment 2 1. KDE and GNOME 2. Panel- Panels are bars that appear on the desktop and hole (panel) objects. They are part of the desktop, so they remain consistent across workspaces. Menu Bar- The menu bar appears at the top of the File Browser window and displays a menu when you click one of it selections. Applet- an applet is a small program that displays its user interface on or adjacent to the panel. You interact with the applet panel object. The clock and workspace switcher are applets. Notification Area- the notification area is a portion of the taskbar that provides temporary source for notifications and status. It can also be used to display icons for system and program features that have no presence on the desktop. Shading- its shrinks the window so only the title is visible. Location Bar- below the main tool is the location bar, which displays the name of the directory that appears in the view pane. Nautilus- displays emblems in both its icon and list views, although there may not be room for more than one emblem in the list view. Nautilus grays out items you are not allowed to change. Workspace- workspaces divide the desktop into one or more areas, with one such area filling the screen at any given time. Initially there are two workspaces. All workplaces display the same panels and objects. Workspace Switcher- the number of workspaces the switcher displays changes as you changes the number in...

Words: 350 - Pages: 2

Premium Essay

Exploring Linux Operating Systems

...Exploring Linux Operating Systems What is Linux? Linux is an Operating System for a computer; it is like other Operating Systems such as Windows and the OS X for MAC. Linux was created in 1991 and has been found on many different systems like Super Computers, cell phones, and even the New York stock exchange. What sets Linux apart from other Operating Systems is that Linux is made by several different companies. According to www.linux.com over 3,200 developers have from 200 companies have contributed to the kernel which is just a small piece of the distribution. How is Linux used today? While other Operating Systems are very limited to personal computing devices, Linux is not limited it can be found on many different things. Linux had its start as a server Operating System but is also one of the only Operating System that can be found on more than just a personal computer. Some of the different things it can be found on taken from www.linux.com “These are just the most recent examples of Linux-based devices available to consumers worldwide. This actual number of items that use Linux numbers in the thousands.” www.linux.com File Editors Coming from a Windows Operating System pretty much my whole life, which means I only have experience with GUI editors such as Notepad from Windows. After working with Linux and its file editors this past week I found it much faster and easier than using the notepad system in Windows. There are two different kinds of editors...

Words: 1308 - Pages: 6

Free Essay

Unit 2 Discussion

...Unit 2 Discussion 1: Identifying Layers of Access Control in Linux Learning Objectives and Outcomes * You will be able to identify various layers of access control in a Linux server environment. * You will make security recommendations using different layers of access control. Assignment Requirements Really Cheap Used Computers, Inc. is an online seller of old school computers. The organization’s e-commerce Web site runs on a Linux server. The server is located at the organization’s local office in Boston, Massachusetts. The company has experienced tremendous growth and has hired you as the new security analyst. You access the server and find that there are virtually no layers of security other than the passwords set for user accounts. Discuss at least three layers of access control that can be put in place on this server to create a more secure environment. Rationalize whether the given scenario represents discretionary access control (DAC) or mandatory access control (MAC). Participate in this discussion by engaging in a meaningful debate regarding your choices of the three layers of access control in Linux. You must defend your choices with a valid rationale. Summarize your thoughts in a Word document and submit it to your instructor. Required Resources None Submission Requirements * Format: Microsoft Word * Font: Arial, Size 12, Double-Space * Citation Style: Chicago Manual of Style * Length: 1–2 pages * Due By:Unit 2 Assessment Checklist ...

Words: 568 - Pages: 3