Unix File Access Permissions - Chmod

chmod: It provides permissions over a file in 3 catagories.

1) owners

2) groups

3) others

Permissions which can be granted are read,write and execute

1) read (r)

2) write (w)

3) execute (e)

These permissions are represented with numeric values

r -   4

w -  2

e -   1

Owners are users whose files gets referred from their respective accounts.

Groups are users whose accounts are dependent on the other accounts.

Others are users who can access the files of other users.

Chmod command is used to change the permissions for a file or directory.


$ chmod  FAP  Filename    

* FAP is file access permissions


$ chmod ooo  paypal.txt

No permissions to owners,groups and others

$ chmod 777  paypal.txt

All permissions to owners,groups and others

$ chmod 444  paypal.txt

Read permission to owners,groups and others (4 - read)

Unix File compare commands

1. cmp

2. diff


cmp: It comapares 2 files.If files are same it returns promp or else it returns the message where the difference encountered.

Syn: $ cmp file1 file2

Ex: $ cmp  paypal.txt   funpal.txt

diff: This command compares 2files like cmp.If any difference found in 2 files it displays those lines.


Unix Filter Commands

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.


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


-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


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

Unix Miscellaneous commands

  1. ls
  2. pwd
  3. ln
  4. head
  5. tail
  6. cal
  7. ps
  8. kill
  9. who
  10. whoami
  11. uptime
  12. ut
ls : This command displays files and directories in columnar format.


$ ls

$ ls -S                

Aarrange the files based on the size(S is upper letter)

$ ls -l                

long listing the files

$ ls -a                

Displays hidden files

$ ls -i 

Displays inodes for each file

$ ls -R            

Displays all directories along with subdirectories in current working directory.

Unix directory commands




mkdir: Creating a directory which has set of files & sub directories.


$mkdir directory name


$mkdir hyd

$mkdir chennai

cd: Used for changing/closing directory

Unix File Commands

1) cat

2) cp

3) mv

4) rm

cat command: cat command is used for various purposes.

1) Creating the new file

2) Display content of the file

3) Concatinating more than one file

4) Appending data to the existing file

5) Copying many files in to one single file.


$cat [Filename]

* File name should be upto 255 characters.


1) Creating the new file:

$cat >paypal.txt





2) Dispay data in the file:

Regular Expressions

What is Regular Expression?

It is a way of representing data using symbols. They are often used within matching, searching or replacing algorithms.

Regular Expressions in QTP:

Regular expressions can be used in QTP for identifying objects and text strings with varying values.

Where we use:

o Defining the property values of an object in Descriptive programming for handling dynamic objects

o For parameterizing a step

o creating checkpoints with varying values

Using Regular Expressions in QTP:

We can define a regular expression for a constant value, a Data Table parameter value, an Environment parameter value, or a property value in Descriptive programming.

We can define a regular expression in standard checkpoint to verify the property values of an object; we can set the expected value of an object's property as a regular expression so that an object with a varying value can be verified.

We can define the text string as a regular expression, when creating a text checkpoint to check that a varying text string is displayed on our application,

For XML checkpoints we can set attribute or element values as regular expressions.

Test Case Writing

1) How do we write test cases without documents or knowing the requirements?

We can go to adopt a testing technique called Exploratory Testing. According to James Bach exploratory testing is defined as "an interactive process of concurrent product exploration, test design, and test execution."

2) What are the test cases for one Rupees Coin Box (Telephone box)?

Positive test cases:

TC1: Pick up the Handset
Expected: Should display the message “Insert one rupee coin"

TC2: Insert the coin
Expected: Should display the message “Dial the Number"

TC3: When you get a busy tone, hang-up the receiver
Expected: The inserted one rupee coin comes out of the exit door.

TC4: Finish off the conversation and hang-up the receiver
Expected: The inserted coin should not come out.

TC5: During the conversation, in case of a local call, (assume the duration is of 60 sec), when 45 as are completed
Expected: It should prompt you to insert another coin to continue by giving beeps.

TC6: In the above scenario, if another coin is inserted
Expected: 60 sec will be added to the counter.

TC7: In the TC5 scenario, if you don't insert one more coin.
Expected: The call gets ended.

TC8: Pick up the receiver. Insert appropriate one rupee coin; Dial the number after hearing the ring tone. Assume it got connected and you are getting the ring tone. Immediately you end up the call.
Expected: The inserted one rupee coin comes out of the exit door.

3) Explain about Use Cases?

Agile Software Development

Refers to a group of software development methodologies based on iterative development, where requirements and solutions evolve through collaboration between self-organizing cross-functional teams. The term was coined in the year 2001 when the Agile Manifesto was formulated.

Agile methods generally promote a disciplined project management process that encourages frequent inspection and adaptation, a leadership philosophy that encourages teamwork, self-organization and accountability, a set of engineering best practices intended to allow for rapid delivery of high-quality software, and a business approach that aligns development with customer needs and company goals.

Conceptual foundations of this framework are found in modern approaches to operations management and analysis, such as lean manufacturing, soft systems methodology, speech act theory (network of conversations approach), and Six Sigma.

There are many specific agile development methods. Most promote development iterations, teamwork, collaboration, and process adaptability throughout the life-cycle of the project.

Agile methods break tasks into small increments with minimal planning, and do not directly involve long-term planning. Iterations are short time frames ("timeboxes") that typically last from one to four weeks. Each iteration involves a team working through a full software development cycle including planning, requirements analysis, design, coding, unit testing, and acceptance testing when a working product is demonstrated to stakeholders. This helps minimize overall risk, and lets the project adapt to changes quickly. Stakeholders produce documentation as required. An iteration may not add enough functionality to warrant a market release, but the goal is to have an available release (with minimal bugs) at the end of each iteration.[1] Multiple iterations may be required to release a product or new features.

Team composition in an agile project is usually cross-functional and self-organizing without consideration for any existing corporate hierarchy or the corporate roles of team members. Team members normally take responsibility for tasks that deliver the functionality an iteration requires. They decide individually how to meet an iteration's requirements.