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
参考资料
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值