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
参考资料
相关推荐
m0_7487080511 小时前
C++中的观察者模式实战
开发语言·c++·算法
qq_5375626712 小时前
跨语言调用C++接口
开发语言·c++·算法
wjs202412 小时前
DOM CDATA
开发语言
Tingjct12 小时前
【初阶数据结构-二叉树】
c语言·开发语言·数据结构·算法
猷咪12 小时前
C++基础
开发语言·c++
IT·小灰灰12 小时前
30行PHP,利用硅基流动API,网页客服瞬间上线
开发语言·人工智能·aigc·php
快点好好学习吧12 小时前
phpize 依赖 php-config 获取 PHP 信息的庖丁解牛
android·开发语言·php
秦老师Q12 小时前
php入门教程(超详细,一篇就够了!!!)
开发语言·mysql·php·db
烟锁池塘柳012 小时前
解决Google Scholar “We‘re sorry... but your computer or network may be sending automated queries.”的问题
开发语言
是誰萆微了承諾12 小时前
php 对接deepseek
android·开发语言·php