2012-03-12 102 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