Linux系统常用命令

ls(list directory contents)

1|rk356x_box:/ # ls --help
usage: ls [-ACFHLRSZacdfhiklmnpqrstuwx1] [--color[=auto]] [FILE...]

List files.

what to show:
-a  all files including .hidden    -b  escape nongraphic chars
-c  use ctime for timestamps       -d  directory, not contents
-i  inode number                   -p  put a '/' after dir names
-q  unprintable chars as '?'       -s  storage used (1024 byte units)
-u  use access time for timestamps -A  list all files but . and ..
-H  follow command line symlinks   -L  follow symlinks
-R  recursively list in subdirs    -F  append /dir *exe @sym |FIFO
-Z  security context

output formats:
-1  list one file per line         -C  columns (sorted vertically)
-g  like -l but no owner           -h  human readable sizes
-l  long (show full details)       -m  comma separated
-n  like -l but numeric uid/gid    -o  like -l but no group
-w  set column width               -x  columns (horizontal sort)
-ll long with nanoseconds (--full-time)
--color  device=yellow  symlink=turquoise/red  dir=blue  socket=purple
         files: exe=green  suid=red  suidfile=redback  stickydir=greenback
         =auto means detect if output is a tty.

sorting (default is alphabetical):
-f  unsorted    -r  reverse    -t  timestamp    -S  size

example:

rk356x_box:/sdcard/Android/data/com.sundray.meeting # ls -lsh
total 10M
 10M -rw-r----- 1 root   ext_data_rw  20M 2023-03-17 15:14 BJCastChannel_1673923040340.h264
2.0K drwxrws--- 2 system ext_data_rw 4.0K 2023-02-21 11:44 cache
2.0K drwx--S--- 3 system ext_data_rw 4.0K 2023-03-17 14:56 files

df(disk free)

显示指定磁盘文件的使用情况。如果没有指定文件,则显示所有挂载的文件系统的磁盘使用情况。

rk356x_box:/ # df --help
usage: df [-HPkhi] [-t type] [FILE...]

The "disk free" command shows total/used/available disk space for
each filesystem listed on the command line, or all currently mounted
filesystems.

-a      Show all (including /proc and friends)
-P      The SUSv3 "Pedantic" option
-k      Sets units back to 1024 bytes (the default without -P)
-h      Human readable (K=1024)
-H      Human readable (k=1000)
-i      Show inodes instead of blocks
-t type Display only filesystems of this type

Pedantic provides a slightly less useful output format dictated by Posix,
and sets the units to 512 bytes instead of the default 1024 bytes.

使用

rk356x_box:/ # df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 1.8G  832K  1.8G   1% /dev
tmpfs                 1.8G     0  1.8G   0% /mnt
/dev/block/mmcblk2p15  11M  104K   11M   1% /metadata
/dev/block/dm-0       1.2G  1.1G   99M  92% /
/dev/block/dm-2       426M  424M  1.2M 100% /vendor
/dev/block/dm-4       600K  596K  4.0K 100% /odm
/dev/block/dm-3       140M  140M  432K 100% /product
/dev/block/dm-1        51M   51M  160K 100% /system_ext
tmpfs                 1.8G     0  1.8G   0% /apex
tmpfs                 1.8G  264K  1.8G   1% /linkerconfig
/dev/block/mmcblk2p14 1.9G  300K  1.9G   1% /cache
/dev/block/mmcblk2p16 122M   31M   91M  26% /sundrayconfig
/dev/block/mmcblk2p20 6.5G  1.2G  5.2G  20% /data
tmpfs                 1.8G     0  1.8G   0% /data_mirror
/dev/fuse             6.5G  1.2G  5.2G  20% /mnt/user/0/emulated

du(disk usage)

rk356x_box:/ # du --help
usage: du [-d N] [-askxHLlmc] [FILE...]

Show disk usage, space consumed by files and directories.

