2012-03-12 37 views
3
[email protected]:~/comp$ l 
3rdParty/ que.ico  SE32.EXE start.fgx Supp/   WebResources/ 
autorun.inf Readme.txt START.EXE start.fgz Walkthrough/ 
[email protected]:~/comp$ ls 
3rdParty  que.ico  SE32.EXE start.fgx Supp   WebResources 
autorun.inf Readme.txt START.EXE start.fgz Walkthrough 
[email protected]:~/comp$ 

这两个命令有什么区别?l(小写L)在bash终端中的命令

我试过$ which l,但没有输出。

也没有结果$ man l

我也尝试过不成功Google给它。

+0

是的,我无法想象谷歌类似的东西会让你在任何地方。 – asmeurer 2012-11-28 07:56:19

+0

@asmeurer:[It does now](https://www.google.com/search?q=bash+l+command&oq=bash+l+command) – 2014-09-26 20:14:42

回答

12

l可能是ls -F之类的别名。该-F选项使ls追加/到目录名,*到可执行常规文件等

UPDATE:基于您的评论,l化名为ls -CF。单字母选项可以“捆绑”,因此ls -CF相当于ls -C -F-C选项会导致ls按列列出条目。如果ls认为它正在写入终端,则这是默认值; -C选项使它无条件地表现这种行为。 (ls -1每行列出一个条目,如果ls *不写入终端,则这是默认值。)

type -a l应该向您显示它是如何定义的。它可能设置在您的$HOME/.bashrc

(该$是你的shell提示符,命令的不是一部分的一部分。)

+0

'vikram @ vikram-Studio-XPS-1645:〜/ comp $ type l l别名为ls -CF'' ...谢谢,我知道了man .. – Vikram 2012-03-12 19:25:32

+0

很酷。我知道“哪个”,但不知道“类型-a”。 – asmeurer 2012-11-28 07:55:45

0

据我所知,没有通用的命令“L”存在,甚至没有什么“LS”不,这就是为什么你的结果which lman l是空

你有你的路径称为l上的东西那可能运行ls

+0

这是别名.. – 2012-03-12 19:09:17

+0

路径上没有任何内容。 OP试过'哪个l'。 – mkb 2012-03-12 19:11:11

-1

它是 “LS” 具体的bash命令。

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

根本不是Bash命令。接受的答案说明了这一点:它是由用户创建的文件或发行版的维护者在某处定义的别名。顺便说一句,'which'和'whereis'是(用Bash)坏方法来确定命令/函数/别名是什么。用'type -a'代替:'type -a l'会给你一些信息(但不是定义的地方)。 – 2014-12-18 16:45:44

+0

是的,这是ls -CF的别名,对不起。 – 2014-12-19 19:40:04