+
+
+ Command
+
+ |
+ Format and Example
+
+ |
+ Description
+
+ |
+ Supported System Type
+
+ |
+
+
+ mkdir
+ |
+
+ mkdir target folder [mode] [owner] [group] Example: mkdir /storage/myDirectory mkdir /storage/myDirectory 0755 root root
+ |
+
+ Creates a folder. mkdir and the target folder must be separated by only one space. Folders cannot be created recursively.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ chmod
+ |
+
+ chmod permission target Example: chmod 0600 /storage/myFile.txt chmod 0750 /storage/myDir
+ |
+
+ Modifies the permission, which must be in the 0xxx format. chmod, permission, and target must be separated by only one space.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ chown
+ |
+
+ chown uid gid target Example: chown 900 800 /storage/myDir chown 100 100 /storage/myFile.txt
+ |
+
+ Modifies the owner group. chown, uid, gid, and target must be separated by only one space.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ mount
+ |
+
+ mount fileSystemType src dst flags data Example: mount vfat /dev/mmcblk0 /sdc rw,umask=000 mount jffs2 /dev/mtdblock3 /storage nosuid
+ |
+
+ Mounts devices. Every two parameters must be separated by only one space. For details about flags, see the mountFlagMap[] array of the mountFlagMap function in base/startup/init_lite/services/init/init_common_cmds.c. The data field is optional.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ start
+ |
+
+ start serviceName Example: start foundationstart
+ |
+
+ Starts services. serviceName must be contained in the services array.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ export
+ |
+
+ export key value Example: export TEST /data/test
+ |
+
+ Sets environment variables. key and value respectively indicate the environment variable and its value.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ rm
+ |
+
+ rm filename Example: rm /data/testfile
+ |
+
+ Deletes a file. filename indicates the absolute file path.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ rmdir
+ |
+
+ rmdir dirname Example: rmdir /data/testdir
+ |
+
+ Deletes a directory. dirname indicates the absolute path of the directory.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ write
+ |
+
+ write filename value Example: write /data/testfile 0
+ |
+
+ Writes a file. filename and value respectively indicate the absolute file path and the string to write.
+ |
+
+ Standard system
+ |
+
+
+
+ stop
+ |
+
+ stop servicename Example: stop console
+ |
+
+ Stops a service. servicename indicates the name of the service to stop.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ copy
+ |
+
+ copy oldfile newfile Example: copy /data/old /data/new
+ |
+
+ Copies a file. oldfile and newfile respectively indicate the old and new absolute file paths.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ reset
+ |
+
+ reset servicename Example: reset console
+ |
+
+ Resets a service. servicename indicates the name of the service to reset. If the service has not been started, this command will start the service. If the service is running, the command will stop the service and then restart it.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ reboot
+ |
+
+ reboot subsystem Example: reboot updater
+ |
+
+ Restarts the system. subsystem is optional. If it is not specified, the device enters the current system upon restarting. If it is specified, the device enters the corresponding subsystem upon restarting. For example, if you run reboot updater, the device enters the updater subsystem upon restarting.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ sleep
+ |
+
+ sleep time Example: sleep 5
+ |
+
+ Enters the sleep mode. time indicates the sleep time. To avoid impact on services, exercise caution when running this command.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ domainname
+ |
+
+ domainname name Example: domainname localdomain
+ |
+
+ Sets the domain name.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ hostname
+ |
+
+ hostname name Example: hostname localhost
+ |
+
+ Sets the host name.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ wait
+ |
+
+ wait filepath Example: wait /data/testfile or wait /data/testfile 5
+ |
+
+ Waits for commands. The waiting time must not exceed 5 seconds.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ setrlimit
+ |
+
+ setrlimit resource curValue maxValue Example: setrlimit RLIMIT_CPU 10 100
+ |
+
+ Sets resource usage restrictions. For details, see the resource[] array of the DoSetrlimit function in base/startup/init_lite/services/init/init_common_cmds.c.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ exec
+ |
+
+ exec Path of the executable file Parameters passed by the executable file Example: exec /system/bin/udevadm trigger
+ |
+
+ Runs an executable file. The command must not contain more than 10 parameters.
+ |
+
+ Small and standard systems
+ |
+
+
+
+ syncexec
+ |
+
+ syncexec Path of the executable file Parameters passed by the executable file Example: syncexec /system/bin/udevadm trigger
+ |
+
+ Runs an executable file synchronously. The **wait** function will be called to wait for the child process to end. The command must not contain more than 10 parameters.
+ |
+
+ Standard system
+ |
+
+
+
+ mknode
+ |
+
+ mknod name { b | c } Major Minor Example: mknod path b 0644 1 9
+ |
+
+ Creates an index node corresponding to a directory entry and a special file.
+ |
+
+ Standard system
+ |
+
+
+
+ makedev
+ |
+
+ makedev major minor Example: makedev -v update
+ |
+
+ Creates a static device node, which is usually in the /dev directory.
+ |
+
+ Standard system
+ |
+
+
+
+ symlink
+ |
+
+ symlink target link_name Example symlink /proc/self/fd/0 /dev/stdin
+ |
+
+ Creates a symbolic link.
+ |
+
+ Standard system
+ |
+
+
+
+ trigger
+ |
+
+ trigger jobName Example trigger early-fs
+ |
+
+ Triggers a job.
+ |
+
+ Standard system
+ |
+
+
+
+ insmod
+ |
+
+ insmod [-f] [options] Example insmod xxx.ko
+ |
+
+ Loads a kernel module file.
+ |
+
+ Standard system
+ |
+
+
+
+ setparam
+ |
+
+ setparam paramname paramvalue Example: setparam sys.usb.config hdc
+ |
+
+ Sets system parameters.
+ |
+
+ Standard system
+ |
+
+
+
+ load_persist_params
+ |
+
+ load persist params Example: load_persist_params
+ |
+
+ Loads persist parameters. There must be one and only one space after the load_persist_params command.
+ |
+
+ Standard system
+ |
+
+
+
+ load_param
+ |
+
+ load params Example: load_param /data/test.normal.para
+ |
+
+ Loads the parameters from a file to the memory.
+ |
+
+ Standard system
+ |
+
+
+
+ load_access_token_id
+ |
+
+ load_access_token_id
+ |
+
+ Writes the access token to the data/service/el0/access_token/nativetoken.json file. There is one and only one space after load_access_token_id.
+ |
+
+ Standard system
+ |
+
+
+
+ ifup
+ |
+
+ ifup NIC Example: ifup eth0
+ |
+
+ Activates the specified NIC.
+ |
+
+ Standard system
+ |
+
+
+
+ mount_fstab
+ |
+
+ mount_fstab fstab.test Example: mount_fstab /vendor/etc/fstab.test
+ |
+
+ Mounts partitions based on the fstab file.
+ |
+
+ Standard system
+ |
+
+
+
+ umount_fstab
+ |
+
+ umount_fstab fstab.test Example: umount_fstab /vendor/etc/fstab.test
+ |
+
+ Unmounts partitions based on the fstab file.
+ |
+
+ Standard system
+ |
+
+
+
+ restorecon
+ |
+
+ restorecon file or dir Example: restorecon /file
+ |
+
+ Reloads the SELinux context.
+ |
+
+ Standard system
+ |
+
+
+
+ stopAllServices
+ |
+
+ stopAllServices [bool] Example: stopAllServices false stopAllServices
+ |
+
+ Stops all services.
+ |
+
+ Standard system
+ |
+
+
+
+ umount
+ |
+
+ umount path Example: umount /vendor
+ |
+
+ Unmounts a mounted device.
+ |
+
+ Standard system
+ |
+
+
+
+ sync
+ |
+
+ sync
+ |
+
+ Writes data to the disk synchronously. There is only one and only one space after sync.
+ |
+
+ Standard system
+ |
+
+
+
+ timer_start
+ |
+
+ timer_start serviceName Example: timer_start console
+ |
+
+ Starts the service timer.
+ |
+
+ Standard system
+ |
+
+
+
+ timer_stop
+ |
+
+ timer_stop serviceName Example: timer_stop console
+ |
+
+ Stops the service timer.
+ |
+
+ Standard system
+ |
+
+
+
+ init_global_key
+ |
+
+ init_global_key path Example: init_global_key /data
+ |
+
+ Initializes the encryption key of the data partition file.
+ |
+
+ Standard system
+ |
+
+
+
+ init_main_user
+ |
+
+ init_main_user
+ |
+
+ Encrypts the main user directory.
+ |
+
+ Standard system
+ |
+
+
+
+ mkswap
+ |
+
+ mkswap file Example: mkswap /swapfile1
+ |
+
+ Creates a swap partition on a file or device.
+ |
+
+ Standard system
+ |
+
+
+
+ swapon
+ |
+
+ swapon file Example: swapon /swapfile1
+ |
+
+ Activates the swap space.
+ |
+
+ Standard system
+ |
+
+
+
+ mksandbox
+ |
+
+ mksandbox fileName Example: mksandbox system
+ |
+
+ Creates a sandbox.
+ |
+
+ Standard system
+ |
+
+
+
+ loadcfg
+ |
+
+ loadcfg filePath Example: loadcfg /patch/fstab.cfg
+ |
+
+ Loads other .cfg files. The maximum size of the target file (only /patch/fstab.cfg supported currently) is 50 KB. Each line in the /patch/fstab.cfg file is a command. The command types and formats must comply with their respective requirements mentioned in this table. A maximum of 20 commands are allowed.
+ |
+
+ Small system
+ |
+
+
+