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. ...
随机推荐
- 如何在ChemDraw中打出符号π
很多人日常使用ChemDraw是一款非常优秀的化学绘图软件,在其绘制化学结构式或者反应式的过程中,常常需要添加各种符号.比如有的用户会需要输入希腊字符π,但是不知道用什么方法添加.本教程就来给大家介绍 ...
- ASP.NET MVC 随想录
http://www.cnblogs.com/OceanEyes/category/696137.html
- Ubuntu 16.04 LTS nodejs+pm2+nginx+git 基础安装及配置环境(未完,未整理)
-.Ubuntu 安装nodejs 以下内容均在命令行,完成,首先你要去你电脑的home目录:cd ~. [sudo] apt-get update [sudo] apt-get upgrade ap ...
- Deep Learning的基本思想
假设我们有一个系统S,它有n层(S1,…Sn),它的输入是I,输出是O,形象地表 示为: I =>S1=>S2=>…..=>Sn => O,如果输出O等于输入I,即输入I ...
- 四、Android Studio使用——什么样的Project都能导入Studio
1 导入Github源码(别人的Studio工程) 导入之前先看下(导入的工程)gradle-wrapper.properties文件里的gradle-版本是多少. 然后如果这个文件中的版本和你AS工 ...
- 【BZOJ4864】[BeiJing 2017 Wc]神秘物质 Splay
[BZOJ4864][BeiJing 2017 Wc]神秘物质 Description 21ZZ 年,冬. 小诚退休以后, 不知为何重新燃起了对物理学的兴趣. 他从研究所借了些实验仪器,整天研究各种微 ...
- angular中的动画效果
用angular来形成动画效果的代码如下 <!DOCTYPE html> <html lang="en" ng-app="app"> & ...
- Freebsd下用pureftpd配置FTP服务器
pureftpd安装配置简明说明 1.下载 http://sourceforge.net/projects/pureftpd/ 最新版本是pure-ftpd-1.0.16a.tar.bz2 BSD自 ...
- CodeForces 732B Cormen — The Best Friend Of a Man
B. Cormen - The Best Friend Of a Man time limit per test 1 second memory limit per test 256 megabyte ...
- C# 使用KingAOP面向切面编程
1. 在Nuget中安装KingAOP 2. 日志DEMO public class Test : IDynamicMetaObjectProvider { [LogAspec] public voi ...