Linux.com

Home Learn Linux Linux Answers Systems Management How do i use a function instead of a command?
Answers
  • 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

    hth
    harv

    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: www.linfo.org/alias.html
    AND
    http://bash.cyberciti.biz/guide/Create_and_use_aliases

    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
    05 Jan » 09 Jan - Virtual
    Details
  2. LFS220 Linux System Administration
    05 Jan » 08 Jan - Virtual
    Details
  3. LFD331 Developing Linux Device Drivers
    12 Jan » 16 Jan - Virtual
    Details

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