Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the common commands in OpenWrt

Shulou Source: shulou.com Published: 2022-06-02 00:10:13 09月11日 Update

This article is to share with you about what OpenWrt commands are commonly used, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.

1) ubuntu switches root users:

Sudo su enters root users

"Ctrl+Alt+F1": enter the root command line interface

"Ctrl+Alt+F7": returns the graphical user interface

2) View the command of serial port under ubuntu:

You can also use the command: "ls-l / dev/ttyUSB*" to view the relevant information, as shown below

So far, we have successfully connected the serial port to the Ubuntu system, and we can see that our development board is connected to the USB to serial port device / dev/ttyUSB0. If it is an ordinary serial port device, it will be / dev/ttyS*..

3) compile and generate a single installation package command:

Make package/hello/install

4) pthread compilation method

Because I am a novice to Linux, I just started to contact thread programming. I typed and compiled according to an example in the GUN/Linux programming guide, and the result is as follows:

Undefined reference to 'pthread_create'

Undefined reference to 'pthread_join'

The cause of the problem:

The pthread library is not the default library for the Linux system, and you need to use the static library libpthread.a when connecting, so you need to link it when you create a thread using pthread_create () and when you call the pthread_atfork () function to set up a fork handler.

Problem solving:

Add the-lpthread parameter to the compilation

Gcc thread.c-o thread-lpthread

5) change the owner of the file or folder

Chown pc:pc globalfifo.c changes the file globalfifo.c to the owner of pc

6) compress and extract to the specified directory

Extract to the specified directory with the tar command

Tar zxvf / bbs.tar.zip-C / zzz/bbs (insufficient permissions: sudo)

Extract the bbs.tar.zip in the root directory to / zzz/bbs, as long as the directory / zzz/bbs exists.

This is a little different from the cp command, where the cp command automatically creates this directory if it doesn't exist!

Use the tar command to package

Example: package the zzz file in the current directory to the root directory and name it zzz.tar.gz

# tar zcvf / zzz.tar.gz. / zzz

The above are the common commands of OpenWrt, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Commands directories serial ports files compilers users commonly used more root directories interfaces knowledge articles systems threads devices problems programming different common not enough Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn NVidia MariaDB Shulou Information Docker