LFCS · Question #305
Which of the following benefits does an alias provide?
The correct answer is B. It prevents having to type long commands. An alias provides a shorter, custom name for a longer command or sequence of commands, primarily benefiting users by reducing typing effort.
Question
Options
- AIt provides faster lookups for commands.
- BIt prevents having to type long commands
- CIt hides from others the command that is being run.
- DIt creates a local copy of a file from another directory.
How the community answered
(42 responses)- A5% (2)
- B88% (37)
- C2% (1)
- D5% (2)
Why each option
An alias provides a shorter, custom name for a longer command or sequence of commands, primarily benefiting users by reducing typing effort.
Aliases do not provide faster lookups; they are simply text substitutions performed by the shell before command execution.
Aliases allow users to assign a short, memorable name to a frequently used or lengthy command or sequence of commands. This significantly reduces the amount of typing required, thereby improving efficiency and user experience in the shell.
Aliases do not hide commands from others; they are typically configured in shell startup files and can be easily viewed or shared.
Creating a local copy of a file from another directory is the function of commands like `cp` or `rsync`, not aliases.
Concept tested: Shell aliases utility
Source: https://man7.org/linux/man-pages/man1/bash.1.html
Topics
Community Discussion
No community discussion yet for this question.