基本上,如何使这两个步骤:如何为`cd`写一个bash别名,也是`ls`目录内容之后?
$:/ cd Users
$:/Users ls
user1 user2 user3
一步法:
$/ cd Users
$:/Users
user1 user2 user3
的bash脚本的伪代码可以是:
after changing directories, pause the input state and take another command
command('ls')
编辑 这里是一个很棒的bash参考 - http://cb.vu/unixtoolbox.xhtml#scripting
编辑-2http://bhami.com/rosetta.html
编辑-3What are the special dollar sign shell variables?
可能重复:http://askubuntu.com/questions/16106/how-can-i-create -an-alias-for-cd-and-ls –
不清楚你的别名应该做什么,而正常的'cd'不能。此外,别名不赞成使用别名。 –
@ n.m。 'cd'不显示新目录的内容。 – chepner