Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between double and single bigger than in linux terminal

what is the difference between " > " and ">>" in linux i know it has to do with redirection but not sure what is exactly the difference

example: ls > a.txt ls >> a.txt

like image 842
Amine Bekki Avatar asked Nov 23 '15 02:11

Amine Bekki


People also ask

What is the difference between and >> in Linux?

So, what we learned is, the “>” is the output redirection operator used for overwriting files that already exist in the directory. While, the “>>” is an output operator as well, but, it appends the data of an existing file. Often, both of these operators are used together to modify files in Linux.

What is the difference between and >> in bash?

The > sign is used for redirecting the output of a program to something other than stdout (standard output, which is the terminal by default). The >> appends to a file or creates the file if it doesn't exist.

What does >> mean in Unix?

The “>” is an output operator that overwrites the existing file, while “>>” is also an output operator but appends the data in an already existing file. Both operators are often used to modify the files in Linux.

What is the difference between $* and $@ in Linux?

$* Stores all the arguments that were entered on the command line ($1 $2 ...). "$@" Stores all the arguments that were entered on the command line, individually quoted ("$1" "$2" ...).


1 Answers

You'll find them on manual, https://www.gnu.org/software/bash/manual/html_node/Redirections.html.

Actualy, > is for stdout redirection to file, which is rewrite entire file. >> is for append stdout output to the last line.

like image 199
ibrohimislam Avatar answered Oct 21 '22 13:10

ibrohimislam