[Share Experiences] 相见恨晚的别名,欢迎补充
Tofloor
poster avatar
风吹过的绿洲
deepin
2022-07-30 06:54
Author

在用户目录下增加一个文件.bash_aliases

alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias size-a="ll -a | grep \"^d\" | awk '{print \$NF }' | xargs  du -hl --max-depth=0 | sort -hr"
alias size-ag="size-a | grep G"
alias size='f(){ du -sh $1* | sort -hr; }; f'
alias size-g='size | grep G'
alias sek='f(){ find / -name $1; }; f'
alias sekc='f(){ find ./ -name $1; }; f'
alias www='f(){ python -m SimpleHTTPServer $1; }; f'
alias untar='tar xvf '
alias ipe='curl ipinfo.io/ip'

记得source ~/.bash_aliases

找出大文件夹,非常好用


jay@jay-PC:$ size-ag
148G    ..
148G    .
29G     Documents
17G     Idea
16G     .pyenv
13G     Android
12G     .deepinwine
11G     Videos
9.3G    .m2
9.0G    .cache
7.0G    .android
5.7G    .local
5.3G    .config
4.7G    Node
2.6G    .gradle
1.2G    go
1.2G    Eclipse
1.1G    .rustup
1.1G    PycharmProjects

普通版

jay@jay-PC:~$ size-g
29G     Documents
17G     Idea
13G     Android
11G     Videos
4.6G    Node
1.2G    go
1.2G    Eclipse
1.1G    PycharmProjects
Reply Favorite View the author
All Replies
andktan
deepin
2022-07-30 07:49
#1

后面理解,前面不太懂doubt

Reply View the author
新手小白
deepin
2022-07-30 17:24
#2
It has been deleted!
吉吉如律令
deepin
2022-07-30 18:53
#3
andktan

后面理解,前面不太懂doubt

应该是在bash的配置文件里自定义一些常用命令的缩写,这样可以减少输入命令的时间

Reply View the author
ljq790615
deepin
2022-07-31 04:06
#4

alias srm='sudo rm -rf'

alias cls='clear'

alias clt='rm -rf ~/.local/share/Trash/*'

Reply View the author
ThinkYoung
deepin
2022-08-19 16:57
#5

函数式方法很新颖,IP网络这类外挂脚本也可以有

alias www3='f(){ python3 -m http.server 8000 --directory $1; }; f'
alias www='f(){ python2 -m SimpleHTTPServer $1; }; f'

可以合并一下:

[deepin使用alias简化命令] https://bbs.deepin.org/post/239361

建议ll还是给玲珑预留吧 ll-cli 真的太长了 没必要 而且还真跟ll容易混

Reply View the author
风吹过的绿洲
deepin
2024-04-10 00:05
#6
alias ll='ls -l'
alias la='ls -A'
alias lc='ls -CF'
alias ld='find . -maxdepth 1 -type d -printf "%f\n"'
alias size-a="find . -maxdepth 1 -type d -exec du -sh {} \\; | sort -hr"
#alias size-a="ll -a | grep \"^d\" | awk '{print \$NF }' | xargs  du -hl --max-depth=0 | sort -hr"
alias size-ag="size-a | grep G"
alias size='f(){ du -sh $1* | sort -hr; }; f'
alias size-g='size | grep G'
alias sek='f(){ find / -name $1; }; f'
alias sekc='f(){ find ./ -name $1; }; f'
alias www='f(){ python -m SimpleHTTPServer $1; }; f'
alias untar='tar xvf '
alias ipe='curl ipinfo.io/ip'
Reply View the author