Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common commands in OpenWrt

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report