farwmarth

Those that can,do.Those that can't ,complain


  • 首页

  • 关于

  • 归档

  • 豆瓣

  • 音乐

  • 搜索
close

ubuntu,centos 备忘

时间: 2017-01-03   |   分类: ubuntu     |   阅读: 766 字 ~2分钟

安装常用软件:

  • subversion svn 版本命令行
  • lua5.2 lua版本
  • ssh ssh 连接
  • nautilus-open-terminal 终端
  • fcitx-table-wbpy 五笔
  • avant-window-navigator 启动器位置

常用操作

# 查看版本
cat /etc/issue
# 修改密码
sudo passwd 用户名
# 查看端口占用
lsof -i:80
# 所占端口
netstat -antp | grep  skynet
# 查看环境变量
env
# 查看当前系统版本信息
cat /etc/issue
# 查看端口数据
tcpdump -s 0 -X 'tcp dst port 8888'
# 卸载程序
sudo dpkg -l sub*
sudo dpkg -r sublime-text
# 查看磁盘占用 
du -sh /* 
#查找内存rsz为实际内存
ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid' |grep skynet
ps -e -o 'pid,comm,rsz' |grep skynet
#查找最后多少行信息
 tail -n 50 nohup.out

查找文件

#按时间反序排序当前文件夹中文件(-r反序)
ls -ltr
#按时间
ll -t -time-style=full-iso
#在当前文件夹内查找最近一天内更改的文件(包括子文件夹):
find . -type f -mtime -1
#1天以前更改的文件:
find . -type f -mtime +1
#最近10分钟内状态变化的文件:
find . -type f -cmin -10
#一天内修改过的文件
find . -atime -1
#查找指定名字的文件
find . -name "*.xmind"  
# 按大小查找
find . -size +1000c -print 
#删除目录下所有的pyc
find . -name "*.pyc" -exec rm -f {} \;
#tree :生成目录结构
tree . -L 1 #设置层次

#linux 修改时间同步时间
date -s 14:36:00
clock -w
/usr/sbin/ntpdate –u 0.asia.pool.ntp.org

#按名称查找 
find / -name mysql
#查看glibc版本
ldd  --version

#指定前后行数
cat a.txt |grep -C 5 xx
#统计字符串出现次数
cat logging.2016-11-19--01-03-29-31812.log |grep -c _recv_pay_data

安装jdk

  • 在Ubuntu下安装jdk 出现./install.sfx.2354: not found无法安装成功

    + 安装

    shell

sudo chmod u+x jdk-6u23-ea-bin-b03-linux-i586-18_oct_2010.bin
./jdk-6u23-ea-bin-b03-linux-i586-18_oct_2010.bin

sudo gedit ~/.bashrc

export JAVA_HOME=/home/far/Develop/tools/jdk1.6.0_38

source ~/.bashrc

### 改变键盘布局ctrl win

grep -e “ctrl:|:ctrl” /usr/share/X11/xkb/rules/evdev.lst setxkbmap -option altwin:ctrl_win setxkbmap -print

### python

shell sudo apt-get install python-pycurl sudo apt-get install python-pip –dabian sudo yum install gcc python-devel python setup.py build python setup.py install 查看已安装的python模块: help(“modules”)

### 给alias添加命令行参数

shell alias pc=‘commit() { git add .; git commit -m “$1”; git push origin source }; commit’

### putty 

+ 上传文件

pscp -P 端口号 -l 用户 -r 本地路径 服务器ip:服务器目录

+ 备份 PuTTY 配置文件

开始->运行(Win+R)->regedit 找到 HKEY_CURRENT_USER/Software/SimonTatham 在 SimonTatham 这个节点上点击右键,选择导出,保存即可

+ putty在登录之后自动切换到目录

shell ssh—>remote command 添加 cd /my/path ; /bin/bash

## ubuntu 常见问题
### Ubuntu无法找到add-apt-repository问题的解决方法

shell apt-get install python-software-properties apt-get install software-properties-common

### 应用菜单栏消失

shell initctl restart unity-panel-service ```

#ubuntu#
初级运维指南
国内源
farwmarth

farwmarth

Programmer

104 日志
32 分类
93 标签
GitHub
© 2009 - 2021 farwmarth
Powered by - Hugo v0.58.2
Theme by - NexT
0%