Linux分享

特点

开源

  • Linux Kernel / GNU /ɡnuː/

免费

  • Linux发行版 = Linux Kernel + GNU + 桌面(Gnome /ˈnoʊm/) + 包管理

开源不等于免费 免费不等于开源

兼容

  • MacOS / Unix

包管理

以Debian(['dɛbɪən])为例

安装

  • 通过软件源安装
sudo apt install package-name

sudo apt install git

apt和apt-get区别在哪?

  • 通过软件包安装
sudo dpkg -i *.deb

wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3059_amd64.deb

sudo dpkg -i sublime-text_build-3059_amd64.deb

卸载

sudo apt remove package-name

sudo apt remove git
sudo dpkg -r package-name

sudo dpkg -r sublime-text_build-3059_amd64.deb

查询

which package-name // 查询运行文件所在路径

dpkg -s package-name // 查找包的详细信息

Shell

oh-my-zsh

  • 大小写
cd ~/des # press tab

cd ~/Desktop
  • alias
cat /etc/shells

vim ~/.oh-my-zsh/plugins/git/git.plugin.zsh

alias ga='git add'

alias gb='git branch'

alias gst='git status'

alias grv='git remote -v'

alias glum='git pull upstream master'

自定义命令

vim ~/.zshrc

alias sync-master="git checkout master && git pull upstream master && git push origin master"

alias ssh-zeaho-test="ssh [email protected]"

. ~/.zshrc
  • prompt
vim ~/.oh-my-zsh/themes/robbyrussell.zsh-theme

PROMPT='%{$fg_bold[blue]%}%M ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'

. ~/.zshrc

Terminator

image.png

快捷键

ctrl + c 停止

ctrl + w 删除光标前的命令参数

ctrl + a 将光标移到最前

ctrl + e 将光标移到末尾

ctrl + l 清屏

ctrl + r 搜索历史命令

linux shell常用快捷键

命令

ssh

ssh-keygen -t rsa -C "[email protected]"

ssh-copy-id -i ~/.ssh/id_rsa.pub user@server-ip

find

find ./store

find ./store -name "*.md"

grep

grep "this" ./store/README.md

find ./store -name "*.md" | xargs grep "this"

开发

  • nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.3/install.sh | bash

nvm install --lts
  • pyenv

  • rbenv

  • phpbrew

  • Software Development Kits for the JVM

Deepin

  • 精美的UI

  • 丰富的软件库

  • Wine软件稳定性

参考

  • Unix, Mac OS and Linux?

  • Linux内核与GNU/Linux发行版

  • ubuntu服务

  • Shell脚本学习指南

你可能感兴趣的:(Linux分享)