欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > Shell和Bash介绍

Shell和Bash介绍

2025/5/19 0:38:36 来源:https://blog.csdn.net/wanjiac/article/details/147960112  浏览:    关键词:Shell和Bash介绍

Shell是硬件和软件之间的交互界面。Bash是一种shell,在Linux系统中比较常见。我目前使用的Mac用的Z shell(zsh). 可以在terminal里面通过zsh命令对系统进行操作。这是与Windows所见所得,用鼠标点相比,Mac和Linux都可以完全用命令操作。常用的Bash/zsh命令如下:

Bash语言学习主要靠多用,慢慢积累。遇到需求多找资料,常学常用吧。

 File and Directory Operations
ls                 # List files
ls -l              # Long listing with details
cd /path/to/dir    # Change directory
pwd                # Show current directory
mkdir newdir       # Create directory
touch file.txt     # Create empty file
rm file.txt        # Delete file
rm -r dir/         # Delete directory and contents
cp file1 file2     # Copy file
mv old new         # Move or rename file
 Viewing and Editing Files
cat file.txt       # Show file contents
less file.txt      # View file page-by-page
head file.txt      # First 10 lines
tail file.txt      # Last 10 lines
nano file.txt      # Open in Nano editor
vim file.txt       # Open in Vim editor
参考资料
  • Bash 简介 - Bash 脚本教程 - 网道
  • Shell 教程 | 菜鸟教程

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词