10 Linux commands that each developer should know about __linux

Source: Internet
Author: User
Tags pkill

Original: Linux Commands Every Developer Should
Know
Author: azer Koçulu Translator: Roy

A few of the less common Linux commands that make your life simpler. The following is the translation:

As a software engineer, learning Linux is the best time investment I have ever made. Because it is a system that users must understand and maintain, daily experience is like adding a drop of water to a puddle. After a long time, the puddles became lakes and even oceans.

Today, as a 30-year-old engineer, I still benefited from the knowledge I had learned years ago, when I was an ambitious beginner. In another blog post, I explained in more detail why Linux is better for software developers.

In this article, I'll share some of the less popular but very useful Linux commands I personally use and recommend. If you have an Apple notebook, that's fine, because most of the commands I've mentioned are in OS X. file

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

File Logo.png

Output results:

> PNG image data, 8-bit/color RGBA, non-interlaced
9. Iotop, PowerTOP, Nethogs

How you monitor what's going on in the Linux system. These three commands can be of great help;

* Iotop: Sorts the process by disk write count, and displays the number and frequency of program write disks.

* PowerTOP: Displays the process as a list of energy consumption. This is an important order, especially when you are not able to recharge your computer outside.

* Nethogs: Displays the process as a list of network traffic.
8. Tee

Tee redirects the output of the program so that we can display and save the results at the same time, such as adding a new entry to the Hosts file:

echo "127.0.0.1 Foobar" | sudo tee-a/etc/hosts
7. Pidof, kill and Pkill

These three important commands help you control which programs are running in your system.

Pidof prints out the process ID of the program that is running. For example, the following command outputs the Nginx process ID:

Pidof Nginx

You can terminate it by entering the Nginx process ID into the KILL command.

KILL-USR2 $ (pidof nginx) '

Pkill is a shortcut command that can terminate a matching process:

Pkill-f Nginx
6. Tmux

If you have not installed Tmux, be sure to install it. Tmux is your terminal's excellent window and session manager. 5. Tree

Lists the contents of a directory in a tree format. It has simple options, such as displaying only directories;

Tree-d
4. find

This command can help when we are looking for a specific file in dozens of files. I'll introduce a few simple use cases here.

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

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

Example 2: List all CSS or HTML files:

Find. -type f \ (-name "*.css"-or-name "*.html" \)
3. Htop

The famous Process Monitor. It has a beautiful and colorful command line interface. Some useful shortcut keys:

* Filter
*/Search
*, select sorting criteria
* k send kill instruction
* U filter results by user *
T turn on/off tree mode
*-and + expand/close Process Tree
* H close Display Process
2. Chroot

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

is not very strong. 1. Dialog

A very simple and nice way to interact with the user on the command line. For example, the following command shows a nice input box:

Dialog--title "Oh Hey"--inputbox "Howdy?" 8 55


It exists on Linux and OS X systems and supports many other types of dialog boxes: message boxes, menus, confirmation boxes, progress bars ... The installation Wizard I wrote for Happy Hacking Linux was made with this magical command.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.