常用linux命令积累

------------------------------不定时更新-------------------------------------------------

1.Ubuntu关机:shutdown -h 0 立刻关机(root用户使用)、shutdown -h 10 10分钟后自动关机、shutdown -c 命令取消关机

2.Ubuntu重启:shutdown -r 0 立刻重启(root用户使用)、shutdown -r 10 10分钟后自动重启、shutdown -c 命令取消重启

3.tar -vcf xx.gz xxx  把xxx  压缩成xx.gz 、tar -vxf xxx.gz  解压xxx.gz

4.grep -r xxx *  在所有文件中搜索包含xxx关键字的文件,-r表示递归查找

5.apt-get install xxx   安装xxx

   apt-get remove xxx   卸载xxx

6.find -name "x"  查找x的文件

7.make clean-模块名  只clean模块的中间文件,比如APP的编译等

8.ADB的使用

  8.1 adb remount    重新挂载文件系统,即变only read为可读可写

  8.2 adb shell screencap -p /mnt/sdcard/xx.png  截图命令

  8.3 adb connect xxx.xxx.xxx.xxx      同一网段下连接设备

  8.4 adb shell                   进入设备文件系统

  8.5 adb push                 推到设备

       8.6 adb kill-server            结束adb任务

  8.7 start adbd/stop adbd          Android上重启adb服务

  8.8 adb install -f xxx            覆盖安装(远程)

  8.9 pm install -f xxx             本地覆盖安装

9.dmidecode -t memory或dumpsys meminfo  查看内存ddr信息(root),其他cpu等信息在/proc/xx

10.sudo chattr +a xxx            给文件目录添加保护(防误删

11.lsattr                    查看文件隐藏属性,如写保护等

12.sudo apt-get install -f            修复linux中安装软件时依赖问题

13.am start -n {包(package)名}/{包名}.{活动(activity)名称}    启动Activity

14.ip addr/ifconfig              查看ip地址等

15.cat /sys/class/net/wlan0/address       查看wlan0的mac地址
16.ifconfig wlan0 down
  ifconfig wlan0 hw ether 12:34:56:78:9a:bc
    ifconfig wlan0 up            修改wlan0地址,本次开机有效

17.dumpsys |grep BroadcastRecord      仅查看Android系统发出的广播

  

原文地址:https://www.cnblogs.com/pngcui/p/5403149.html