ubuntu16.04(LTS)日常命令记录

/**********系统命令*********/

sudo apt remove --purge 软件名称    //删除软件
sudo apt autoremove --purge 软件名称    //删除软件
sudo gdebi 软件包          //安装软件
sudo dpkg  --get-selections|grep 软件相关名称   //查询软件具体名称
sudo mv /path/a  /bpath     //移动a到b文件夹中
ps aux|grep 应用程序        //查询应用程序运行的服务
ldd x.c             //列出程序动态库依赖关系
sudo /path mkdir x      //创建文件夹,若无路径,默认在当前文件夹
sudo mv a b         //a重命名为b
sudo /etc/rc2.d         //此目录下,'S'开头意为开机自启,'K'开头意为关闭开机自启
rar a test.rar file_a       //把file_a压缩为test.rar,若目录下已存在test.rar,则把fil_a压缩进test.rar 
hexdump file(binary)        //打开二进制文件
sudo create_ap wlp2s0 lo 拾柒 1194579594      //开热点
sudo chown -R wayne17 photo     //改变photo文件夹所有者
sudo shutdown -h 14:00      //14:00关机(-r则重启)
ps aux|grep ""    kill -s 9 pid     //强制杀死进程
tar xvJf *.tar.xz      //解压tar.xz
tar -cvjpf etc.tar.bz2 /etc     //tar打包压缩文件夹,/etc 为要打包的文件夹
zip -r a.zip a/
sudo pkill Xorg        //解决桌面假死

sudo rm /var/lib/dpkg/lock      // 解决 无法获得锁
sudo rm /var/lib/apt/lists/lock


sudo apt-get autoclean      //清理旧版本的软件缓存 OK(已经卸载掉的软件包)
sudo apt-get clean      //清理所有软件缓存 OK(电脑上存储的安装包)
sudo apt-get autoremove     //删除系统不再使用的孤立软件 OK

ldconfig -p | grep lts  //查看是否有某库文件

sudo /etc/init.d/privoxy start/stop     // terminal翻墙
export http_proxy="127.0.0.1:8118"
export https_proxy="127.0.0.1:8118"

sudo sysv-rc-conf       // 管理开机启动服务
systemd-analyze blame   // 查看开机耗时




preload.service
NetworkManager-wait-online.service
preload.service
apache-htcacheclean.service
xinetd.service
nfs-idmapd.service
iio-sensor-proxy.service
postfix.service
ModemManager.service
avahi-daemon.service
accounts-daemon.service
nfs-server.service
bluetooth.service
/**********系统命令*********/



/**********投影*********/

xrandr  //显示屏幕及接口状况
xrandr -q   //显示外部接口所支持的输出分辨率
xrandr --output HDMI-1 --same-as eDP-1 --mode 1920x1080     //指定输出分辨率

/**********投影*********/






/**********Emacs*********/
m-w     //复制
c-w     //剪切
c-y     //粘贴
c-x+h       //全选
c-x c-l     //选定区变小写
c-x c-u     //选定区变大写
c-r c-w     //搜索当前单词
m+%         //替换
/**********Emacs********/






/**********刻录镜像********/

首先
lsblk   //查看U盘盘符,并确保U盘没有挂载
dd bs=4M if = /isopath.iso of = dev/sdb(不带数字,代表U盘总盘) status = progress && sync  //刻录镜像

/**********刻录镜像********/




/**********TLP**********/

sudo tlp ac 此命令意思为开启电源模式.
sudo tlp bat 此命令意思为开启电池模式.
sudo tlp stat 查看TLP工作情况
sudo tlp-stat -C 查看TLP配置情况
sudo tlp usb 开启USB电池管理模式
以上为常用几条命令,具体更多命令可以sudo tlp查看.

/**********TLP**********/




/**********LaTeX**********/
tlmgr --gui 包管理图形界面

/**********LaTeX**********/


/**********LAMP**********/
sudo /etc/init.d/apache2 restart  //重启apache
service php7.0-fpm restart & sudo /etc/init.d/php7.0-fpm restart       //重启php

sudo pkill php-fpm  //杀死php进程
sudo pkill apache2  //杀死apache2进程
/**********LAMP**********/

猜你喜欢

转载自blog.csdn.net/wayne17/article/details/81432983
今日推荐