LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is _ls? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-_ls-4175517042/)

mozer 09-01-2014 07:22 AM

What is _ls?
 
Hello,

I'm using open Suse 13.1 and i was checking the aliases, i found one that i found really strange

alias ls='_ls'

I tried "_ls" and is something like ls -a

Is the "_" a regular expression??

I tried _mv or _vi but with no results.

Anyone knows what's going on here?

Thanks for the help.

linosaurusroot 09-01-2014 07:40 AM

Try these for more info:
Code:

type _ls
rpm -qf `which _ls`


mozer 09-01-2014 07:56 AM

Thanks for the help linosaurusroot,
type _ls

Code:

_ls is a function

_ls ()
{
    local IFS=' ';
    command ls $LS_OPTIONS ${1+"$@"}
}

So is a function, do you know where is defined, I’ve checked .bash_profile and /etc/profile with no results, and i assume that the "_" in front defines that is a function.

Kind regards!

sgosnell 09-01-2014 09:38 AM

It's probably defined in .bashrc.

jpollard 09-01-2014 09:48 AM

Quote:

Originally Posted by mozer (Post 5230631)
Thanks for the help linosaurusroot,
type _ls

Code:

_ls is a function

_ls ()
{
    local IFS=' ';
    command ls $LS_OPTIONS ${1+"$@"}
}

So is a function, do you know where is defined, I’ve checked .bash_profile and /etc/profile with no results, and i assume that the "_" in front defines that is a function.

Kind regards!

No. I think the _ in front is just to keep it from conflicting with "ls".

What defines it as a function is the syntax. "name() {...}" makes "name" a function. alternatively you can also add the word "function" when it is defined.

linosaurusroot 09-01-2014 03:27 PM

https://github.com/openSUSE/aaa_base...file.d/ls.bash

jefro 09-01-2014 08:23 PM

Wonder if it has something to do with sudoers?


You might have an upgraded from 12 system?

alias l='ls -alF'
alias la='ls -la'
alias ll='ls -l'
alias ls='_ls'
alias ls-l='ls -l'


All times are GMT -5. The time now is 10:49 PM.