The objective of this post is to list some useful Linux commands that can be sent on the LinkIt Smart operating system.
The objective of this post is to list some useful commands that can be sent to the LinkIt Smart operating system, the OpenWrt. It includes some practical example use cases to test them in the device.
Most of these commands will be familiar to all who have worked with other distributions of the Linux Operating System.
List of commands
The ls (list) command lists the directory contents. So, it’s a very basic and usefully command that anyone working with Linux systems should know.
We will be seeing some examples using this command bellow. You can check the many command line options this command can take here.
The pwd (print working directory) command prints the current directory where the user is located.
Figure 1 exemplifies the use of this command. First, I sent the command from the root directory (the default one when connecting via Putty) and then I moved to another directory using the cd command and issued the pwd, which printed the new directory.
Figure 1 – pwd command.
The cd (change directory) command is used to change the current directory .
Typing just the cd command will return us to the home directory . In the case of the LinkIt Smart, we will return to the same directory we go when connecting via SSH using Putty.
If we type cd .. then we will move one directory up from where we are  or, in other words, we will change to the parent directory that contains the directory where we currently are.
From the current directory, if we type cd directoryName we will move to that directory, as long as it is contained in the current directory. This is called a relative path . We can check child directories of the current directory using the ls command.
We can also navigate using the cd command and absolute paths. To to so, we just type cd /rootDirectory/someDirectory/anotherDirectory and the directory will be changed accordingly. An absolute path always starts with “/” .
To test these commands, just connect to the LinkIt Smart using Putty. From there, send the two following commands:
cd .. ls
If you haven’t yet changed the folders of your LinkIt Smart, you should see something similar to figure 2.
Figure 2 – “/” directory of the LinkIt Smart.
In this case, let’s navigate to the IoT directory to check its contents. Just type the following:
cd IoT ls
You should now see an examples folder inside this directory. Move to that folder and check its contents:
cd examples ls
You should see 3 different files with sample code, as shown in figure 3.
Figure 3 – Examples folder contents.
Now, to go back to the home directory, just type the cd command:
After this command, you should be located in the same directory you were when established the connection to the LinkIt Smart. From there, you can simply go back to the examples directory using its absolute path:
cd /IoT/examples ls
You can check some more cd command use cases here.
The clear command is a very useful command that cleans the contents of the screen .
To test the command, just type the following, with some content on you command line:
You can check in figure 4 the command line before sending the clear command and after.
Figure 4 – clear command.
The uname command prints information about the current system . The type of information printed will depend on the options passed to the command. A list of usefull options is shown bellow:
-n: Network node name
-s: Kernel name
-m: Machine hardware name
-p: Processor type
-o: Operating system
Figure 5 shows the result of running the uname command on the LinkIt Smart with the options listed. You can check more options for the command here. You can also use the -a option to print all the available information.
Figure 5 – uname command with multiple options.
- cd command explanation
- OpenWRT commands
- clear command explanation
- uname command explanation
- ls command manual page