


What is the difference between '<' and '<<' in linux
Difference:
In Linux, > means overwriting the original file content (the date of the file will also be automatically updated), >> means appending the content (it will start a new file) line, the date of the file will also be updated automatically).
(Recommended tutorial: linux tutorial)
Example:
1. Save the results of the history command execution to the history.log file
[root@gxzs-solr1 ~]# history > history.log (history.log 文件 会自动生成) [root@gxzs-solr1 ~]# cat history.log
2. Execute the command curl 'xxx' and save the return result in log.log
[root@gx-solr1 ~]# curl 'http://192.168.0.110:8983/solr/scan_detail/admin/file?_=1544066402749&contentType=text/plain;charset=utf-8&file=managed-schema&wt=json' > log.log
3. Execute the command cat /etc/hosts and save the return result in hosts.log中
[root@slave1 ~]# cat /etc/hosts > hosts.log [root@slave1 ~]# more hosts.log 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Note: When using > , when executing a command, a new file following > will be generated each time, replacing the previously generated file (the file creation time will also change accordingly).
The above is the detailed content of What is the difference between '<' and '<<' in linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Android TV Box gets unofficial Ubuntu 24.04 upgrade

deepseek web version entrance deepseek official website entrance

BitPie Bitpie wallet app download address

BITGet official website installation (2025 beginner's guide)

Detailed explanation: Shell script variable judgment parameter command

Zabbix 3.4 Source code compilation installation

Ouyi okx installation package is directly included
