any ideas about these commands-- "_alias"

Status
Not open for further replies.

praka123

left this forum longback
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....
 

desertwind

Cyborg Agent
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.
 

GNUrag

FooBar Guy
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.
 

mediator

Technomancer
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?
 

GNUrag

FooBar Guy
@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.
 
OP
praka123

praka123

left this forum longback
GNUrag said:
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.
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:
*ftp.belnet.be/packages/dries.ulyss...ash-completion-20050721-1.2.fc4.rf.noarch.rpm
check atrmps.net,dries,livna,dag's,rpmfind,rpmforge repos for more updated rpms.
 
OP
praka123

praka123

left this forum longback
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 :)
 
OP
praka123

praka123

left this forum longback
if u want to learn more on bash shell,an easy howto is in tldp:
*www.tldp.org/LDP/Bash-Beginners-Guide/Bash-Beginners-Guide.pdf
 
Status
Not open for further replies.
Top Bottom