Linux cd后显示文件,关于linux系统显示文件的问题!

写个函数在家目录的 。bashrc, 如是

#function: lcd , change dir and display content of dir

lcd ()

{ local ret

cd "$*"; ret=$?

[ $ret -eq 0 ] && ls -hF --color=tty

}

存档后执行 source ~/。

bashrc

以后用 lcd 这个命令就等如

cd 目录

ls

例如:

User@User-PC ~

$ type lcd

lcd is a function

lcd ()

{

local ret

cd "$*"; $ret=$?

[ $ret -eq 0 ] && ls -hF --color=tty

}

User@User-PC ~

$ pwd

/home/User

User@User-PC ~

$ lcd bin

astock。

sh* fqn* getproxy。pl* max_memory。c rot13。bash* tetris。sh*

awksrc free* getproxy。sh* max_memory。exe* rot13。rb* tree*

bwhois* free。

ash* hellogui。c myip* rot13。sed* tvbprograme。pl*

cap* free。awk* hklib* mystock。sh* rot13。sh* tvbprograme。sh*

cap。

ash* free。rb* ldd* num。sed* rot13。tcl* weather。sh*

cfaj_stock* free。sh* lotto* pass* stock* weather7days*

commas。

sh funfacts* marksix* rev* stripoff* webproxy*

count* funfacts。pl* marksix。awk* rev。ash* swapcase* whereis。sh*

dict。

pl* getproxy。awk* marksix。pl* rot13。ash* swapcase。

ash* zcalc*

User@User-PC ~/bin

$ pwd

/home/User/bin

User@User-PC ~/bin

$

呵呵,这可解决了吗?。

全部

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值