首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >别名ll用于什么命令?

别名ll用于什么命令?
EN

Ask Ubuntu用户
提问于 2018-05-09 11:31:14
回答 3查看 65.6K关注 0票数 49

有人能告诉我别名ll的终端命令是什么吗?我在网上所能找到的就是很多人说它是ls -lls -lals -ltr的别名。但这完全是错误的。结果看起来不一样。有任何方法来定位ll并查看其语法吗?

EN

回答 3

Ask Ubuntu用户

发布于 2018-05-10 04:24:58

您可以查看~/..bashrc(或别名所在的某个文件),也可以在shell中编写以下命令:

代码语言:javascript
复制
command -v ll # "command" is a shell built-in that display information about       
              # the command. Use the built-in "help command" to see the 
              # options.
type -p ll # "type" is another built-in that display information about how the 
           # command would be interpreted
grep -r "alias ll=" ~ # and don't worry about de .file that contains your 
                      # alias. This command search recursively  under  each  
                      # folder of your home. So it's something rude.
find ~ -maxdepth 1 -type f | xargs grep "alias ll" # Just look in 
                      # the files (not folders) in your home folder

但是为什么在没有-name ".*“的情况下使用find?因为你可以把这个放在你的.bashrc里

代码语言:javascript
复制
source bash_hacks # where the file bash_hacks, in your home directory can 
                  # contain the alias ll='ls -la etc etc'.

因为"ll“是一个别名,没有必要只有一个意思(ll='ls -alF -color‘),所以您可以将您的"ll”命名为另一个comand,我不知道,"rm“。我认为这更像是一种惯例(通用产品)。

但是"ll“可以是存储在路径的任意文件夹中的程序。例如,如果您在家里有一个名为"bin“的文件夹,请创建一个"ll”脚本,其中包含以下内容

代码语言:javascript
复制
#!/bin/bash
ls -lhar

但是,如果您的路径被更改为添加另一个包含新的"ll“命令的文件夹,怎么办?要获得更多有趣的信息,您可以参考以下链接到相关的问题。

票数 6
EN

Ask Ubuntu用户

发布于 2018-05-16 00:42:16

不需要解析~/..bashrc或任何其他脚本。您可以检查在终端中键入alias命令的所有别名的当前值。它将把所有定义的别名及其定义带到您的屏幕上。

票数 0
EN

Ask Ubuntu用户

发布于 2019-09-30 19:59:13

应该是ls -la。见Linuxize.com:https://linuxize.com/post/how-to-create-bash-aliases/

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1033998

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档