10 Linux Commands Every Developer Should Know
转载: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的更多相关文章
- 10 Skills Every SharePoint Developer Needs
10 Skills Every SharePoint Developer Needs(原文) This blog post guides you through the essential skill ...
- 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 ...
- The common Linux Commands
Linux的命令总结 1. man:在线请求系统帮助 例:man mkdir NAME:这个命令的完整全名 mk(make directories) SYNOPSIS:这个命令的基本语法 mkdir ...
- linux commands
abrt-cli --since ;查看abrt捕捉的异常 alias ;别名,alias rm='rm -i':使用“ \rm ” 使用原命令 alsamixer ;图形音量调节,q 增加左声道, ...
- OpenCV 2.4.10 Linux Qt Conifguration
Download CMake 2.8.12 Extract the file, and run "./bootstrap", then "make", then ...
- Terminal的快捷键 for Terminal for Mac OS 10.10, Linux/GNU(Ubuntu, deepin, elementory os,CentOS)
对于习惯用windows键盘的,突然转成Mac蓝牙键盘真的有点不习惯,尤其是多了⌘这个键,还有Alt键也成了Option 但是对于Windows下熟悉的快捷键,它们真的失效了,还好Ubuntu也常用, ...
- 10. linux输入子系统/input 设备【转】
转自:https://www.cnblogs.com/crmn/articles/6696819.html 按键事件信息之上报绝对事件信息之上报相对事件信息之上报功能键驱动编写多点触控事件的上报 只产 ...
- iOS Xcode 10: Multiple commands produce
Xcode自动升级到10.0 1.编译的时候报错:Multiple commands produce 解决办法:File -> Workspace Setting -> build sys ...
- 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. ...
随机推荐
- 转载 HTTPS 之fiddler抓包、jmeter请求
转载自 http://suixiang0923.github.io/2016/01/12/%E6%B5%85%E8%B0%88HTTPS%E4%BB%A5%E5%8F%8AFiddler%E6%8A% ...
- 说说JSON和JSONP 也许你会豁然开朗
说到AJAX就会不可避免的面临两个问题,第一个是AJAX以何种格式来交换数据?第二个是跨域的需求如何解决 前言 由于Sencha Touch 2这种开发模式的特性,基本决定了它原生的数据交互行为几乎只 ...
- XML基础知识-->Spring配置
XML的特殊字符 XML中共有5个特殊的字符,分别是:&<>“’.如果配置文件中的注入值包括这些特殊字符,就需要进行特别处理.有两种解决方法:其一,采用本例中的<![CDAT ...
- java对象和json数据转换实现方式3-使用jackson实现
測试代码: package com.yanek.util.json; import java.io.IOException; import java.io.StringWriter; import j ...
- POJ2456 Aggressive cows(二分+贪心)
如果C(d)为满足全部牛之间的距离都不小于d. 先对牛舍的位置排序,然后二分枚举d,寻找满足条件的d. #include<iostream> #include<cstdio> ...
- Python tushare 初步了解
一.安装 1.Python 2.numpy 3.pandas 4.lxml 5.............. n.tushare 二.初步测试
- 折腾deeplin系统
1.双系统失败记录 多系统启动问题 先安装完deepin,发现再安装windows怎么都起不起来,哪怕他们已经安装在不同的盘 (体现再Windows7通过ghost位于另外一个盘,但就是没有启动项) ...
- Netty 服务端创建
参考:http://blog.csdn.net/suifeng3051/article/details/28861883?utm_source=tuicool&utm_medium=refer ...
- CentOS7.2编译配置LNMP环境(MySQL5.7.20,PHP7.0.24)
一, 查看系统版本及内核版本 二, 编译安装nginx 1, 新建nginx用户 useradd -s /sbin/nologin -M nginx 2, ...
- hibernate缓存,四种状态
FlushMode.AUTO:Hibernate判断对象属性有没有改变,是默认的清理模式 FlushMode.COMMIT:在事务结束之前清理Session的缓存,其他任何时候都不清理缓存 Flush ...