nerdexam
CompTIA

LX0-103 · Question #149

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 in bash allows users to define shorthand names for longer or frequently used commands. No other listed option provides this shell-level pseudonym functionality.

GNU and Unix Commands

Question

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.

Options

  • Ashortcut
  • BIn
  • Csudo
  • Dlink
  • Ealias

How the community answered

(35 responses)
  • A
    9% (3)
  • B
    3% (1)
  • C
    3% (1)
  • E
    86% (30)

Why each option

The 'alias' built-in in bash allows users to define shorthand names for longer or frequently used commands. No other listed option provides this shell-level pseudonym functionality.

Ashortcut

'shortcut' is not a valid shell built-in or standard Unix command.

BIn

'ln' creates hard or symbolic filesystem links to files or directories, not command aliases.

Csudo

'sudo' executes a command with elevated (superuser) privileges and has nothing to do with creating shortcuts.

Dlink

'link' creates a hard link between two files and does not create command shortcuts.

EaliasCorrect

The 'alias' command is a bash built-in that maps a short name to a longer command string, for example 'alias ll="ls -la"'. It is built directly into the shell, requiring no external binary, and persists for the current session or permanently when added to ~/.bashrc or ~/.bash_profile.

Concept tested: bash alias built-in for command shortcuts

Source: https://www.gnu.org/software/bash/manual/bash.html#Aliases

Topics

#shell commands#alias#bash#command shortcuts

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice