linux一些操作,记着给自己用的

1.解压tar.bz2

tar jxvf android-ndk-r5c-linux-x86.tar.bz2

2.linux IP可以访问域名无法访问

vi /etc/resolv.conf

添加,

nameserver 202.106.46.151

3.linux 安装deb文件

sudo dpkg -i ibus-sogoupycc_0.2.5-1_i386.debibus-sogoupycc-data_0.2.5-1_all.deb

4.UBUNTU清理内存(sudo su下执行)

echo 1 > /proc/sys/vm/drop_caches

5.UBUNTU查看内存free -m6.给VMWARE虚拟机硬盘瘦身

——————————–

http://www.linuxcast.net不错的linux学习网站,最近看视频才想起这个博客,继续记录吧

7,程序暂停,前台,后台执行的问题

正在执行的进程可以使用Ctrl+Z暂停掉

jobs看后台作业,带序号的

可以使用fg <序号>将暂停的jobs前台运行

bg <序号>将暂停的Jobs后台运行

8.ESC+.可以得到上次命令的参数9.创建硬盘分区

使用fdisk /dev/vdb,对vdb做操作,进入操作界面按m根据提示操作即可,创建主分区,创建扩展分区,在扩展分区基础上创建逻辑分区

10.创建逻辑卷1.需要创建物理卷(PV),会分成若干物理扩展PE(4M大小),使用命令pvcreate /dev/vdb,使用pvs/pvdisplay查看2.在该物理卷上创建逻辑卷组(VG) test,vgcreate test /dev/vdb,创建完使用vgs/vgdisplay查看下3.在该卷组中创建2G大小的逻辑卷(LV) test-1, lvcreate -n test-1 -L 2G test ,使用lvs/lvdisplay查看4.之后mkfs再mount即可使用,路径是/dev/{vg-name}/{lv-name}5.umount之后删除逻辑卷,lvremove /dev/{vg-name}/{lv-name}6.删除卷组, vgremove /dev/{vg-name}7.清除物理卷,pvremove /dev/vdb11.screen的使用

screen创建一个会话screen -ls 列出已存在的会话screen -r {id} 切换到指定id的会话Ctrl+a d 退出当前的会话,但会话还在后台,可以resume在会话中Ctrl+d则完全结束会话在会话中Ctrl+a c可创建新窗口在会话中Ctrl+a S可以横向分屏,Ctrl+a |可竖向分屏在会话中Ctrl+a tab可以再分屏中切换在会话中Ctrl+a {数字}可以切换窗口,即Ctrl+a c创建的,Ctrl+a n是下一个窗口,Ctrl+a p是前一个窗口在会话中Ctrl+a A可以设定窗口名Ctrl+a ?查看帮助screen用vi打开退出后依然保留,http://stackoverflow.com/questions/9979318/how-to-avoid-emacs-or-vi-remaining-on-your-screen-after-closing-when-using-gnu,在~/.screenrc增加altscreen on,再ctrl+a :source ~/.screenrc

12.missing LSB tags最近在debian上安装screen出现这个问题导致安装不完整,出现类似下面的问题

insserv: warning: script 'K01monitor' missing LSB tags and overridesinsserv: warning: script 'monitor' missing LSB tags and overridesinsserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!

解决见http://forum.directadmin.com/showthread.php?t=42174与其他的服务脚本对比,需要对应服务/etc/init.d/monitor加上(因为这里是monitor服务,其他服务也对应文件加就行)

### BEGIN INIT INFO# Provides:             monitor# Required-Start:       $syslog# Required-Stop:        $syslog# Should-Start:         #named# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start and stop directadmin# Description: DirectAdmin### END INIT INFO

现在睡觉的话,会做梦;而现在学习的话,会让梦实现。

linux一些操作,记着给自己用的

相关文章:

你感兴趣的文章:

标签云: