~/saidqb cat ecosystem/infra/linux.md
Li
Linux
Server operating system
commit by saidqb
Requirements
Command dasar berlaku di distro Linux mana pun. Perintah apt spesifik Debian/Ubuntu — distro lain pakai dnf/yum (RHEL/CentOS) atau pacman (Arch).
- Referensi: Ubuntu
24.04 LTS/ Debian12
bash
cat /etc/os-release && uname -rFile & isi file
bash
ls -la; cd /var/www; pwd
mkdir -p project/src
cp -r src dest; mv old.txt new.txt; rm -rf node_modules
find . -name "*.log"
cat file.txt; less file.txt
head -n 50 file.log
tail -f file.log # ikuti log realtime
grep -r "error" ./logsPermission & ownership
bash
chmod 755 script.sh
chmod -R 775 storage/
chown -R www-data:www-data /var/www/appProcess & resource
bash
ps aux | grep nginx
top # atau htop
kill -9 <PID>
systemctl status|restart|enable nginx
df -h # sisa disk
du -sh * # ukuran tiap folder
free -h # sisa RAMNetworking
bash
curl -I https://example.com
wget https://example.com/file.zip
ss -tulpn # port yang sedang listen
scp file.txt user@host:/path/Package manager (Debian/Ubuntu)
bash
sudo apt update && sudo apt upgrade
sudo apt install nginx
sudo apt remove nginxEnvironment, shell, cron
bash
export APP_ENV=production
echo $PATH
which php
alias ll='ls -la'
crontab -e
0 2 * * * /usr/bin/php /var/www/artisan schedule:run # tiap jam 2 pagi