[Experience] [embedded linux] every developer should know Linux commands 10

I see some good information on the web page, transferred to take a look at ~ ~ ~
10. File


returns information of a specified file. For example, you can use it to output a picture file size information.

file logo.png

output:

> the Data Image PNG, 16 the X-16, 8-bit / Color RGBA, non-interlaced

9. iotop, powertop, nethogs

you how to monitor what's going on Linux system? These three commands can be a big help;

* iotop: the process by writing the number of disk sorting, and display program to write the number and frequency of the disk.

* Powertop: The process according to the energy consumption of the display list. This is an important command, especially when you can not charge for your computer out of time.

* Nethogs: The process by displaying a list of network traffic.

TEE 8.

TEE will redirect the output of the program, Mingyuan Chi Rui embedded penguins Yaoqi hum it for a long time to zero will allow us to display and save the results at the same time, for example, to add a new entry to the hosts file:

echo "127.0.0.1 foobar" | sudo TEE -a / etc / hosts

7. pidof, the kill and pkill

three important commands help you control program running on the system.

pidof print out the process ID of a running program. For example, the following command will output nginx process ID:

pidof nginx

You can put nginx input to the process ID of the kill command to terminate it.

$ -USR2 the kill (pidof nginx) '

pkill is a shortcut command, you can terminate the matching process:

pkill -f nginx

6. tmux

If you have not yet installed tmux, be sure to install it. tmux is an excellent window and session manager your terminal.

5. tree

list the contents of directories in a tree format. It has a simple option, for example, only display the directory;

Tree -d

4. the Find

When we find a specific file in dozens of files, this command can help. I will be here to introduce a few simple use cases.

Example 1: List all the CSS files (including subdirectories):

the Find The -type f -name "* .css."

Example 2: lists all CSS or HTML file:

. The Find The -type f \ (-name " .css * "-OR -name" * .html "\)

3. htop

famous process monitor. It has a pretty colorful command line interface. Some useful shortcut keys:

* \ filter
* / search
* Sort select
* k transmits kill command
* u filter results by user
* t open / close tree (Tree) mode
* - + expand and / Process Tree
* H turn off the display process

2. chroot

Magicians like this command because it opens up a new TTY in a given directory. This means that you can create a folder in which to set a new Linux system, and at any time switch to the "subsystem."

It is not very strong?

1. dialog

on the command line user interaction with one very simple and good way. For example, the following command shows a good input box:

Dialog - Ti TLE "Oh hey" --inputbox "? Howdy" 8 55



it exists on Linux and OSX systems, and support for many other types of dialog: news boxes, menus, check box, progress bar
...




Guess you like

Origin blog.51cto.com/14400120/2415067