简体   繁体   中英

l (lowercase L) command in bash terminal

vikram@vikram-Studio-XPS-1645:~/comp$ l
3rdParty/    que.ico     SE32.EXE   start.fgx  Supp/         WebResources/
autorun.inf  Readme.txt  START.EXE  start.fgz  Walkthrough/
vikram@vikram-Studio-XPS-1645:~/comp$ ls
3rdParty     que.ico     SE32.EXE   start.fgx  Supp         WebResources
autorun.inf  Readme.txt  START.EXE  start.fgz  Walkthrough
vikram@vikram-Studio-XPS-1645:~/comp$ 

What is the difference between these two commands?

I tried $ which l , but there's no output.

Also no result for $ man l .

I also tried unsuccesfully to Google it.

l is probably an alias for something like ls -F . The -F option causes ls to append / to directory names, * to executable regular files, etc.

UPDATE : Based on your comment, l is aliased to ls -CF . Single letter options can be "bundled", so ls -CF is equivalent to ls -C -F . The -C option causes ls to list entries by columns. This is the default if ls thinks it's writing to a terminal; the -C option makes it behave this way unconditionally. ( ls -1 lists one entry per line, which is the default if ls is *not writing to a terminal.)

type -al should show you how it's defined. It's probably set in your $HOME/.bashrc .

(The $ is part of your shell prompt, not part of the command.)

The way to find if its alias is to check ~/.bashrc file

$sudo cat ~/.bashrc | grep 'alias l='
alias l='ls -CF'

As far as I know there is no general command 'l' that exists or even does what 'ls' does that's why your results for which l and man l are empty

Do you have something on your path called l that perhaps runs ls ?

it's specific bash command for "ls".

ilia@Latitude-E6410:~$ mkdir ltest
ilia@Latitude-E6410:~$ cd ltest
ilia@Latitude-E6410:~/ltest$ echo 321 > 321.txt
ilia@Latitude-E6410:~/ltest$ echo 123 > 123.txt
ilia@Latitude-E6410:~/ltest$ ls
123.txt  321.txt
ilia@Latitude-E6410:~/ltest$ l
123.txt  321.txt
ilia@Latitude-E6410:~/ltest$ whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz
ilia@Latitude-E6410:~/ltest$ whereis asdasdasd #This command doesn't exists
asdasdasd:
ilia@Latitude-E6410:~/ltest$ whereis l #Results of "whereis l" and "whereis asdasdasd" are same
l:
ilia@Latitude-E6410:~/ltest$ sh #Try "l" in sh
$ ls #"ls" is working
123.txt  321.txt
$ l #But "l" doesn't
sh: 2: l: not found
$ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM