1、ubuntu 任务栏到底部
Ubuntu 16.04 LTS 3月19日更新,然后重启系统,这样输入的命令才能真正将 Unity 7 启动器移动到桌面底部。
我们目前还不清楚,Canonical 是否会在 Ubuntu 16.04 LTS 正式版或者以后版本当中增加启动器放置到桌面底部的选项,无需用户自己手动输入命令。
将 Ubuntu 16.04 LTS 的 Unity 启动器移动到桌面底部命令:
gsettings set com.canonical.Unity.Launcher launcher-position Bottom
恢复到原来的左侧命令:
gsettings set com.canonical.Unity.Launcher launcher-position Left
2、查看占用端口号
netstat -nap #会列出所有正在使用的端口及关联的进程/应用
lsof -i :portnumber #portnumber要用具体的端口号代替,可以直接列出该端口听使用进程/应用
netstat -lnp|grep 88 #88请换为你的apache需要的端口,如:80
netstat -apn | grep 4040
vim test.sh
:set ff
如果出现fileforma=dos那么就基本可以确定是这个问题了。
:set fileformat=unix
:wq
OK了。。。。。。。
tar里面包含一个tar,会出现如下提示:
This does not look like a tar archive
- #gzip -d xxxx.tar.gz
- #tar -xf xxxx.tar
5、安装vim后,使用vi 字体会发生变化,便于识别
6、每次启动Ubuntu都显示System program problem detected,很烦人,不过修改一个文件就可以。
执行命令:
sudo gedit /etc/default/apport
将enabled=1改为enabled=0保存退出即可
7、find 重定向,去掉
Permission denied
find / -name "*.conf" 2>>/dev/null
/sbin/generate-modprobe.conf
/boot/grub/grub.conf
8、再python文件中查找关键字The full contents of the message body
find /usr/lib/python2.7/site-packages/ -type f -name "*.py" | xargs grep "The full contents of the message body"
9、上下键、backspace 不能用
vi /etc/vim/vimrc.tiny
##处理上下键倒数第二行
compatible”改为“nocompatible
##处理backspace
那句话的后面加一句:
set backspace=2
10 \
启用 yum 缓存
要配置
yum
保留已下载的文件而不是删除,设置
/etc/yum.conf
中的
keepcache
选项为
1
:
keepcache=1
打开缓存后,每个
yum
操作都可能从仓库下载软件包数据。要保证缓存包含了软件包数据,在启用缓存后运行一个操作,例如
list
或
search
来下载软件包数据而不影响系统。
11、
nohup command > /dev/null 2>&1 &
nohup 代表忽略hup信号,
& 代表以后台job形式运行
command > /dev/null 代表stdout输出到空文件
2>&1 中的2>代表stderr输出,&1代表前面/dev/null的引用,这种写法减少文件IO操作,效率高
- /dev/null 表示空设备文件
- 0 表示stdin标准输入
- 1 表示stdout标准输出
- 2 表示stderr标准错误