O'Reilly logo

Mac OS X Panther in a Nutshell, 2nd Edition by Jason McIntosh, Chuck Toporek, Chris Stone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Syntax

This subsection describes the many symbols peculiar to bash. The topics are arranged as follows:

  • Special files

  • Filename metacharacters

  • Command-line editing

  • Quoting

  • Command forms

  • Redirection forms

  • Coprocesses

Special Files

File

Purpose

/etc/profile

Executed automatically at login.

$HOME/.bash_profile

Executed automatically at login.

$HOME/.bashrc

Executed automatically at shell startup.

$HOME/.bash_logout

Executed automatically at logout.

$HOME/.bash_history

Record of last session’s commands.

$HOME/.inputrc

Initialization file for reading input in an interactive shell.

/etc/passwd

Source of home directories for ~name abbreviations.

Filename Metacharacters

Characters

Meaning

*

Match any string of zero or more characters.

?

Match any single character.

[ abc ...]

Match any one of the enclosed characters; a hyphen can be used to specify a range (e.g., a-z, A-Z, 0-9).

[ !abc... ]

Match any character not among the enclosed characters.

[ ^abc ...]

Same as [! abc ...].

{ str1 ,...}

Brace expansion: match any of the enclosed strings.

~ name

Home directory of user name. With no name, Home directory of current user.

~+

Current working directory (PWD).

~-

Previous working directory from directory stack (OLDPWD; see also the pushd built-in command).

~+ n

The nth entry in the directory stack, counting from the start of the list with the first entry being 0.

~- n

The nth entry in the directory stack, counting from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required