![文件名前的@(at)符号在curl命令中意味着什么?](https://linux22.com/image/39760/%E6%96%87%E4%BB%B6%E5%90%8D%E5%89%8D%E7%9A%84%40%EF%BC%88at%EF%BC%89%E7%AC%A6%E5%8F%B7%E5%9C%A8curl%E5%91%BD%E4%BB%A4%E4%B8%AD%E6%84%8F%E5%91%B3%E7%9D%80%E4%BB%80%E4%B9%88%EF%BC%9F.png)
我正在看一个curl
命令示例它在文件名之前使用 @ 符号将数据发送到服务器。
curl http://localhost/ --data-binary @file.txt
这是什么意思?它是否将文件的内容插入到命令中?它具体针对吗curl
?
答案1
它是特定于卷曲的。从man curl
:
--data-binary <data>
(HTTP) This posts data exactly as specified with no extra processing whatsoever.
If you start the data with the letter @, the rest should be a filename. Data is
posted in a similar manner as --data-ascii does, except that newlines are preserved
and conversions are never done.
If this option is used several times, the ones following the first will append data
as described in -d, --data.