Size in:
-k      1024 byte blocks (default)
-K      512 byte blocks (posix)
-m      Megabytes
-h      Human readable (e.g., 1K 243M 2G)

What to show:
-a      All files, not just directories
-H      Follow symlinks on cmdline
-L      Follow all symlinks
-s      Only total size of each argument
-x      Don't leave this filesystem
-c      Cumulative total
-d N    Only depth < N
-l      Disable hardlink filter

exaple:

rk356x_box:/sdcard/Android/data # du -sh ./*
8.0K    ./com.rockchips.mediacenter
20M     ./com.sundray.meeting
12K     ./com.sundray.meeting.device.test

kernel

查看内核版本
uname -a
读取内核镜像
cd /data; dd if=/dev/block/mmcblk2p11 of=boot_a.img
写入内核镜像
dd if=boot_a.img of=/dev/block/mmcblk2p11

驱动

lsmod:显示已载入系统的模块

rk356x_box:/ $ lsmod
Module                  Size  Used by
88x2cs               3174400  0
wlan                11153408  0
wlan_cnss_core_pcie   319488  1 wlan

insmod(install module):载入模块

install module

rmmod(remove module):删除模块

rmmod 

dmesg

rk356x_box:/ $ dmesg --help
usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]

Print or control the kernel ring buffer.

-C      Clear ring buffer without printing
-c      Clear ring buffer after printing
-n      Set kernel logging LEVEL (1-9)
-r      Raw output (with <level markers>)
-S      Use syslog(2) rather than /dev/kmsg
-s      Show the last SIZE many bytes
-T      Human readable timestamps
-t      Don't print timestamps
-w      Keep waiting for more output (aka --follow)
// 清空dmesg的日志
dmesg -c 

dmesg -w > /data/dmesg.log &
// 时间
dmesg -w -T > /data/dmesg.log &

查看占用率

dmc占用率
cat /sys/class/devfreq/dmc/load
GPU占用率
cat /sys/class/devfreq/fde60000.gpu/load

ip

255|rk356x_box:/ # ip
``` java
255|rk356x_box:/ # ip
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |
                   netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |
                   vrf | sr }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -h[uman-readable] | -iec |
                    -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |
                    -4 | -6 | -I | -D | -B | -0 |
                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] |
                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |
                    -rc[vbuf] [size] | -n[etns] name | -a[ll] | -c[olor]}

example:
``
ip neigh


## Android
查看SurfaceFliger的帧率
`logcat | grep mFps`
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 221,695评论 6 515
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 94,569评论 3 399
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 168,130评论 0 360
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 59,648评论 1 297
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 68,655评论 6 397
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 52,268评论 1 309
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,835评论 3 421
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,740评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 46,286评论 1 318
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 38,375评论 3 340
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,505评论 1 352
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 36,185评论 5 350
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,873评论 3 333
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,357评论 0 24
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,466评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,921评论 3 376
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,515评论 2 359

推荐阅读更多精彩内容

  • 学习地址 简书-27个常用linux命令[https://www.jianshu.com/p/0056d671ea...
    超级呆阅读 171评论 0 0
  • 1. 文件管理 ls命令 – 显示指定工作目录下的内容及属性信息 ls 命令是Linux下最常用的指令之一。ls命...
    小土豆dy阅读 1,063评论 0 3
  • 写在前面 万丈高楼平地起,学习Linux需要掌握大量的命令,但是不要因为Linux的命令繁多而生退却之心。学习Li...
    真香IT阅读 442评论 0 5
  • 一、安装和登录命令 reboot 1.作用 reboot命令的作用是重新启动计算机,它的使用权限是系统管理者。 2...
    秃鹰人生阅读 2,707评论 0 1
  • 以下是我们在工作中,linux下常用命令,希望能帮助到大家。 1.查看内核信息 uname -a 2.查看当前系统...
    Warrior_Seven阅读 324评论 0 0