Profile

Cover photo
Jason C
6,663 followers|688,664 views
AboutPosts

Stream

Jason C

Shared publicly  - 
3
Vincent Chu's profile photo
 
happy weekend
Add a comment...

Jason C

Shared publicly  - 
 
通过SSH和tar打包远程服务器文件到本地:

$ssh user@host"tar -zcf - /path/to/folder" > myfolders.tar.gz

#shelltricks
1
1
Add a comment...

Jason C

Shared publicly  - 
 
找出吃掉CPU资源的进程:

$ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

#shelltricks
1
2
Yu Sun's profile photoBaoshan Pang's profile photoJason C's profile photoTian Bai's profile photo
5 comments
Yu Sun
 
僵尸放着不用管它,过段时间资源就return
 ·  Translate
Add a comment...

Jason C

Shared publicly  - 
 
直捣黄龙从第几(NUM)层目录开始解包:
$tar xvf filename.tar --strip-path=NUM

例如从第二层目录开始解包:
$tar xvf filename.tar --strip-path=1

#shelltricks
1
Add a comment...

Jason C

Shared publicly  - 
 
大概查看一下当前目录下所有文件的内容:

$for f in $(ls); do printf %b \\033c; cat $f; sleep .3; done

#shelltricks
1
姜维's profile photo
2 comments
姜维
 
cat * # 少量文件
Add a comment...
Have them in circles
6,663 people

Jason C

Shared publicly  - 
 
列出每个子目录的大小(Kb,Mb,Gb自动换算):

$du --max-depth=1 | sort -nr | awk ' BEGIN { split("KB,MB,GB,TB", Units, ","); } { u = 1; while ($1 >= 1024) { $1 = $1 / 1024; u += 1 } $1 = sprintf("%.1f %s", $1, Units[u]); print $0; } '

#shelltricks
2
1
Add a comment...

Jason C

Shared publicly  - 
 
看看登录系统时间最长的是哪个家伙:

$ac -p | sort -nk 2 | sed '$!{h;d};x'

#shelltricks
 ·  Translate
1
Yuliang Jin's profile photo
 
是total~
Add a comment...

Jason C

Shared publicly  - 
 
Linux下grep的优秀替代工具glark:

支持高亮匹配,兼容Perl正则表达式和更复杂的混合表达式匹配,完全兼容GNU grep。
 ·  Translate
1
Add a comment...

Jason C

Shared publicly  - 
 
霸气侧漏的喵星人来了
Anderson KA originally shared:
 
cat seeks adventure
1
1
Jason C's profile photozui xin's profile photoMan Lai's profile photo
4 comments
Man Lai
 
好有神氣
 ·  Translate
Add a comment...

Jason C

Shared publicly  - 
 
将子目录文件移动到当前目录:
$find ./ -type f -exec mv {} . \;

#shelltricks
 ·  Translate
1
Add a comment...
People
Have them in circles
6,663 people
Story
Tagline
应无所住而生其心
Introduction
一切有为法,
如梦幻泡影,
如露亦如电,
应作如是观。
Bragging rights
千江有水千江月,万里无云万里天。