Print this page
13507 some man pages need update following 13405
6308 some man pages are obsolete after moving to ksh builtins
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/alias.1.man.txt
+++ new/usr/src/man/man1/alias.1.man.txt
1 1 ALIAS(1) User Commands ALIAS(1)
2 2
3 3
4 4
5 5 NAME
6 6 alias, unalias - create or remove a pseudonym or shorthand for a
7 7 command or series of commands
8 8
9 9 SYNOPSIS
10 10 /usr/bin/alias [alias-name[= string...]]
11 11
12 12
13 13 /usr/bin/unalias alias-name...
14 14
15 15
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 /usr/bin/unalias -a
17 17
18 18
19 19 csh
20 20 alias [name [def]]
21 21
22 22
23 23 unalias pattern
24 24
25 25
26 - ksh
27 - alias [-tx] [name[= value]...]
28 -
29 -
30 - unalias name...
31 -
32 -
33 - unalias [-a]
34 -
35 -
36 26 ksh93
37 27 alias [-ptx] [name[= value]...]
38 28
39 29
40 30 unalias [-a] [name...]
41 31
42 32
43 33 DESCRIPTION
44 34 The alias and unalias utilities create or remove a pseudonym or
45 35 shorthand term for a command or series of commands, with different
46 36 functionality in the C-shell and Korn shell environments.
47 37
48 38 /usr/bin/alias
49 39 The alias utility creates or redefines alias definitions or writes the
50 40 values of existing alias definitions to standard output. An alias
51 41 definition provides a string value that replaces a command name when it
52 42 is encountered.
53 43
54 44
55 45 An alias definition affects the current shell execution environment and
56 46 the execution environments of the subshells of the current shell. When
57 47 used as specified by this document, the alias definition does not
58 48 affect the parent process of the current shell nor any utility
59 49 environment invoked by the shell.
60 50
61 51 /usr/bin/unalias
62 52 The unalias utility removes the definition for each alias name
63 53 specified. The aliases are removed from the current shell execution
64 54 environment. The -a option removes all alias definitions from the
65 55 current execution environment.
66 56
67 57 csh
68 58 alias assigns def to the alias name. The assigned def is a list of
69 59 words that can contain escaped history-substitution metasyntax. name
70 60 is not allowed to be alias or unalias. If def is omitted, the alias
71 61 name is displayed along with its current definition. If both name and
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
72 62 def are omitted, all aliases are displayed.
73 63
74 64
75 65 Because of implementation restrictions, an alias definition must have
76 66 been entered on a previous command line before it can be used.
77 67
78 68
79 69 unalias discards aliases that match (filename substitution) pattern.
80 70 All aliases can be removed by `unalias *'.
81 71
82 - ksh
83 - alias with no arguments prints the list of aliases in the form
84 - name=value on standard output. An alias is defined for each name whose
85 - value is specified. A trailing space in value causes the next word to
86 - be checked for alias substitution. The -t flag is used to set and list
87 - tracked aliases. The value of a tracked alias is the full pathname
88 - corresponding to the specified name. The value becomes undefined when
89 - the value of PATH is reset but the aliases remained tracked. Without
90 - the -t flag, for each name in the argument list for which no value is
91 - specified, the name and value of the alias is printed. The -x flag is
92 - used to set or print exported aliases. An exported alias is defined for
93 - scripts invoked by name. The exit status is non-zero if a name is
94 - specified, but no value, and no alias has been defined for the name.
95 -
96 -
97 - The aliass specified by the list of names can be removed from the alias
98 - list with unalias.
99 -
100 72 ksh93
101 73 alias creates or redefines alias definitions or writes the existing
102 74 alias definitions to standard output.
103 75
104 76
105 77 An alias definition provides a string value that replaces a command
106 78 name when the command is read. Alias names can contain any printable
107 79 character that is not special to the shell. If an alias value ends in a
108 80 SPACE or TAB, the word following the command name the alias replaces is
109 81 also checked to see whether it is an alias.
110 82
111 83
112 84 If no names are specified, the names and values of all aliases are
113 85 written to standard output. Otherwise, for each name that is specified,
114 86 and =value is not specified, the current value of the alias
115 87 corresponding to name is written to standard output. If =value is
116 88 specified, the alias name is created or redefined.
117 89
118 90
119 91 alias is built-in to the shell as a declaration command so that field
120 92 splitting and pathname expansion are not performed on the arguments.
121 93 Tilde expansion occurs on value. An alias definition only affects
122 94 scripts read by the current shell environment. It does not affect
123 95 scripts run by this shell.
124 96
125 97
126 98 unalias removes the definition of each named alias from the current
127 99 shell execution environment, or all aliases if -a is specified. It does
128 100 not affect any commands that have already been read and subsequently
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
129 101 executed.
130 102
131 103 OPTIONS
132 104 The following option is supported by unalias:
133 105
134 106 -a
135 107 Removes all alias definitions from the current shell execution
136 108 environment.
137 109
138 110
139 - ksh
140 - The following option is supported by alias:
141 -
142 - -t
143 - Sets and lists tracked aliases.
144 -
145 -
146 111 ksh93
147 112 The following options are supported by alias:
148 113
149 114 -p
150 115 Causes the output to be in the form of alias commands that can be
151 116 used as input to the shell to recreate the current aliases.
152 117
153 118
154 119 -t
155 120 Specifies tracked aliases.
156 121
157 122 Tracked aliases connect a command name to the command's pathname,
158 123 and are reset when the PATH variable is unset. The tracked
159 124 aliases feature is now obsolete.
160 125
161 126
162 127 -x
163 128 Ignored, this option is obsolete.
164 129
165 130
166 131
167 132 The following option is supported by unalias:
168 133
169 134 -a
170 135 Causes all alias definitions to be removed. name operands are
171 136 optional and ignored if specified.
172 137
173 138
174 139 OPERANDS
175 140 The following operands are supported:
176 141
177 142 alias
178 143 alias-name
179 144 Write the alias definition to standard output.
180 145
181 146
182 147 unalias
183 148 alias-name
184 149 The name of an alias to be removed.
185 150
186 151
187 152 alias-name=string
188 153 Assign the value of string to the alias alias-
189 154 name.
190 155
191 156
192 157
193 158 If no operands are specified, all alias definitions are written to
194 159 standard output.
195 160
196 161 OUTPUT
197 162 The format for displaying aliases (when no operands or only name
198 163 operands are specified) is:
199 164
200 165 "%s=%s\n" name, value
201 166
202 167
203 168
204 169
205 170 The value string is written with appropriate quoting so that it is
206 171 suitable for reinput to the shell.
207 172
208 173 EXAMPLES
209 174 Example 1 Modifying a Command's Output
210 175
211 176
212 177 This example specifies that the output of the ls utility is columnated
213 178 and more annotated:
214 179
215 180
216 181 example% alias ls="ls -CF"
217 182
218 183
219 184
220 185 Example 2 Repeating Previous Entries in the Command History File
221 186
222 187
223 188 This example creates a simple "redo" command to repeat previous entries
224 189 in the command history file:
225 190
226 191
227 192 example% alias r='fc -s'
228 193
229 194
230 195
231 196 Example 3 Specifying a Command's Output Options
232 197
233 198
234 199 This example provides that the du utility summarize disk output in
235 200 units of 1024 bytes:
236 201
237 202
238 203 example% alias du=du -k
239 204
240 205
241 206
242 207 Example 4 Dealing with an Argument That is an Alias Name
243 208
244 209
245 210 This example sets up the nohup utility so that it can deal with an
246 211 argument that is an alias name:
247 212
248 213
249 214 example% alias nohup="nohup "
250 215
251 216
252 217
253 218 ENVIRONMENT VARIABLES
254 219 See environ(5) for descriptions of the following environment variables
255 220 that affect the execution of alias and unalias: LANG, LC_ALL, LC_CTYPE,
256 221 LC_MESSAGES, and NLSPATH.
257 222
258 223 EXIT STATUS
259 224 The following exit values are returned:
260 225
261 226 0
262 227 Successful completion.
263 228
264 229
265 230 alias
266 231 >0
267 232 One of the alias-name operands specified did not have an alias
268 233 definition, or an error occurred.
269 234
270 235
271 236 unalias
↓ open down ↓ |
116 lines elided |
↑ open up ↑ |
272 237 >0
273 238 One of the alias-name operands specified did not represent a
274 239 valid alias definition, or an error occurred.
275 240
276 241
277 242 ATTRIBUTES
278 243 See attributes(5) for descriptions of the following attributes:
279 244
280 245 csh, ksh
281 246
282 -
283 -
284 247 +--------------------+-------------------+
285 248 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
286 249 +--------------------+-------------------+
287 250 |Interface Stability | Committed |
288 251 +--------------------+-------------------+
289 252 |Standard | See standards(5). |
290 253 +--------------------+-------------------+
291 254
292 255 ksh93
293 256
294 -
295 -
296 257 +--------------------+-----------------+
297 258 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
298 259 +--------------------+-----------------+
299 260 |Interface Stability | Uncommitted |
300 261 +--------------------+-----------------+
301 262
302 263 SEE ALSO
303 264 csh(1), ksh(1), ksh93(1), shell_builtins(1), attributes(5), environ(5),
304 265 standards(5)
305 266
306 267
307 268
308 - April 8, 2008 ALIAS(1)
269 + February 9, 2021 ALIAS(1)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX