Shell和Bash介绍

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

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

File and Directory Operations
bash 复制代码
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
bash 复制代码
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
参考资料
相关推荐
tobebetter95273 小时前
How to manage python versions on windows
开发语言·windows·python
9***P3344 小时前
PHP代码覆盖率
开发语言·php·代码覆盖率
CoderYanger4 小时前
优选算法-栈:67.基本计算器Ⅱ
java·开发语言·算法·leetcode·职场和发展·1024程序员节
jllllyuz4 小时前
Matlab实现基于Matrix Pencil算法实现声源信号角度和时间估计
开发语言·算法·matlab
多多*4 小时前
Java复习 操作系统原理 计算机网络相关 2025年11月23日
java·开发语言·网络·算法·spring·microsoft·maven
p***43485 小时前
Rust网络编程模型
开发语言·网络·rust
ᐇ9595 小时前
Java集合框架深度实战:构建智能教育管理与娱乐系统
java·开发语言·娱乐
梁正雄5 小时前
1、python基础语法
开发语言·python
强化学习与机器人控制仿真6 小时前
RSL-RL:开源人形机器人强化学习控制研究库
开发语言·人工智能·stm32·神经网络·机器人·强化学习·模仿学习
百***48076 小时前
【Golang】slice切片
开发语言·算法·golang