LFCS · Question #749
Which shell built-in command can be used to create a shortcut or pseudonym for a longer command? Assume a modern bournE.like shell, such as bash.
The correct answer is E. alias. The alias built-in command in Bash and other Bourne-like shells is used to create a temporary shortcut or alternative name for a command or sequence of commands.
Question
Options
- Ashortcut
- BIn
- Csudo
- Dlink
- Ealias
How the community answered
(33 responses)- B3% (1)
- C3% (1)
- D3% (1)
- E91% (30)
Why each option
The `alias` built-in command in Bash and other Bourne-like shells is used to create a temporary shortcut or alternative name for a command or sequence of commands.
`shortcut` is not a standard shell command for creating command aliases.
`ln` is used to create hard or symbolic links to files or directories, not aliases for commands.
`sudo` is used to execute commands with elevated privileges, not to create command shortcuts.
`link` is a system call (and sometimes a command) for creating hard links, similar to `ln`, not command aliases.
The `alias` command is a shell built-in feature that allows users to create custom shorthand names (aliases) for longer commands, frequently used command sequences, or commands with specific options, thus improving command-line efficiency. These aliases persist for the current shell session or until explicitly unset.
Concept tested: Bash shell aliases
Source: https://learn.microsoft.com/en-us/azure/cloud-shell/persisting-home-directory#aliases
Topics
Community Discussion
No community discussion yet for this question.