luobo2ni 发表于 2018-1-12 10:59:38

ubuntu 常用命令集

  一。安装的时候,让你输入代替root用户的名称与密码
  使用sudo root切换root的时候会要求你输入密码,这时候你输入什么都不对的
  要想使用的哈,需要给root设置密码,命令如下:
  sudo passwd root
  然后输入两次密码
  然后注销,使用其他用户登陆。
  ctrl+art+t进入命令
  二。编辑文件:
  1.进入文件目录下,打vi gitlab.yml ,如果编辑错了,就按exc,按shift+:,输入q!就可以不保存退出
  2.先用hjkl四个上下左右键移动到需要修改的位置,或者是上下左右键。
  3,按X删除想要删除的内容,如果想删除整行,按dd
  4.在光标处按i,开始输入内容
  5.按exc,按shift+:,输入:wq保存文件并退出
  6.输入gitlab-ctl stop,输入gitlab-ctl start重启
  三安装命令
  无版图
  wget https://downloads-packages.s3.amazonaws.com/ubuntu-12.04/gitlab_7.0.0-omnibus-1_amd64.deb
  sudo apt-get install openssh-server
  sudo apt-get install postfix # sendmail or exim is also OK
  sudo dpkg -i gitlab_7.0.0-omnibus-1_amd64.deb
  sudo -e /etc/gitlab/gitlab.rb
  sudo gitlab-ctl reconfigure
  username: root
  password: 5iveL!fe
  设置后的密码:12345678
  全名:test
  用户名:test1
  centos
  wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0_omnibus-1.el6.x86_64.rpm
  sudo yum install openssh-server
  sudo yum install postfix # sendmail or exim is also OK
  sudo rpm -i gitlab-7.0.0_omnibus-1.el6.x86_64.rpm
  Install and start GitLab; open up the firewall
  sudo gitlab-ctl reconfigure
  sudo lokkit -s http -s ssh # open up the firewall for HTTP and SSH requests
  Login by browsing to the host where you installed GitLab
  username: root
  四,常用启动命令
  密码:1234%^&*nckk
  编辑文件命令:vi
  git服务器启动和关闭:gitlab-ctl start(stop)
  关闭服务器:shutdown -h now
  activemq服务启动出现locked:是因为启动了两个服务
  删除软件
  sudo apt-get remove gitlab
  五.查看ip:ip addr
  六.技术文档地址
  http://172.16.50.96/
  研发入口登录:
  syang/syang
  看文档进研发管理
  7解压文件
  安装 rar 解压缩文件:
  打开终端,输入命令:
  sudo -s -H (让用户切换到root最高权限)
  在后面输入你的用户密码
  然后输入命令:
  sudo apt-get install rar
  等着安装完毕就OK了!
  在这里可以用命令:
  man rar
  来查看一下rar命令的详细情况以后有rar的文件需要解压的话,只需要在终端输入命令:
  rar e myfile.rar
  就可以了!
  另外你可以去你的文件夹里找一个rar的压缩文件,
  点右键,你会发现多了一条“解压到此处的”选择,是不是方便多了!呵呵!
  7zip的安装:sudo apt-get install p7zip
  7zip的解压:7zr x myfile.7z 或者 7zr e myfile.7z
  end output of /opt/gitlab/bin/gitlab-rake
  chef:exceptions:childconvergeerror
  8.网络ip
  223.203.195.156
  9.查看端口
  lsof -i:80
  10查看版本信息
  cat /etc/issue
  sudo lsb_release -a
  11显示详细系统信息
  lshw
  lshw-short
  lshw-C memory
  12显示内核缓冲区系统控制信息
  dmesg
  13卡死解决
  刚开始安装的时候用着还行,不过后来发现用了一会总是会出现卡死的状况
  后来看了下ubuntu12.04的内核是3.2,后来把内核升级到3.5发现这种情况不会出现了。
  查看内核以及升级内核
  uname -a
  apt-get install linux-generic-lts-quantal xserver-xorg-lts-quantal
  安装后发现,firefox浏览器开启的时候有时候会cpu占用率高达100%,再此才找到3.2内核时候会卡死的原因。
  14.下载软件地址:
  172.16.50.211
  192.168.8.231
  15.官网下载地址
  https://about.gitlab.com/downloads/
  16.Ubuntu添加删除服务
  2009-01-18 20:47:52|分类: Linux |举报|字号 订阅
  添加一个服务
  sudo update-rc.d 服务名 defaults 99
  删除一个服务
  sudo update-rc.d 服务名 remove
  临时重启一个服务
  /etc/init.d/服务名 restart
  临时关闭一个服务
  /etc/init.d/服务名 stop
  临时启动一个服务
  /etc/init.d/服务名 start
  ps -ef | grep 进程ID
  17.ubuntu重启
  shutdown -r +3 “The System will reboot after 3 minutes”
  18.查看进程
  top退出ctrl+c
  19.git库的位置
  var/opt/gitlab/git-data
  20.root不能修改和删除的文件,
  首先去除i属性:chattr -i 然后强制删除:rm -rf
  21.查看流量
  第一种:安装 ethstatus 软件 sudo apt-get install ethstatus
  查看 ADSL 的速度 sudo ethstatus -i ppp0
  查看 网卡 的速度 sudo ethstatus -i eth0
  第二种:nethogs
  22.查看系统是32位还是64位
  sudo uname --m如果显示i686,你安装了32位操作系统,如果显示 x86_64,你安装了64位操作系统
  23.Ubuntu下查看软件版本及安装位置查看软件版本:
  查看软件版本:aptitude show xxx也可用apt-show-versions (要先安装sudo apt-get install apt-show-versions)
  查看软件安装位置: dpkg -L xxxx
  查看软件是否安装: dpkg -l | grep filename
  24.服务器重启
  shutdown -r -t 500
  25.gitlab备份与恢复 git备份
  gitlab备份:gitlab-rake gitlab:backup:create
  备份到目录/var/opt/gitlab/backups
  gitlab恢复 :停止相关数据连接服务
  g
  gitlab-ctl stop unicorn
  gitlab-ctl stop sidekiq
  # 从1393513186编号备份中恢复
  gitlab-rake gitlab:backup:restore BACKUP=1466811825
  # 启动
  G
  Gitlab sudo gitlab-ctl start
页: [1]
查看完整版本: ubuntu 常用命令集