查看当前目前总占用空间
du -sh ./
查看当前目录下的所有文件或者子目录的占用空间
du -sh *
将目录下的文件或者子目录按从大到小排序
du -s *|sort -nr
将目录下的文件或者子目录按从大到小排序,并取前5行
du -s *|sort -nr|head -5
查看当前目前总占用空间
du -sh ./
查看当前目录下的所有文件或者子目录的占用空间
du -sh *
将目录下的文件或者子目录按从大到小排序
du -s *|sort -nr
将目录下的文件或者子目录按从大到小排序,并取前5行
du -s *|sort -nr|head -5
使用adb shell getprop即可获得Android系统的版本号,如下:
1 2 3 |
获取系统版本:adb shell getprop ro.build.version.release 获取系统api版本:adb shell getprop ro.build.version.sdk |
另外直接执行adb shell getprop还可以获得更多的系统属性,如下是我机器显示的结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
[alsa.mixer.capture.headset]: [Capture] [alsa.mixer.capture.master]: [Capture] [alsa.mixer.playback.headset]: [Headphone] [alsa.mixer.playback.master]: [Playback] [alsa.mixer.playback.speaker]: [Playback] [back_camera_name]: [adv7180_decoder] [back_camera_orient]: [0] [camera.disable_zsl_mode]: [1] [dalvik.vm.dexopt-flags]: [m=y] [dalvik.vm.heapgrowthlimit]: [64m] [dalvik.vm.heapmaxfree]: [8m] [dalvik.vm.heapminfree]: [512k] [dalvik.vm.heapsize]: [384m] [dalvik.vm.heapstartsize]: [8m] [dalvik.vm.heaptargetutilization]: [0.75] [dalvik.vm.jniopts]: [warnonly] [dalvik.vm.stack-trace-file]: [/data/anr/traces.txt] [debug.egl.hw]: [1] [debug.force_rtl]: [0] [debug.sf.enable_hgl]: [1] [debug.sf.showfps]: [0] [dev.bootcomplete]: [1] [dhcp.wlan0.dns1]: [192.168.8.5] [dhcp.wlan0.dns2]: [114.114.114.114] [dhcp.wlan0.dns3]: [] [dhcp.wlan0.dns4]: [] [dhcp.wlan0.domain]: [] [dhcp.wlan0.gateway]: [192.168.23.1] [dhcp.wlan0.ipaddress]: [192.168.23.100] [dhcp.wlan0.leasetime]: [86400] [dhcp.wlan0.mask]: [255.255.255.0] [dhcp.wlan0.mtu]: [] [dhcp.wlan0.pid]: [1440] [dhcp.wlan0.reason]: [REBOOT] [dhcp.wlan0.result]: [ok] [dhcp.wlan0.server]: [192.168.23.1] [dhcp.wlan0.vendorInfo]: [] [front_camera_name]: [uvc] [front_camera_orient]: [0] [gsm.current.phone-type]: [1] [gsm.network.type]: [Unknown] [gsm.operator.alpha]: [] [gsm.operator.iso-country]: [] [gsm.operator.isroaming]: [false] [gsm.operator.numeric]: [] [gsm.ril.delay]: [15] [gsm.sim.state]: [NOT_READY] [hw.backlight.dev]: [pwm-backlight.0] [hw.bluetooth]: [0] [hwc.enable_dither]: [1] [hwc.stretch.filter]: [1] [init.svc.adbd]: [running] [init.svc.blueletd]: [running] [init.svc.bootanim]: [stopped] [init.svc.console]: [running] [init.svc.debuggerd]: [running] [init.svc.dhcpcd_wlan0]: [running] [init.svc.drm]: [running] [init.svc.healthd]: [running] [init.svc.installd]: [running] [init.svc.keystore]: [running] [init.svc.magd]: [stopped] [init.svc.mcu_server]: [running] [init.svc.media]: [running] [init.svc.netd]: [running] [init.svc.ril-daemon]: [running] [init.svc.sdcard]: [running] [init.svc.servicemanager]: [running] [init.svc.surfaceflinger]: [running] [init.svc.tw8836]: [stopped] [init.svc.ueventd]: [running] [init.svc.vold]: [running] [init.svc.watchdogd]: [running] [init.svc.wifi_mac]: [stopped] [init.svc.wpa_supplicant]: [running] [init.svc.zygote]: [running] [media.omxgm.enable-player]: [1] [media.omxgm.enable-record]: [1] [media.omxgm.enable-scan]: [1] [media.wfd.video-bitrate]: [adaptive] [net.bt.name]: [Android] [net.change]: [net.dns2] [net.dns1]: [192.168.8.5] [net.dns2]: [114.114.114.114] [net.hostname]: [android-4e5bb95fd128e923] [net.qtaguid_enabled]: [1] [net.tcp.buffersize.default]: [4096,87380,110208,4096,16384,110208] [net.tcp.buffersize.edge]: [4093,26280,35040,4096,16384,35040] [net.tcp.buffersize.ethernet]: [524288,2097152,4194304,524288,2097152,4194304] [net.tcp.buffersize.evdo]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.gprs]: [4092,8760,11680,4096,8760,11680] [net.tcp.buffersize.hsdpa]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.hspa]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.hspap]: [4094,87380,1220608,4096,16384,1220608] [net.tcp.buffersize.hsupa]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.lte]: [524288,1048576,2097152,262144,524288,1048576] [net.tcp.buffersize.umts]: [4094,87380,110208,4096,16384,110208] [net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576] [persist.sampling_profiler]: [1] [persist.sys.country]: [CN] [persist.sys.dalvik.vm.lib]: [libdvm.so] [persist.sys.language]: [zh] [persist.sys.localevar]: [] [persist.sys.profiler_ms]: [0] [persist.sys.usb.config]: [mtp,adb] [ro.FSL_AAC_PARSER]: [1] [ro.FSL_ASF_PARSER]: [0] [ro.FSL_AVI_PARSER]: [1] [ro.FSL_FLAC_PARSER]: [1] [ro.FSL_FLV_PARSER]: [1] [ro.FSL_MKV_PARSER]: [1] [ro.FSL_MPG2_PARSER]: [1] [ro.FSL_REAL_PARSER]: [0] [ro.adb.secure]: [1] [ro.allow.mock.location]: [1] [ro.baseband]: [unknown] [ro.board.platform]: [imx6] [ro.boot.console]: [ttymxc3] [ro.boot.hardware]: [freescale] [ro.boot.selinux]: [disabled] [ro.boot.serialno]: [0a05a1d4e6b61f90] [ro.bootloader]: [unknown] [ro.bootmode]: [unknown] [ro.build.characteristics]: [tablet] [ro.build.date.utc]: [1508731143] [ro.build.date]: [2017年 10月 23日 星期一 11:59:03 CST] [ro.build.description]: [sabreauto_6q-eng 4.4.3 2.0.0-rc2 20150123 dev-keys] [ro.build.display.id]: [sabreauto_6q-eng 4.4.3 2.0.0-rc2 20150123 dev-keys] [ro.build.fingerprint]: [Freescale/sabreauto_6q/sabreauto_6q:4.4.3/2.0.0-rc2/20150123:eng/dev-keys] [ro.build.host]: [chinatsp] [ro.build.id]: [2.0.0-rc2] [ro.build.product]: [sabreauto_6q] [ro.build.tags]: [dev-keys] [ro.build.type]: [eng] [ro.build.user]: [xuganggen] [ro.build.version.codename]: [REL] [ro.build.version.incremental]: [20150123] [ro.build.version.release]: [4.4.3] [ro.build.version.sdk]: [19] [ro.carrier]: [unknown] [ro.config.alarm_alert]: [Alarm_Classic.ogg] [ro.config.notification_sound]: [OnTheHunt.ogg] [ro.crypto.state]: [unencrypted] [ro.debuggable]: [1] [ro.factorytest]: [0] [ro.hardware.lightsensor]: [/sys/class/i2c-dev/i2c-1/device/1-0044/] [ro.hardware]: [freescale] [ro.kernel.android.checkjni]: [1] [ro.lightsensor.threshold]: [20] [ro.opengles.version]: [196608] [ro.product.board]: [SABREAUTO] [ro.product.brand]: [Freescale] [ro.product.cpu.abi2]: [armeabi] [ro.product.cpu.abi]: [armeabi-v7a] [ro.product.device]: [sabreauto_6q] [ro.product.locale.language]: [en] [ro.product.locale.region]: [US] [ro.product.manufacturer]: [Freescale] [ro.product.model]: [SABREAUTO-MX6Q] [ro.product.name]: [sabreauto_6q] [ro.revision]: [0] [ro.ril.wake_lock_timeout]: [300] [ro.runtime.firstboot]: [86414407] [ro.secure]: [0] [ro.serialno]: [0a05a1d4e6b61f90] [ro.sf.hwrotation]: [0] [ro.sf.lcd_density]: [160] [ro.tether.denied]: [false] [ro.wifi.channels]: [] [ro.zygote.disable_gl_preload]: [true] [rw.VIDEO_RENDER_NAME]: [video_render.surface] [service.bootanim.exit]: [1] [sys.boot_completed]: [1] [sys.emulated.battery]: [1] [sys.interactive]: [active] [sys.settings_global_version]: [2] [sys.sysctl.extra_free_kbytes]: [16200] [sys.usb.config]: [mtp,adb] [sys.usb.state]: [mtp,adb] [system_init.startsurfaceflinger]: [0] [vold.post_fs_data_done]: [1] [wifi.ap.interface]: [wlan0] [wifi.interface]: [wlan0] [wlan.driver.status]: [ok] [wlan.interface]: [wlan0] |
首先备份sources.list
1 |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak |
然后编辑sources.list
1 |
sudo vi /etc/apt/sources.list |
在原来的内容前面加上#,注释掉原来的内容,然后添加下面的内容
1 2 |
deb http://mirrors.aliyun.com/raspbian/raspbian/ wheezy main non-free contrib deb-src http://mirrors.aliyun.com/raspbian/raspbian/ wheezy main non-free contrib |
然后再执行更新就可以了
1 2 |
sudo apt-get update sudo apt-get upgrade |
转载自:http://blog.csdn.net/quqi99/article/details/51434248
SSH连接总是隔一段时间没有输入时就断开,解决办法如下:
方法一:修改服务端配置
sudo vi /etc/ssh/sshd_config
ClientAliveInterval 60 #服务端主动向客户端请求响应的间隔
ClientAliveCountMax 10 #服务器发出请求后客户端没有响应的次数达到一定值就自动断开
sudo restart ssh
方法二:修改客户端配置
sudo vi /etc/ssh/ssh_config #或~/.ssh/config
TCPKeepAlive=yes
ServerAliveInterval 60 #客户端主动向服务端请求响应的间隔
或
ssh -i <key-file> -o StrictHostKeyChecking=no -o TCPKeepAlive=yes -o ServerAliveInterval=30 ubuntu@<ip>
上面方式任选一种,我选客户端配置方式。
两台网络中的Linux主机可以通过scp命令传输文件或者文件夹。
假设本机为A,目标机器192.168.0.100为B,传输A的code.zip文件到B的机器上的命令为
1 |
scp /Users/liu/projects/code.zip root@192.168.0.100:/home/ |
如果要将A机器上的projects的整个目录拷贝到B,则加个-r参数即可,如:
1 |
scp -r /Users/liu/projects root@192.168.0.100:/home/ |
如果传输失败,请用ping命令看两台机器网络连接是否正常,或者目标机器的防火墙是否没有关闭
1.删除一行:
方法一:将光标定位到要删除的行,输入dd
方法二:输入1d,然后按回车键
2. 删除多行:
输入ndd删除多行,n为要删除的行数
3. 定位到行首:输入0
4. 定位到行尾:输入$
5. 进入到编辑模式:输入i
6. 进入到编辑模式,并新加行:输入o
7. 定位到文档起始位置:输入:1或者gg
8. 定位到文档结尾:输入:$或者G(大写)
9. 查找文字:输入/,然后输入要搜索的内容(区分大小写)
10. 查找下一个:执行上面的命令后,输入n查找下一个符合条件的内容
11. 替换文字:
:s/home/disk2/ 替换当前行第一个 home 为 disk2
:s/home/disk2/g 替换当前行所有 home 为 disk2
:n,$s/home/disk2/ 替换第 n 行开始到最后一行中每一行的第一个 home 为 disk2
:n,$s/home/disk2/g 替换第 n 行开始到最后一行中每一行所有 home 为 disk2
(n 为数字,若 n 为 .,表示从当前行开始到最后一行)
:%s/home/disk2/(等同于 :g/home/s//disk2/) 替换每一行的第一个 home 为 disk2
:%s/home/disk2/g(等同于 :g/home/s//disk2/g) 替换每一行中所有 home 为 disk2
12. 显示行号:输入:set nu
13. 跳转到某行:ngg,n为要跳转到行号
在mac os下ssh登录的时候出现了如下错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is SHA256:5vuaB3OnzyT/hXdeckzmIRARZMczEj3fJJXYVV8sg10. Please contact your system administrator. Add correct host key in /Users/liuderu/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /Users/liuderu/.ssh/known_hosts:4 RSA host key for 10.10.10.10 has changed and you have requested strict checking. Host key verification failed. |
解决办法:在命令行执行如下命令
1 |
vi ~/.ssh/known_hosts |
在打开的编辑器中删除相关的信息,按Esc,输入wq保存即可
基本使用方法:
命令格式:
watch [options] command
选项:
-b, –beep 播放提示音当命令返回非0退出代码
-c, –color interpret ANSI color sequences
-d, –differences[=<permanent>] 高亮显示每次更新的变化内容
-e, –errexit 当命令返回非0的退出代码时退出watch命令
-g, –chgexit 当命令输出内容变化时退出watch命令
-n, –interval <secs> watch执行时间间隔,单位秒,可以小为数,最小可以为0.1秒
-p, –precise attempt run command in precise intervals
-t, –no-title 关闭顶部Every 2.0s:提示
-x, –exec pass command to exec instead of “sh -c”
-h, –help display this help and exit
-v, –version output version information and exit
For more details see watch(1).
使用场景:
使用举例:
1 |
watch -n 1 -d 'ls -l' |
打开Terminal终端
重启apache服务:sudo /usr/sbin/apachectl restart
停止apache服务:sudo /usr/sbin/apachectl stop
启动apache服务:sudo /usr/sbin/apachectl start
有的时候我们想在命令行窗口中执行某个文件夹中exe文件,虽然我们已经打开了那个文件夹,但是如果在“运行”里输入cmd打开命令行窗口的话,还需要在命令行窗口里cd切换到那个目录,比较繁琐。
那么有没有办法在打开的文件夹中直接打开命令行窗口呢?回答是肯定的,那就是在文件夹内按shift+鼠标右键,这时弹出的右键菜单里就有一个“在此处打开命令窗口”菜单,点击这个菜单,打开的命令行窗口路径已经在这个目录下了。如下图: