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. ...
随机推荐
- 【python】NLTK好文
From:http://m.blog.csdn.net/blog/huyoo/12188573 nltk是一个python工具包, 用来处理和自然语言处理相关的东西. 包括分词(tokenize), ...
- Word中怎么用MathType编辑公式
现如今,用电脑办公学习已经是一个不可阻挡的潮流.而与之相应的就是需要在这些办公软件进行相应的使用,最典型的一种就是要在Word编辑公式.其实在Word中编辑公式是一个很常见的事情,虽然它很常见,但是却 ...
- es6 javascript的class的静态方法、属性和实例属性
http://blog.csdn.net/qq_30100043/article/details/53542966
- SDL 威胁建模工具入门 threat modeling tool
http://msdn.microsoft.com/zh-cn/magazine/dd347831.aspx threat modeling tool 威胁建模工具 minifuzz 文件模糊工具 c ...
- hibernate配置文件分析
<!--标准的XML文件的起始行,version='1.0'表明XML的版本,encoding='gb2312'表明XML文件的编码方式--> <?xml version='1.0' ...
- Python全栈day21(函数的解耦)
针对上一篇对文件的操作程序,执行一次操作的函数查询,添加,修改,删除都需要在函数里面定义文件处理的过程,整体函数看起来比较乱,代码重复过多 下面新定义一个函数专门用于处理文件操作,然后在不同的函数里面 ...
- datasnap 关于lifecycle的问题
首先DSServerClass的lifecycle属性有Invocation.Server.Session三种模式: 简单叙述一下三点区别: server:datasnap只初始化一个TDSServe ...
- 原!linux 监控 jar定时任务 挂了重启 脚本
#!/bin/bash time=$(date "+%Y-%m-%d %H:%M:%S") echo "monitor start at: ${time}" P ...
- react native 或 flutter 开发app
react-native react native和原生Android/ios: https://www.oschina.net/news/97466/should-we-use-react-nati ...
- 【非root用户】安装【python,pip,package】
安装python: 下载源码 解压 进入 ./configure --prefix=/path/python3.6 注意一定要设置prefix,否则默认安装到/usr/local make make ...