I am new to Linux. When I create a new file .gitignore under current directory using bash, I found out that I can do:
> .gitignore
or
touch .gitignore
It seems they do the same thing. When I check the manual for touch
, it says change timestamp for the current file, but there is no manual for >
. So can someone explain what can >
do and is there any difference in using these two commands under this context? Thanks.
man bash
. It's a long document and will take days or even weeks to understand well, but it's well worth going through if you want to learn Bash thoroughly.