Search code examples
unixcommand-linecat

What does "@" at the command line mean?


What is the effect of putting "@" before something (like the path of a file containing classpath entries for a Java run command)?

I know it's something to do with file contents but as you can imagine trying to search for it on Google is a bit difficult. I can't locate a manpage that talks about it either.


Solution

  • It can mean different things in different programs. As a convention @file at command-line could be interpreted as:

    Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed. Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively. from ld docs for @file