[英]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$
这两个命令有什么区别?
我试过$ which l
,但是没有输出。
$ man l
也没有结果。
我也尝试过谷歌。
l
可能是ls -F
类的别名。 -F
选项使ls
附加/
到目录名, *
到可执行的常规文件等。
更新:根据您的评论, l
是别名为ls -CF
。 单字母选项可以“捆绑”,因此ls -CF
等同于ls -C -F
。 -C
选项使ls
按列列出条目。 如果ls
认为它正在写入终端,这是默认值; -C
选项使其无条件地以这种方式运行。 ( ls -1
每行列出一个条目,如果ls
*不写入终端,则为默认条目。)
type -al
应该显示它是如何定义的。 它可能设置在$HOME/.bashrc
。
( $
是shell提示符的一部分,不是命令的一部分。)
查找其别名的方法是检查〜/ .bashrc文件
$sudo cat ~/.bashrc | grep 'alias l='
alias l='ls -CF'
据我所知,没有一般命令'l'存在,甚至没有'ls'这就是为什么你的结果为which l
和man l
为空
你的路径上有什么东西叫做l
或许可以运行ls
吗?
它是“ls”的特定bash命令。
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
$
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.