SDET- QA Automation Techie

Software Testing Blog

  • Home
  • Training
    • Online
    • Self-Paced
  • Video Tutorials
  • Interview Skills
    • HR Interview Questions Videos
    • Domain Knowledge
  • Career Guidance
  • Home
  • Software Testing
    • Manual Testing Tutorials
    • Manual Testing Project
    • Manaul Testing FAQS
    • ISTQB
    • AGILE
  • Web Automation Testing
    • Java Programmng
    • Python Programmng
    • Selenium with Java
    • Selenium with Python
    • Robot Framework(Selenium with Python)
    • selenium with Cucumber
    • TestNG+IntelliJ
    • Mobile App Testing(Appium)
    • JMeter
  • API Automation Testing
    • Rest Assured API Testing (BDD)
    • Rest Assured API Testing (Java+ TestNG)
    • Robot Framework(Rest API Testing with Python)
    • Postman
    • SoapUI
    • API Testing(FAQ's)
  • SDET|DevOps
    • Continuos Integration
    • SDET Essentials
    • AWS For Testers
    • Docker
  • SQL
    • Oracle(SQL)
    • MySQL for Testers
    • NoSQL
  • Unix/Linux
    • UNIX TUTORIALS
    • Linux Shell Scripting
  • ETL Testing
    • ETL Data warehouse Tutorial
    • ETL Concepts Tools and Templates
    • ETL Testing FAQ's
    • ETL Testing Videos
  • Big Data Hadoop
  • Video Tutorials
  • ApachePOI Video Tutorials
  • Downloads
    • E-Books for Professionals
    • Resumes
  • Automation Essencials
    • Cloud Technologies
      • Docker For Testers
      • AWS For Testers
      • Sub Child Category 3
    • Java Collections
    • Selenium Locators
    • Frequently Asked Java Programs
    • Frequently Asked Python Programs
    • Protractor
    • Cypress Web Automation

Unix Filter Commands

 Linux, Shell Scripting, Unix, VI Editor   

1) grep

2) sort

3) more

4) cut

5) wc

6) uniq

1) grep: (Global Regular Expression Patern)

This command is used for searching a required patern in a file.

Syntax:

$ grep [- optopn] "search patern" Filename [redirection symbol newfilename]

Options:

-i   Ignores case sensitiveness in searching patern

-n   displays line numbers for those lines which gets matched and un matched with the patern

-c   counts number of times a searching patern exists and does not exists

-v (verbose)   Displays those lines that does not match with the patern

Example:

$ cat > paypal.txt
welcome to unix
paypal welcomes you
unix multi user os
WELCOME to the world of unix


$ grep "welcome" paypal.txt

$ grep -i "welcome" paypal.txt

$ grep -i -n "welcome" paypal.txt

$ grep -i -c "welcome" paypal.txt

$ grep -i -v "welcome" paypal.txt

$ grep -i -v -n "welcome" paypal.txt > funpal.txt


Sort : Used to arrange numbers/text in ascending/descending order.

* by default it arrages ascending order.

Syntax:

$ sort [-option] [redirection synbol ] filename [redirection synbol] [new filename]

options:

-r   Arrage data in reverse or descending order

-n   Arrage data in ascending or descending order by considering whole number.

* if n is not used then numbers gets arranged in order based on 1st digit.

Ex1:

$ sort > paypal.txt
6
2
9
1
5
3

$ cat paypal.txt      Ascending order

$ sort -r paypal.txt > funpal.txt     Descending order

$cat funpal.txt

Ex2:

$ sort >google.txt
176
2165
8
93
-----
------ [ctrl+d]

$cat google.txt     It considered first digit

$sort -n google.txt > yahoo.txt    It considered whole number.

more: This filter command used to display information from multiple files based n page wise.

It gives an identification of end of file for first file and begining of next file.

Syn:

$more [-option] file1,file2,file3, etc...

options:

-p   clears the screen and displays next file in the list of files

*note:

Enterkey retrives next file based on %s
spacebar retrieves complete data from next file

Ex: $more - p paypal.txt   funpal.txt

cut: Used to cut the required text from a file.It can cut the data on the columns and feilds.

Syntax:

$ cut [-option] filename [redirection symbol new filename]

-c   To cut the data in columns

-f    To cut the data in feilds that is that data which is separated by tab.

Ex1:

$ cat>paypal.txt
Hyderabad
Secunderabad
Andhra [ctrl+d]

$ cut -c1 paypal.txt    [Enter]
H
S
A

$cut -c3 paypal.txt     [Enter]

d
c
d

$cut -c1 -3 paypal.txt [Enter]

Hyd
Sec
And

Ex2:

$cat > funpal.txt [Enter]
India    Delhi
Andhra    Hyderabad
Peers    Net      
[ctrl+d]

$ cut   -f1   funpal.txt     [Enter]
India
Andhra
Peers

$ cut   -f2   funpal.txt    [Enter]

Delhi
Hyderabad
Net

wc: It will count number of lines,worlds,characters in a file.

Syntax:

$ wc [-option] filename

options:

-l    count number of lines

-w   count number of words

-c   count number of characters

Ex:

$ wc -l paypal.txt

$ wc -w paypal.txt

$ wc -c paypal.txt

uniq: This filter is used to get the uniq or duplicate lines from a file.Data should be in order.

Syntax: $ unix [-option]   filename

options:

-d   Display duplicate lines

-u   Display uniq lines

-c   Counts number of times each word has occured in a file

Ex:

$ cat > city.txt
ameerpet
ameerpet
peers
bhel
hyderabad
ameerpet
peers
secunderabad   [ctrl+d]

$ sort city.txt> city1.txt

$cat city1.txt      Ascending order of data displaying

$ uniq -u city1.txt

$ uniq -d city1.txt

$ uniq -c city1.txt
 
 
 
 
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to TwitterShare to Facebook
Newer Post Older Post Home
popup

Popular Posts

  • How To Explain Project In Interview Freshers and Experienced
    “ Describe an important project you’ve worked on ” is one of the most common questions you can expect in an interview. The purpose of a...
  • MANUAL TESTING REAL TIME INTERVIEW QUESTIONS & ANSWERS
    1. How will you receive the project requirements? A. The finalized SRS will be placed in a project repository; we will access it fr...
  • API/Webservices Testing using RestAssured (Part 1)
    Rest Assured : Is an API designed for automating REST services/Rest API's Pre-Requisites Java Free videos: https://www.you...

Facebook Page

Pages

  • Home
  • Resumes
  • Job Websites India/UK/US
  • ISTQB
  • Selenium with Java
  • E-Books for Professionals
  • Manual Testing Tutorials
  • Agile Methodology
  • Manual Testing Projects

Live Traffic

YouTube


Blog Visitors

Copyright © SDET- QA Automation Techie | Powered by Blogger
Design by SDET | Blogger Theme by | Distributed By Gooyaabi Templates