ubuntu 经常使用命令集

一。安装的时候,让你输入代替root用户的名称与密码linux

使用sudo root切换root的时候会要求你输入密码,这时候你输入什么都不对的git

要想使用的哈,须要给root设置密码,命令以下:ubuntu

sudo passwd rootcentos

而后输入两次密码浏览器

而后注销,使用其余用户登录。服务器

 

 

ctrl+art+t进入命令网络

 

二。编辑文件:ssh

1.进入文件目录下,打vi gitlab.yml ,若是编辑错了,就按exc,按shift+:,输入q!就能够不保存退出ide

2.先用hjkl四个上下左右键移动到须要修改的位置,或者是上下左右键。gitlab

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

 

.查看ipip 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

相关文章
相关标签/搜索