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. LFS426 Linux Performance Tuning
    08 Sep » 11 Sep - New York
  2. LFS520 OpenStack Cloud Architecture and Deployment
    08 Sep » 11 Sep - Virtual
  3. LFD320 Linux Kernel Internals and Debugging
    15 Sep » 19 Sep - 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