LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2014, 07:22 AM   #1
mozer
LQ Newbie
 
Registered: Sep 2013
Posts: 17

Rep: Reputation: Disabled
Smile 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.

Last edited by mozer; 09-01-2014 at 07:25 AM.
 
Old 09-01-2014, 07:40 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Try these for more info:
Code:
type _ls
rpm -qf `which _ls`
 
1 members found this post helpful.
Old 09-01-2014, 07:56 AM   #3
mozer
LQ Newbie
 
Registered: Sep 2013
Posts: 17

Original Poster
Rep: Reputation: Disabled
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!

Last edited by mozer; 09-01-2014 at 07:58 AM.
 
Old 09-01-2014, 09:38 AM   #4
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 277Reputation: 277Reputation: 277
It's probably defined in .bashrc.
 
Old 09-01-2014, 09:48 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
Quote:
Originally Posted by mozer View Post
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.
 
Old 09-01-2014, 03:27 PM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
https://github.com/openSUSE/aaa_base...file.d/ls.bash
 
Old 09-01-2014, 08:23 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,357

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
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'

Last edited by jefro; 09-01-2014 at 08:27 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 09:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration