What does cd’s `-@` option do? What does cd’s `-@` option do? unix unix

What does cd’s `-@` option do?


It's a new option (as of bash-4.3). The changelog contains the following description:

'cd' has a new `-@' option to browse a file's extended attributes on systems that support O_XATTR.

(changelog)

Type help <name> or man bash to get more info on bash commands. (In the bash man page you can search for cd by typing / followed by a search string and enter. n to go to the next hit, shift+n to go backwards).

The bash man page contains the following:

On systems that support it, the -@ option presents the extended attributes associated with a file as a directory.


Check the man page for bash for an explanation. The relevant portion says:

If dir begins with a slash (/), then CDPATH is not used. The -P option causes cd to use the physical directory structure by resolving symbolic links while traversing dir and before processing instances of .. in dir (see also the -P option to the set builtin command); the -L option forces symbolic links to be followed by resolving the link after processing instances of .. in dir. If .. appears in dir, it is processed by removing the immediately previous pathname component from dir, back to a slash or the beginning of dir. If the -e option is supplied with -P, and the current working directory cannot be successfully determined after a successful directory change, cd will return an unsuccessful status. On systems that support it, the -@ option presents the extended attributes associated with a file as a directory. An argument of - is converted to $OLDPWD before the directory change is attempted. If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output.