下视频的时候,老是要找出历史命令。
次数多了,我也烦。。。
打算简化这一步骤
自然就想到自定义命令~~~
### 查看用户目录是否有.bash_profile
MacBook-Pro:~ user$ ls -la ~/.bash_profile
-rw-r--r-- 1 user staff 1006 Jun 10 10:26 /Users/user/.bash_profile
### 编辑 .bash_profile
nano ~/.bash_profile
### 在 .bash_profile 追加
# Alias youtube-dl
alias ydb='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvid
eo[ext=webm]+bestaudio[ext=webm]"'
### 命令生效
MacBook-Pro:~ user$ source ~/.bash_profile
### 检查命令是否生效
MacBook-Pro:~ user$ alias ydb
alias ydb='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvid
eo[ext=webm]+bestaudio[ext=webm]"'