Home Learn Linux Linux Answers Systems Management How do i use a function instead of a command?
  • If I'm understanding your question correctly, you want to type in 'a' at the command prompt and get output of 'who' command.

    Easiest way I know to do this is to add an alias statement to /home/[user]/.bashrc.

    alias a=who

    Here is partial excerpt of alias section of my .bashrc file:
    alias nano='nano -w'
    alias ls='ls -ahF --color=always'
    alias cp='cp -i'
    alias mv='mv -i'
    alias rm='rm -I'

    Also, 'man' command is your friend.
    Try man alias
    or man -k alias


    Answered by harv42
    2 years ago
    0 0
  • U can also try to use bash scripts / shell scripts for ur purpose. See here for more info:

    Answered by rechil_colin
    2 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Systems Management

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual

View All Upcoming Courses

Community Answers - Search

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board