转载:http://azer.bike/journal/10-linux-commands-every-developer-should-know/

As a software engineer, learning Linux was the best time investment I've made. Since it's a system that user has to understand and maintain, daily experience feels like adding a drop to the puddle. After long time, the puddle becomes a lake, or even an ocean.
Today as a 30 years old engineer, I still benefit from little chunks of knowledge that I happened to learn years ago, when I was an ambitious beginner. In another blog post, I explain more about why Linux is more pragmatic option for software developers.
In this blog post I'll share less popular but very useful Linux commands I personally use and recommend. If you're on a Macbook, that's fine, because most of the commands I'll mention also exist in OSX.
10. file
Returns information for given file. For example, you can print the size information of an image:
file logo.png
Returns:
> PNG image data, 16 x 16, 8-bit/color RGBA, non-interlaced
9. iotop, powertop, nethogs
How would you monitor what's happening in a Linux system ? These three commands are life savers;
iotop: Sorts processes by disk writes, and show how much and how frequently programs are writing to the disk.
powertop: Lists processes by their energy consume. It's a vital command when you're outside, somewhere you can't charge your laptop.
nethogs: Lists processes by their network traffic.
8. tee
It splits the output of a program, so we can both print & save it. For example, add a new entry to 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 running programs in your system.
pidof prints out the process id of a running program. For example, below command will output the process ID of nginx:
pidof nginx
You can kill nginx by taking that number and giving to kill command:
kill -USR2 $(pidof nginx)'
pkill is a shortcut command that kills the process matching pattern:
pkill -f nginx
6. tmux
You gotta install tmux if you haven't yet. Tmux is an excellent window and session manager for your terminal.
5. tree
Lists contents of a directory in tree-like format. It has neat options like showing only directories;
tree -d
4. find
This command is a life-saver when we are looking for specific files around dozens of others. I'll cover a few simple use cases of it 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
Famous process monitor. It has a nice, colorful command-line UI. Some useful keybindings:
\ Filter
/ Search
, Choose sorting criteria
k Send kill signal
u Filter results by user
t Open/close tree mode
- and + Collabse / uncollapse selected process tree
H Turn off displaying threads
2. chroot
Magicians love this command because it opens up a new TTY in given directory. Which means, you can create a folder, set up a new Linux system inside, and switch to that "child system" whenever you want.
Isn't it powerful ?
1. dialog
A very simple and nice way to interact with the user on command-line. For example, this command below shows a nice input box:
dialog --title "Oh hey" --inputbox "Howdy?" 8 55

It exists on both Linux and OSX systems, and supports many other kind of dialogs; message boxes, menus, confirms, progress bars... The installation wizard I coded for Happy Hacking Linux is made with this amazing command!

10 Linux Commands Every Developer Should Know的更多相关文章

  1. 10 Skills Every SharePoint Developer Needs

    10 Skills Every SharePoint Developer Needs(原文) This blog post guides you through the essential skill ...

  2. The 10 Most Important Linux Commands/10个最经常使用的命令行

    1. ls 命令:to show all of the major directiories filed under a given file system. for example: ls /app ...

  3. The common Linux Commands

    Linux的命令总结 1. man:在线请求系统帮助 例:man mkdir NAME:这个命令的完整全名 mk(make directories) SYNOPSIS:这个命令的基本语法 mkdir ...

  4. linux commands

    abrt-cli --since ;查看abrt捕捉的异常 alias ;别名,alias rm='rm -i':使用“ \rm ” 使用原命令 alsamixer ;图形音量调节,q 增加左声道, ...

  5. OpenCV 2.4.10 Linux Qt Conifguration

    Download CMake 2.8.12 Extract the file, and run "./bootstrap", then "make", then ...

  6. Terminal的快捷键 for Terminal for Mac OS 10.10, Linux/GNU(Ubuntu, deepin, elementory os,CentOS)

    对于习惯用windows键盘的,突然转成Mac蓝牙键盘真的有点不习惯,尤其是多了⌘这个键,还有Alt键也成了Option 但是对于Windows下熟悉的快捷键,它们真的失效了,还好Ubuntu也常用, ...

  7. 10. linux输入子系统/input 设备【转】

    转自:https://www.cnblogs.com/crmn/articles/6696819.html 按键事件信息之上报绝对事件信息之上报相对事件信息之上报功能键驱动编写多点触控事件的上报 只产 ...

  8. iOS Xcode 10: Multiple commands produce

    Xcode自动升级到10.0 1.编译的时候报错:Multiple commands produce 解决办法:File -> Workspace Setting -> build sys ...

  9. 10.6 监控io性能 10.7 free命令 10.8 ps命令 10.9 查看网络状态 10.10 linux下抓包

    iostat sysstat 包里面包括 sar 和 iostat [root@centos7 ~]# iostat Linux 3.10.0-693.2.2.el7.x86_64 (centos7. ...

随机推荐

  1. 怎么用ChemDraw加反应条件

    众所周知大部分化学反应都需要在一定的条件下才会发生,比较常见的条件有压力.通电.温度.光照等等.这些特定条件在化学上就叫反应条件.我们在使用ChemDraw这款化学绘图软件的时候,往往需要给我们的化学 ...

  2. uva 610(tarjan的应用)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=23727 思路:首先是Tarjan找桥,对于桥,只能是双向边,而对于 ...

  3. 关于Bootstrap的理解

    Web开发领域存在大量的反复劳动.以创建一个菜单为例,不同的人或是同一个人在不同的时期去构建一个菜单.他创建出来的菜单格式都会存在差异:随着构件的菜单越来越多,我们会发现假设将构建菜单这件事形成一个框 ...

  4. php 快速读取文件夹下文件列表

    在读取某个文件夹下的内容的时候 以前是使用 opendir readdir结合while循环过滤 . ..当前文件夹和父文件夹来操作的. 代码如下: 然后偶然发现了有scandir函数 可以扫描文件夹 ...

  5. Perfmon - Windows 自带系统监测工具

    本文转载自oscar999 一. 简述 可以用于监视CPU使用率.内存使用率.硬盘读写速度.网络速度等. Perfmon提供了图表化的系统性能实时监视器.性能日志和警报管理,系统的性能日志可定义为二进 ...

  6. Linux安装好系统后优化

    author:headsen chen date: 2018-05-14 15:35:49 1.快速更改国内yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc ...

  7. [转]Mac下cocos2dx-3.2+Xcode环境配置和项目创建

    原文:http://blog.csdn.net/u012200908/article/details/38070885 这是有关环境配置的第二篇教程,第一篇讲的是win8下的环境配置.这里我们使用C+ ...

  8. MongoDB插入多条数据

    刚开始学mongodb,只知道几个命令,insert插入也只能一条一条插入,而在实际情况下数据一般都非常多,刚开始想直接上传json文件,网上搜了n多方法发现这种方法不好弄,然后就想着要么一下子把多条 ...

  9. 160322、Maven手动安装Oracle的jar包

    oracle的jar包 收费所以不能通过配置pom.xml获得,可以通过以下方法在pom.xml中引用 在命令行窗口执行(注意更改路径): mvn install:install-file -Dgro ...

  10. windows server 2008 R2域中的DC部署 分类: AD域 Windows服务 2015-06-06 21:09 68人阅读 评论(0) 收藏

    整个晚上脑子都有点呆滞,想起申请注册好的博客还从来都不曾打理,上来添添生机.从哪里讲起呢,去年有那么一段时间整个人就陷在域里拔不出来,于是整理了一些文档,害怕自己糊里糊涂的脑子将这些东西会在一觉醒来全 ...