What is the difference between > and >> operators?

Answers were Sorted based on User's Feedback



What is the difference between > and >> operators? ..

Answer / swapna

The '>' operator is used to create a file whereas '>>'
operator is used to append files.

Is This Answer Correct ?    12 Yes 0 No

What is the difference between > and >> operators? ..

Answer / uday kumar_anem

'>' operator is used to create files. If the file is doesnt
exists, it creates and writed the content into that file.

If the file is already exists, then the content willl be
overwritten.

where as '>>' operator is used to append the content at the
end.

Is This Answer Correct ?    11 Yes 0 No

What is the difference between > and >> operators? ..

Answer / jacco noordhuizen

If a file does not exist both > and >> operators will create the file.
If a file does exist > operator will overwrite the contents of that file.
If a file does exist >> operator will append to the end of that file.

Example of use of both operators:
"echo blabla > testfile"
This will create a file called "testfile" with the text "blabla" in its content.
If there already was a file called "testfile" it will replace its content with the text "blabla"

and
"echo blabla >> testfile"
This will create a file called "testfile" with the text "blabla" in its content.
If there already was a file called "testfile" it will add the text "blabla" at the end of the files content.

Is This Answer Correct ?    5 Yes 0 No

What is the difference between > and >> operators? ..

Answer / pradeep.k

'>' operator is used to overrite the file if the file is
already exist. otherwise it will create new file and we can
insert data in to that file.
'>>' operator is used to append the new data which we are
entering to already existing data in the file, means
concatinating the newly entered data to existing data in a file.

Is This Answer Correct ?    2 Yes 0 No

What is the difference between > and >> operators? ..

Answer / biswajit

'>' operator creates a new file whereas '>>' operator adds
contents on the existing file

Is This Answer Correct ?    1 Yes 0 No

What is the difference between > and >> operators? ..

Answer / amitava sanyal

If we save another output in neha.tet with redirection (>) it will overwritten the output in neha.txt, we can use (>>) instead of (>).
For example:
$date>neha.txt
$ls-l>>Naha.txt

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix AllOther Interview Questions

What is the main advantage of creating links to a file instead of copies of the file?

5 Answers   Cisco, ING,


What is the number of the masked code ee@?

2 Answers   Accenture, Amazon, Amdocs,


The UNIX shell is.... a).does not come with the rest of the system b).forms the interface between the user and the kernal c) does not give any scope for programming d) deos not allow calling one program from with in another e) all of the above

2 Answers   IBM,


What is YACC?

0 Answers   Cisco,


Have you used VI editor?

1 Answers   BMC,






What UNIX command will control the default file permissions when files are created?

3 Answers  


i am prepairing for 2+ yrs exp in oracle/unix production support,can u tell me which type issue comes in server plz help

0 Answers   Crimson Logic,


HOW DO CREATE A NFS FILE SYSTEM

4 Answers   Mind Tree,


What is ant_build.sh? Have u seen that file?

0 Answers   BMC,


how can we create the script in crontab at mid night on sunday,satuarday,fiday 0n monyh october,november,january? please give me answer if anybody knows ? because on important purpose.

2 Answers  


How to setup display for a remote system?

3 Answers  


What is the difference between hard link & softlink?

2 Answers  


Categories