如何在CD命令后自动列出目录内容? [英] How to automatically list directory contents after a CD command?

查看:259
本文介绍了如何在CD命令后自动列出目录内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个新的unix命令,以便在CD命令后自动列出目录的内容。到目前为止,我已经尝试过几个方面:

I would like to create a new unix command to automatically list the contents of a directory after a CD command. So far, I've tried several things:

别名cdls ='cd $ 1 | ls -l'

function cdls(){cd $ 1; ls -l;}

执行列表但不更改工作目录。

Both perform the listing but dont change the working directory.

感谢。

推荐答案

使用zsh。 Google zsh {your distribution} 了解详情。

Use zsh. Google zsh {your distribution} for instructions.

这篇关于如何在CD命令后自动列出目录内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