Unix Concepts   «Prev 

Commands for Listing or Disabling Aliases using Red Hat

Unix alias command
Commands for listing or disabling alias
  1. alias command plus output: Without arguments, the alias command displays a list of defined aliases. The parentheses, (), indicate that the definitions are treated as a single argument.
  2. alias rm command plus output: With a single argument (the alias name rm), the alias command displays rm –i, the alias definition.
  3. rm qa.html plus prompt below: You want to remove the file qa.html. However, the rm command is really an alias for rm -i. As a result, the command prompts for confirmation.
  4. \rm qa.html command: To use the regular rm command, you need to disable the rm alias. This is done with the backslash (\). Now, the actual rm command is used, and the file is deleted without confirmation.
  5. alias|grep ls command: If you have many aliases, the grep command can help you find them. In this example, grep searches for aliases that contain the pattern ls.
  6. unalias ls: To disable an alias for the rest of your UNIX session, use the unalias command.
  7. alias | grep ls: Because you have disabled the ls alias, it no longer appears when you search for it.