linux常用命令

###git
在github上参与别人的项目或则多人共同开发一个项目的话,fork一个项目的仓库过来,自己做完提交pull request之后,就等着作者review过之后进行merge了。但是之后作者再进行新的改动,我的分支上还是原样,那么怎样让把我的分支上的与最新的仓库一直呢?

1
2
3
4
5
#assume you originally cloned from your forked repo,that remote will be called "origin", 
#then you need to add firstguy repo as another remote
git remote add firstguy git://github.com/firstguy/repo.git
#After that is all set up, you should indeed be able to
git pull firstguy mastergit push origin

###ubuntu apt
apt search

1
2
3
# package search
apt-cache search
apt-cache show #------(package 获取包的相关信息,如说明、大小、版本等)

apt install&remove

1
2
3
4
5
6
7
#package install
sudo apt-get install
sudo apt-get install # -----(package - - reinstall 重新安装包)
sudo apt-get -f install # -----(强制安装?#"-f = --fix-missing"当是修复安装吧...)
sudo apt-get remove #-----(package 删除包)
sudo apt-get remove - - purge # ------(package 删除包,包括删除配置文件等)
sudo apt-get autoremove --purge # ----(package 删除包及其依赖的软件包+配置文件等

apt update and more

1
2
3
4
5
6
7
8
9
10
11
#update source
sudo apt-get update
sudo apt-get upgrade #------更新已安装的包
sudo apt-get dist-upgrade # ---------升级系统
sudo apt-get dselect-upgrade #------使用 dselect 升级
apt-cache depends #-------(package 了解使用依赖)
apt-cache rdepends # ------(package 了解某个具体的依赖?#当是查看该包被哪些包依赖吧...)
sudo apt-get build-dep # ------(package 安装相关的编译环境)
apt-get source #------(package 下载该包的源代码)
sudo apt-get clean && sudo apt-get autoclean # --------清理下载文件的存档 && 只清理过时的包
sudo apt-get check #-------检查是否有损坏的依赖

nohup: short for “no hang up”

  • usage: nohup command &
  • default output: nohup.out which contains std out and std error, I refquently use this: nohup sslocal > log &

EOF