龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 操作系统 > LINUX系统 >

Linux操作系统Shell基础知识

时间:2011-03-20 22:37来源:未知 作者:admin 点击:
分享到:
◆Shell基础知识 1、cat /etc/shells 查看计算机上可用的shell 2、编写shell,保存为firstscript #! /bin/bash # This is a test. echo -n Your current directory is: pwd echo $HOME echo Your current directory is: pwd #END. 3、运

◆Shell基础知识

1、cat /etc/shells

查看计算机上可用的shell

2、编写shell,保存为firstscript

#! /bin/bash

# This is a test.

echo -n Your current directory is:

pwd

echo $HOME

echo Your current directory is:

pwd

#END.

3、运行firstscript

$ /bin/bash firstscript

如果找不到文件 使用pwd查看当前目录

$ /bin/bash pwd/firstscript

可见当前运行结果。

4、可以修改firstscript为执行

$chmod a+x firstscript

此时输入$ ./firstscript即可

上面的shell没有交换,我们可以进行交互,如下:

[1] [2] 下一页

精彩图集

赞助商链接