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. ...
随机推荐
- hdu 2717:Catch That Cow(bfs广搜,经典题,一维数组搜索)
Catch That Cow Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- ItcastOA_设计BaseDao_设计DAO接口和实现类_写DAO实现类中的方法内容
3. 基础功能 3.1. 设计BaseDao接口与BaseDaoImpl类 每个实体都应有一个对应的Dao,他封装了对这个实体的数据库操作.例 实体Dao接口实现类 ================= ...
- 剑指 offer set 24 扑克牌的顺子
题目 从扑克牌中任意抽取出 5 张牌, 判断是不是顺子, 并且大小王可以看成任意的数字 思路 1. 把大小王当做 0 插入到数组中, 然后对数组排序 2. 统计相邻两个数之间的空隙数, 若空隙数大于 ...
- java的Enumeration转list
java的Enumeration转list Enumeration<String> attrs = getAttrNames();// while(attrs.hasMoreElement ...
- git sourcetree忽略某些文件提交
打开sourcetree 点击edit按钮,在文件中加入如下内容.*.iws*.iml*.iprtarget/.settings.project.classpath.externalToolBuild ...
- Excel单元格格式设置
工作中遇到一些小问题: 例如办公自动化里的如何设置单元格格式 此格式分为两种:一种是样式上的格式 比如边框 行距字体等 第二种为数据格式: 比如每次我输入1000的话自动变红或者加粗字体 office ...
- react-native 学习(一)
本包子很久没更新过博客啊... 学习react-native 可以从官网上去学习.但是 目前我看到的中文网和英文网他们初始构建的项目的命令行是不同的. 在中文网上,构建项目的 react-native ...
- C#批量入库
public static void BulkCopyToDB(DataTable dt, string conn, string tableName, out string msg) { msg = ...
- H5 localStorage入门
定义 只读的 localStorage 允许你访问一个 Document 的远端(origin)对象 Storage:数据存储为跨浏览器会话.localStorage 类似于 sessionStora ...
- java获取时间段内的所有日期
public static void main(String[] args) { SimpleDateFormat dateFormat = new SimpleDateForm ...