免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4306 | 回复: 9
打印 上一主题 下一主题

请教:alias ls="ls -l" 为什么不起作用? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-05-12 16:39 |只看该作者 |倒序浏览
# echo $SHELL
/sbin/sh
# pwd
/
# vi .profile
我增加了:
   4  alias c="clear"
     5  alias ls="ls -l"
     6  stty erase "^H"

这三行,  reboot 后, c,ls 没有起作用,而backspace 起作用了,这是为什么呢?

# c
c: not found
# ls
DeadLetters  dev          floppy       mnt          proc         var
Mail         devices      home         net          sbin         vol
TT_DB        esm          kernel       nsmail       tftpboot     xfn
bin          etc          lib          opt          tmp
cdrom        export       lost+found   platform     usr



为什么不起作用?

".profile" 35 lines, 788 characters
     1  # @(#)local.profile 1.8 99/03/26 SMI
     2  stty istrip
     3  PATH=/usr/sbin:/sbin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/bin:/usr/ucb
:/etc:.
     4  alias c="clear"
     5  alias ls="ls -l"
     6  stty erase "^H"
     7  EDITOR=vi
     8  LPDEST=printer1
     9  EXINIT='set showmode autoindent number'
    10  ENV=$HOME/.kshrc
    11  export PATH EDITOR LPDEST EXINIT ENV

论坛徽章:
0
2 [报告]
发表于 2004-05-12 17:16 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

#alias
看看现在的alias是不是有你定制的?

论坛徽章:
0
3 [报告]
发表于 2004-05-12 17:37 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

没有显示 alias ls="ls -l"


===============================================
# alias
autoload='typeset -fu'
command='command '
functions='typeset -f'
history='fc -l'
integer='typeset -i'
local=typeset
nohup='nohup '
r='fc -e -'
stop='kill -STOP'
suspend='kill -STOP $$

论坛徽章:
0
4 [报告]
发表于 2004-05-12 19:19 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

alias ls='ls -l'

论坛徽章:
0
5 [报告]
发表于 2004-05-12 20:00 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

你在/etc/profile下編輯就可以了.

论坛徽章:
0
6 [报告]
发表于 2004-05-12 21:34 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

执行.profile文件了吗?
#cd
#. ./.profile

论坛徽章:
0
7 [报告]
发表于 2004-05-12 22:46 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

原帖由 "robbie_fu" 发表:
# echo $SHELL
/sbin/sh
# pwd
/
# vi .profile
我增加了:
   4  alias c="clear"
     5  alias ls="ls -l"
     6  stty erase "^H"

这三行,  reboot 后, c,ls 没有起作用,而backspace 起作用了,..........


楼上大大..
Bourne Shell 是沒有alias的功能的吧~~

论坛徽章:
0
8 [报告]
发表于 2004-05-13 09:12 |只看该作者

请教:alias ls="ls -l" 为什么不起作用?

问题搞定了!
楼上的兄弟说的极是, B SHELL 果然没有 alias 功能。

谢谢各位兄弟

论坛徽章:
0
9 [报告]
发表于 2011-01-05 17:20 |只看该作者
1、是不是没有执行.profile文件。
2、应该在alias ls="ls -l"加;

论坛徽章:
0
10 [报告]
发表于 2011-01-05 17:25 |只看该作者
楼主默认是哪个shell,换个bash试试
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP