您的位置:首页 > 运维架构 > Linux

linux常用命令

2014-03-26 09:58 169 查看
1、ubuntu查看内核

1.1、root@cddbd5b6e07f:/# cat /etc/issue
Ubuntu 12.04 LTS \n \l

1.2、root@cddbd5b6e07f:/# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"

1.3、root@cddbd5b6e07f:/# cat /proc/version
Linux version 3.8.0-25-generic (buildd@komainu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #37~precise1-Ubuntu SMP Fri Jun 7 16:27:35 UTC 2013

1.4、root@cddbd5b6e07f:/# uname -a
Linux cddbd5b6e07f 3.8.0-25-generic #37~precise1-Ubuntu SMP Fri Jun 7 16:27:35 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

1.5、root@cddbd5b6e07f:/# uname -r
3.8.0-25-generic


2、scp远程文件传输到本地

linjiqin@ubuntu:~$ ssh username@192.168.1.107 #ssh远程连接
linjiqin@ubuntu:~$ scp local_file remote_username@remote_ip:remote_folder


3、Shift+Insert 等价于windows ctrl+V

4、mysql

linjiqin@ubuntu~: mysqld_safe & #启动mysql
linjiqin@ubuntu~: create database dkhs CHARACTER SET utf8 COLLATE utf8_general_ci; #设置mysql编码


5、ctr+shift+t: 打开终端

6、/usr/sbin/sshd:启动ssh服务

7、终端切换快捷键

ctrl + pageUp
ctrl + pageDown

8、git checkout -- coresite/coresite/templates/homepage.html

9、查看python编译源码:/usr/local/lib/python2.7/dist-packages/

10、vim常用快捷键

you 撤销
y 复制
p 黏贴
ctr+o 后退
ct+]

11、Ubuntu下使用sshfs挂载远程目录到本地

Ubuntu源中已经包含了sshfs,以及所需的fuse包,直接安装即可:sudo apt-get install sshfs

使用以下命令:
linjiqin@ubuntu:~$ sudo sshfs -oallow_other linjiqin@49.234.2.115:/home/remote /home/local
/home/remote 远程目录
/home/local 本地方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: