我的cheatsheet

简单点,说话的方式简单点...

terminal篇: ubuntu terminal / OS X iterm2

终端快捷键  terminal shortcut

Ctrl+l 清屏

快速编辑命令

Ctrl+w 删掉前一个词

Ctrl+u 剪切光标前的全部内容

Ctrl+k 剪切光标后的全部内容

 

 sudo apt install -f 自动安装依赖

 sudo dpkg -i filename.deb  安装deb安装包

系统监控 system monitoring

 top/iotop/powertop/nethogs 普通监控/按磁盘写入排序/按耗电量排序/按网络流量排序

ping www.baidu.com > test.log &
tail -n 5 -f test.log

某个命令在后台运行,并产生log, 监控log文件

watch

 

ps -aux

 

查看当前所有进程

 pstree 查看所有进程并用树状图表示

 

crontab

定时任务

options:

-e  编辑当前用户的计划任务

-l   查看当前用户的所有计划任务

 

 

15,45 * * * * /bin/echo `date`

每隔30min显示一次时间

搜索查找 search and index

find . -name "[a-z]*[4-9].log"find path options -exec command options {} \;
find path options -ok command options {} \;
find / -size +20M

 搜索文件 -exec 代表对找到的文件执行命令,-ok代表对每个操作进行确认

 

系统和硬件信息 system and hardware information

uname -a

查看系统信息

uname -r 

查看内核版本

 whoami 查看登录用户名称

cat /proc/cpuinfo
cat /proc/meminfo
free -m 

查看cpu/内存/当前内存信息

文本处理 text

grep

grep 

 

ack-grep

grep命令的升级版ack-grep

 

xargs

参数过滤器xargs

 ls *.jpg | xargs -n1 -I cp {} /data/images  复制所有指定类型文件到一个目录

 find . -name "*.pdf" | xargs tar -zcvf xxx.tar.gz  将所有制定类型的文件打包压缩

 cat url_list.txt | xargs wget -c 将列表文件中的所有url依次下载

 

awk

强大的文本处理工具,按行处理

使用方法:

awk '{pattern + action}' {filename}

 ll | awk '{print $9}' 列出所有文件的文件名 

head - n 10 xxx.txt | awk '{print NF}'
head -n 10 creditcard.csv | awk -F "," '{print NF}'

查看文件有几列,经常用来查看数据格式

或者查看文件的列数,但是使用不同的分割符

 

sed

sed命令用来替换非常好用

使用方法:

sed 's/要被取代的字串/新的字串/g'
/sbin/ifconfig eth0 | grep 'inet addr' | sed 's/^.*addr://g' | sed 's/Bcast.*$//g'

查看本机以太网ip地址,并去掉多余的信息

 

文件处理 file

 tar -zxvf xxx.tar.gz  解压文件

 tar -zcvf xxx.tar.gz xxx  压缩文件

 du -ah -max-depth=1  查看当前目录所有文件体积,总体积

 

sudo apt-get install samba smbclient
sudo mkdir /home/share
sudo chmod 777 /home/share
sudo vim /etc/samba/smb.conf

教程在这里 http://www.linuxidc.com/Linux/2014-02/97349.htm

网络相关 networks

 curl ifconfig.me 查看本机外网ip

  hostname 查看主机名称

 界面美化 inferface modify

 column -t 格式化输出命令的结果

tmux
tmux new -s session-name 新建一个session
tmux ls / Ctrl+s 显示所有session
tmux a -t session-name 接入session
tmux detach / Ctrl+b 断开session
Ctrl+b $ 重命名session
Ctrl+b , 重命名window
Ctrl+b % 水平分割
Ctrl+b " 竖直分割
Ctrl+b x 关闭window

tmux 分屏工具

 

自定义命令 bash aliases

 alias rsvmr="rsync -vcah src dst"   同步文件

 alias waitit="inotifywait -mrq --format '%Xe %w%f' -e modify,create,delete,attrib"  监控目录

cdl() { cd "$@" && pwd ; ls -al; } alias ..="cdl .." alias ...="cd ../.."  alias cd..='cdl ..'

将很常用的目录切换改短一点

环境部署 environment deployment

笔记本 dell xps15 m9560 500gb+120gb ssd 12gb mem

win10 + vmware(ubuntu) 

