1. Hey Guest Did you know you can win an Honor 10 phone worth ₹33,000 and an additional ₹70,000 in paytm vouchers, just by replying to some threads and taking part in the discussions happening in the Honor Hub?

    What are you waiting for? Start commenting and start winning! Remember to read the instructions posted here.

    Dismiss Notice

any ideas about these commands-- "_alias"

Discussion in 'Open Source' started by praka123, Mar 24, 2006.

Thread Status:
Not open for further replies.
  1. praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    I just tried in my dapper typing a "_" underscore and double clicked the TAB button.it displayed below all commands:
    Code:
    prakash@dapper:~$ _
    Display all 151 possibilities? (y or n)
    _alias                         _lvresize
    _apt_cache                     _lvs
    _apt_get                       _lvscan
    _aptitude                      _make
    _args                          _man
    _aspell                        _mkisofs
    _aspell_dictionary             _modules
    _available_interfaces          _mount
    _bzip2                         _mplayer
    _cancel                        _mplayer_options_list
    _cardctl                       _nslookup
    _cd                            _ntpdate
    _cdrecord                      _ooexp_
    _chgrp                         _openssl
    _chown                         _openssl_sections
    _chsh                          _perl
    _command                       _perldoc.........etc
    what does these stands for anything like env variables :roll: waiting brainiacs and geeks for an answer....
     
  2. desertwind

    desertwind New Member

    Joined:
    Nov 2, 2004
    Messages:
    1,096
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    Hyderabad
    There are all used in zsh. A "_" parameter is set in the environment of every command executed to the full pathname of the command. ie _alias means it is the environment variable for the command alias.
     
  3. OP
    OP
    praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    But i dont have zsh or any installed only bash and sh...any resources...
     
  4. vignesh

    vignesh New Member

    Joined:
    Jul 20, 2004
    Messages:
    1,658
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Chennai
    zsh is installed by default..
     
  5. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    prakash, these _alias and things are shell functions which are activated if you are using Bash Autocompletion features, normally by uncommenting its entry in $HOME/.bashrc

    Open your /etc/bash_completion file and you will find all the function's bodies defined there.
     
  6. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
    1.My bashrc says...
    # .bashrc

    # User specific aliases and functions

    # Source global definitions
    if [ -f /etc/bashrc ]; then
    . /etc/bashrc
    fi

    2. There is no file as /etc/bash_completion in ma distro (FC4)

    How to do it then?...Please tell me
    One thing more what is this bashcompletion?
     
  7. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    @mediator, bash_completion Auto complete features are available for Debian and distros directly based on it.

    Bash_Completion provides second level and in some cases third level command line autocompletion features, not present in RH based distros.
     
  8. OP
    OP
    praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    Thanks Anurag.i already enabled bash autocompletion in debian and ubuntu
    Code:
    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
    # sources /etc/bash.bashrc).
    if [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
    fi
    and i checked /etc/bash_completion file its there.anyway helped me so;ved a big doubt :)
    @mediator:
    for fedora/RH you need to get bashcompletion rpm installed for full programmable completion bash.here is one link for your distro:
    http://ftp.belnet.be/packages/dries...ash-completion-20050721-1.2.fc4.rf.noarch.rpm
    check atrmps.net,dries,livna,dag's,rpmfind,rpmforge repos for more updated rpms.
     
  9. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
    @prakashkerela : Thanx for the link bro...i'll check dat out!
     
  10. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
    Now i downloaded and installed the rpm , now what to do?
     
  11. OP
    OP
    praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    the purpose of that rpm was not clear to you,I think.bash autocompletion is for normal bash users,suppose at # or $ prompt if u type a commands first few words,like for eg;if you typed update and pressed keyboard TAB button twice when bash terminal window is active will show u available options.below is for my sarge's bash.

    Code:
    prakash@sarge:~$ update (TAB doubleclicked)
    updatedb                 update-menus             update-pciids
    updatedb.notslocate      update-menus.real
    update-desktop-database  update-mime-database
    
    now if itype in terminal prompt "updated" and presses the TAB,it will complete the command to "updatedb".this is primary command completion in bash.if u have programmable bash completion installed/enabled if u want to restart ur network.in most distros u need to type
    Code:
    sarge:~# service network restart
    
    or /etc/init.d/network restart.see if u simply type service in root prompt and double click TAB Button it will list u available services in /etc/init.d/ directory..see below
    Code:
    sarge:~# service (double clicked TAB)
    README             echo               lm-sensors         rmnologin
    acpid              exim4              makedev            scsitools-pre.sh
    alsa               firestarter        microcode.ctl      scsitools.sh
    alsa-utils         gdm                module-init-tools  sendsigs
    anacron            gpm                modutils           setmixer
    apmd               halt               mountall.sh        single
    atd                hddtemp            mountnfs.sh        skeleton
    binfmt-support     hdparm             mountvirtfs        smartmontools
    bootclean.sh       hibernate          netapplet          stop-bootlogd
    bootlogd           hostname.sh        networking         sudo
    bootmisc.sh        hwclock.sh         ntpdate            sysklogd
    chargen            hwclockfirst.sh    nviboot            sysstat
    checkfs.sh         hwtools            portmap            time
    checkroot.sh       ifplugd            powertweakd ....etc etc
    this is only possible with bash programmable completion enabled.
    like this secondary programmable bah completion is very useful.another example is if u want to "modprobe" a module by using bashprogrmablecompletion double click TAB will list u all the modules available..or with any other commands like "modinfo"
    Code:
    sarge:~# modinfo
    Display all 1631 possibilities? (y or n)
    for above there are a huge list of modules to list.if u press 'y' in kbd it will be listed using the more command.just read tldp.org guides for more details.
    for ubuntu and debian users "service" command may not be available with a fresh install.so " apt-get update && apt-get install sysvconfig"
    will provide u a "service" option :)
     
  12. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
    ok thanx i get it now!
     
  13. OP
    OP
    praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
Thread Status:
Not open for further replies.

Share This Page