Ubuntu常用命令

来源:互联网 发布:淘宝茉莉广场舞服装 编辑:程序博客网 时间:2024/06/10 12:35

转战Ubuntu 后,经常会用到一些命令,为了便于自己尽快熟悉,将用过的命令略记于此,以便查看。

1.scp 命令: 远程文件传输

scp src  destination

src:表示被传输文件路径及文件名,例如:Download/test.txt

destination;表示目的地。格式为:user@host1:destinationfilepath 。例如:yangming@192.168.1.55:/home/yangming/


2.find 命令

从跟目录下开始按名字进行搜索以test开头的文件或目录。

sudo find / -name test*

3.ps命令

查看所有进程 

ps -ae

查看详情

ps -l


查看wps相关的进程

ps -ef |grep wps*

4.free查看内存

free -s 10 每10秒检查内存使用情况

5.top动态显示进程

按大写P:按CPU使用时间排序

按大写M:按内存使用多少排序

按大写T:按执行时间排序

按小写u:按监视特定用户排序

按大写K:删除进程

top -d 10 指定10s更新时间

6.kill进程

kill PID 

7.df查看磁盘空间

df -hl

8.清理下载的缓存包

sudo apt-get autoclean

sudo apt-get clean

9清理不在需要的包

sudo apt-get autoremove

10删除多余内核映像

(1)查看已安装内核映像

sudo dpkg --get-selections  | grep linux-image

(2)查看当前内核版本

uname -r

(3)删除多余内核版本

sudo apt-get purge 版本

11.修改ubuntu默认字符集

用locale查看ubuntu默认字符集为en_US.UTF-8,需

 

要修改为zh_CN.GB2312.

 

首先vi /var/lib/locales/supported.d/local

将zh_CN.GB2312加入到后面,保存

 

执行:locale-gen

 

然后:vi /etc/profile  加入

 

LC_ALL="zh_CN.GB2312"

LANG="zh_CN.GB2312"

export LANG  LC_ALL

执行:source /etc/profile

 

ok!再用locale查看,发现字符集变为:zh_CN.GB2312






  



原创粉丝点击