-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux存档 #8
Comments
# 字符串中数字排序
sort -V
# 倒序
sort -Vr |
# 显示全部已定义的别名
alias
alias -p
# 显示已定义的别名(假设当前环境存在以下别名)
alias ls
alias ls grep
# 定义或修改别名的值
alias ls='ls --color=auto'
alias ls='ls --color=never' grep='grep --color=never' 直接在shell里设定的命令别名,在终端关闭或者系统重新启动后都会失效,如何才能永久有效呢? 使用编辑器打开~/.bashrc,在文件中加入别名设置,如:alias rm='rm -i',保存后执行source ~/.bashrc,这样就可以永久保存命令的别名了。 因为修改的是当前用户目录下的~/.bashrc文件,所以这样的方式只对当前用户有用。如果要对所有用户都有效,修改/etc/bashrc文件就可以了。 |
如何加入开机自启动脚本
#!/bin/bash
# chkconfig: 2345 20 80
# description: Description comes here....
# Source function library.
. /etc/init.d/functions
start() {
# code to start app comes here
# example: daemon program_name &
}
stop() {
# code to stop app comes here
# example: killproc program_name
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
# code to check status of app comes here
# example: status program_name
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
esac
exit 0
|
docker开启自动启动 systemctl enable docker |
Linux查看开机启动项 |
tar 使用 压缩
tar -zcvf test.tar.gz test
解压缩
tar -zxvf file.tar.gz |
An Introduction To Data Science On The Linux Command Line
|
查看系统启动时间who -b |
Ctrl+a跳到本行的行首, ctrl+a:光标移到行首。 |
step 1 firewall-cmd --zone=public --permanent --add-port=8080/tcp firewall-cmd --reload |
重命名技巧 cat > a.txt |
按行安装直接忽略错误 |
文件夹内查找 |
给所有文件夹添加文件 find . -type d -exec touch {}/__init__.py \; |
批量更改 grep -rl '#049fd9' django/ | xargs sed -i 's/#049fd9/rgba\(13, 39, 77, 1\)/g' |
wsl的一些相关命令 wsl --set-version Ubuntu 2 https://docs.microsoft.com/en-us/windows/wsl/compare-versions |
fucking wsl2 |
用户 https://www.digitalocean.com/community/questions/nothing-working-for-non-root-user sudo problem |
停止多个相同images的docker
docker stop $(docker ps | grep python | awk 'NR > 1 {print $1}'|xargs)
Find命令用法
mv配合grep移动
mkdir 同时创建子目录
The text was updated successfully, but these errors were encountered: