current tick 当前系统的节拍;
- finsh>> list_device()
- device type
- ------- ----------------
- uart3 Character Device
- uart2 Character Device
- uart1 Character Device
显示系统中设备状态:
- 字段 描述
- device 设备的名称;
- type 设备的类型;
type输出下列数据类型:
- char * const device_type_str[]{
- "Character Device",
- "Block Device",
- "Network Interface",
- "MTD Device",
- "CAN Device",
- "RTC",
- "Sound Device",
- "Graphic Device",
- "I2C Bus",
- "USB Slave Device",
- "USB Host Bus",
- "SPI Bus",
- "SPI Device",
- "SDIO Bus",
- "PM Pseudo Device",
- "Unknown",
- };
RT-Thread的各个组件会向finsh输出一些命令。 如当打开DFS组件时,还会增加如下命令,各个命令详细介绍参见文件系统一章。
- mkfs -- make a file system
- df -- get disk free
- ls -- list directory contents
- rm -- remove files or directories
- cat -- print file
- copy -- copy source file to destination file
- mkdir -- create a directory
finsh(msh) 内置命令
msh模式下,内置命令风格与bash类似,按下tab键后可以列出当前支持的所有命令。
- RT-Thread shell commands:
- list_timer - list timer in system
- list_device - list device in system
- version - show RT-Thread version information
- list_thread - list thread
- list_sem - list semaphore in system
- list_event - list event in system
- list_mutex - list mutex in system
- list_mailbox - list mail box in system
- list_msgqueue - list message queue in system
- ls - List information about the FILEs.
- cp - Copy SOURCE to DEST.
- mv - Rename SOURCE to DEST.
- cat - Concatenate FILE(s)
- rm - Remove (unlink) the FILE(s).
- cd - Change the shell working directory.
- pwd - Print the name of the current working directory.
- mkdir - Create the DIRECTORY.
- ps - List threads in the system.
- time - Execute command with time.
- free - Show the memory usage in the system.
- exit - return to RT-Thread shell mode.
- help - RT-Thread shell help.
执行方式与传统shell相同,因此不详细赘述,以cat为例简单介绍。如果打开DFS,并正确挂载了文件系统,则可以执行ls查看列出的当前目录。
- finsh>ls
- Directory /:
- .. <DIR>
- a.txt 1119
当前目录下存在名为a.txt的文件,则可执行如下命令打印a.txt的内容。
- finsh>> cat a.txt