• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

abbr Command Examples in fish-shell

by admin

The abbr command in the Fish shell is used to create or modify an abbreviation, which is a shortcut for a longer command or sequence of commands. For example, you can use the abbr command to create an abbreviation for a frequently used command, such as ls -l:

$ abbr ll 'ls -l'

Now, every time you type ll in the Fish shell, it will be expanded to ls -l. You can also use the abbr command to create an abbreviation for a sequence of commands by enclosing the commands in quotes and separating them with semicolons:

$ abbr update 'sudo apt update; sudo apt upgrade'

Now, typing update in the Fish shell will execute the two commands sudo apt update and sudo apt upgrade in sequence. To view the list of all abbreviations currently defined in the Fish shell, you can use the abbr command with no arguments:

$ abbr

For more information about the abbr command and its usage, you can consult the Fish shell documentation or run the command man abbr to view the abbr manual page.

abbr Command Examples in fish-shell

1. Add a new abbreviation:

$ abbr --add {{abbreviation_name}} {{command}} {{command_arguments}}

2. Rename an existing abbreviation:

$ abbr --rename {{old_name}} {{new_name}}

3. Erase an existing abbreviation:

$ abbr --erase {{abbreviation_name}}

4. Import the abbreviations defined on another host over SSH:

$ ssh {{host_name}} abbr --show | source

Filed Under: Linux

Some more articles you might also be interested in …

  1. shutdown: command not found
  2. addr2line: command not found
  3. dar Command Examples in Linux
  4. mkfs: command not found
  5. How To Calculate The Memory Reserved By HugePages in CentOS/RHEL
  6. pacman –upgrade Command Examples in Linux
  7. Linux OS Service ‘NetworkManager’
  8. 11 Useful “ssh” and “scp” Commands in Linux
  9. Configure Persistent NIC Names of Network Adaptors in CentOS/RHEL using udev Rules
  10. RHEL 7 – RHCSA Notes – System documentation including man, info, and files in /usr/share/doc

You May Also Like

Primary Sidebar

Recent Posts

  • “aws s3 presign” Command Examples
  • “aws s3 mv” Command Examples
  • “aws s3 mb” Command Examples
  • “aws s3 ls” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright