示例: 使用parted创建分区(假设设备名为sda)
bash
(parted) select /dev/sda
(parted) mklabel gpt
(parted) mkpart primary ext4 1MiB 20GiB
(parted) set 1 boot on
(parted) mkpart primary ext4 20GiB 100%
(parted) print
bash
sudo apt update
sudo apt install git
bash
echo 'deb http://deb.debian.org/debian buster-backports main' | sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update
bash
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl status nginx
bash
sudo apt install zsh
chsh -s $(which zsh)
bash
alias ll='ls -alh'
bash
sudo apt install docker.io
sudo docker run -d -p 80:80 --name my-nginx nginx
bash
sudo apt install lxd
lxc launch images:ubuntu/focal my-ubuntu-container
bash
sudo apt install htop
htop
bash
sudo vi /etc/sysctl.conf
# 添加以下行
fs.file-max = 65535
sudo sysctl -p
bash
git branch feature-x
git checkout feature-x
bash
git mergetool
bash
git flow init
bash
vi .git/hooks/pre-commit
# 添加以下内容(示例为运行flake8代码检查)
#!/bin/sh
flake8 .
bash
#!/bin/bash
backup\_dir="/path/to/backup"
src\_dir="/path/to/source"
cd "$src\_dir"
find . -type d | while read dir; do
mkdir -p "$backup\_dir/$dir"
done
bash
crontab -e
# 添加以下行
0 1 \* \* \* /path/to/backup\_script.sh
通过掌握上述进阶使用技巧,您可以更高效地利用Debian系统进行开发、运维、管理等工作,提升工作效率,应对复杂场景。不断实践与学习,您将成长为Debian系统的高级用户。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。