LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   difference of " ls -l " and " ll " commands (https://www.linuxquestions.org/questions/linux-newbie-8/difference-of-ls-l-and-ll-commands-4175458744/)

awtz 04-19-2013 03:52 AM

difference of " ls -l " and " ll " commands
 
Hi All,

As I was browsing the console, I type ls -l on one console and ll on the other. Noticed that they both generated the same values. Out of curiosity and for additional knowledge, may I ask what is the difference between the two and why both of them generated sthe ame output.

---
[hpsindia@ACSS-SDDBEASRV02 batch]$ ls -l
total 40
drwxr-xr-x 3 hpsindia hps 4096 Mar 21 21:03 bin
drwxr-xr-x 3 hpsindia hps 4096 Apr 13 08:44 common
drwxr-xr-x 3 hpsindia hps 4096 Mar 21 21:06 dtd
drwxr-xr-x 2 hpsindia hps 4096 Mar 21 21:06 old
drwxr-xr-x 38 hpsindia hps 4096 Mar 21 21:07 run
---
[hpsindia@ACSS-SDDBEASRV02 batch]$ ll
total 40
drwxr-xr-x 3 hpsindia hps 4096 Mar 21 21:03 bin
drwxr-xr-x 3 hpsindia hps 4096 Apr 13 08:44 common
drwxr-xr-x 3 hpsindia hps 4096 Mar 21 21:06 dtd
drwxr-xr-x 2 hpsindia hps 4096 Mar 21 21:06 old
drwxr-xr-x 38 hpsindia hps 4096 Mar 21 21:07 run
---

Thanks >_<

druuna 04-19-2013 03:57 AM

The ll command is an alias, the ls -l command is not.

Execute the following command to see which aliases are set: alias

You'll probably see an entry like this: alias ll='ls -l'

Aliases can be used for many things, not having to type the entire command is one reason to use them (unix/linux admins are lazy ;) )

Have a look here for more info: The alias Command

tsenapathy 04-19-2013 03:58 AM

ll is nothing but the 'alias' for ls -l

---------- Post added 04-19-13 at 09:58 AM ----------

http://tldp.org/LDP/abs/html/aliases.html

tsenapathy 04-19-2013 04:01 AM

I used to keep quick alias to 'change directory' like,
alias s='cd path/to/my/sandbox'

shivaa 04-19-2013 04:15 AM

ll is not any command or command option, so simply invoke alias command and you will come to know what alias is ll.
Code:

~$ alias

awtz 04-19-2013 04:16 AM

All, thanks for the advise. Verified and it is indeed an alias. New Knowledge aquired. >___<


All times are GMT -5. The time now is 01:51 AM.