cmder win10上cmder+babun还是比较cool的

babun 想在windows上找到linux的感觉吗?这个是首选

    (由于win的terminal编码是gbk,在babun下用win的命令的时候需要加上)

| iconv -f GBK -t UTF8 

一键部署 one button deployment

 ncdu 

./condigure

make

make install

sudo apt install vim tmux htop 
touch ~/.bash_aliases
sed -i '1i\alias waitit="inotifywait -mrq --format '%Xe %w%f' -e modify,create,delete,attrib"'  ~/.bash_aliases

OS X:
curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install htop
brew install jq
brew install neovim
brew install python
brew install pip
brew install python3
brew install pip3
pip3 install you-get
 
 

 

 

 

 

vim篇

菜鸟教程总结的cheatsheet,非常全了

vimplus 一个不错的发行版

spf13 git上一个比较多star的vim distribution 懒人伸手党直接上:

curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh

 

 

cmd/powershell篇

详细的教程可以参考:

http://www.pstips.net/powershell-online-tutorials/

最常用的还是 ipconfig

 

转载于:https://www.cnblogs.com/theodoric008/p/7580730.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
A list of Windows 10 keyboard shortcuts to make your life easier. Though the mouse is an essential tool, sometimes keyboard shortcuts make life much easier, allowing you to immediately access what you need by simply pressing a combination of keys. Here are some of the most useful ones in Windows 10: Key Combinations Action Standard Windows Shortcuts Windows Key Left Arrow / Right Arrow Snap current window to the left / right side of the screen Windows Key Up Arrow / Down Arrow Snap current window to the top / bottom of the screen Windows Key A Open Action Center Windows Key C Launch Cortana in listening mode to give it voice commands Windows Key I Open Settings Windows Key S Launch Cortana Windows Key Tab Open Task View Windows Key Ctrl D Create a new virtual desktop Windows Key Ctrl F4 Close current desktop Windows Key Ctrl left / right arrow Switch between virtual desktops Windows Key Open / close the Start menu Windows Key X Open / close the Shortcut Menu Windows Key E Launch File Explorer Windows Key L Lock desktop Alt PrtScn Take a screenshot of current window and copy it to the clipboard Windows Key PrtScn Take a screenshot of the entire display and save to Computer > Pictures > Screenshots Alt Tab Cycle between open windows Windows Key D Show desktop Windows Key G Activates the Xbox game bar so you can record games or take screenshots Windows Key H Activate share feature in Windows 10 apps Windows Key K Activate Connect so you can stream to a wireless display and audio device Windows Key P Project a screen Windows Key R Open the Run dialog box Windows Key Shift left / right arrow Move open Windows from one monitor to another Windows Key 1 / 2 / 3 … Open programs that are pinned on the taskbar, with 1 being the first app from the left Alt F4 Close the current app or window Ctrl Z Undo the last action Ctrl A Select all Ctrl C Copy selection Ctrl X Cut selection Ctrl V Paste copied items Alt Esc Cycle through open programs/windows in the order they were opened Alt Enter Display properties for selected item Alt Spacebar Open the shorcut menu for active window Ctrl Shift Esc Open task manager Ctrl R Refresh active window Ctrl Y Redo an action Ctrl Shift Switch between keyboard layouts if you have more than one Windows Key Home Minimize all windows except active window Browser Shortcuts Ctrl T Open new tab Ctrl D Bookmark page Ctrl L Highlight current URL Ctrl Tab Cycle between open tabs Ctrl Enter add ".com" to the end of a web address Command Prompt Shortcuts Ctrl V Pastes text at the cursor Shift Insert Pastes text at the cursor Ctrl C / Insert Copies selected text to the clipboard Ctrl A Select all text in the current line if there is text. If the line is empty, select all text in Command Prompt Shift Left / Right / Up / Down / Arrow Moves the cursor left/right a character or up/down a line while selecting text at the same time Ctrl Shift left / right arrow Move the cursor one word to the left/right, selecting the word as it goes Shift Home / End Move the cursor to the start or end of the current line, selecting text as it goes Shift Page Up / Page Down Move the cursor up / down a screen while selecting text Ctrl Shift Home / End Move the cursor to the start / end of the screen buffer, selecting text along the way

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值