Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lihat waktu UTC lokal dan internet
- date -d "$(curl -sI google.com| grep -i '^date:'|cut -d' ' -f2-)"
- date -u -d "$(curl -sI google.com | grep -i '^date:' | cut -d' ' -f2-)"
- # figure out the process id (pid)
- netstat -tulp | grep kubectl
- # kill application
- sudo kill <<PID>>
- # no hangup
- nohub
- # open port di firewall
- sudo firewall-cmd --permanent --add-port=80/tcp
- # melihat list port di firewall
- sudo firewall-cmd --list-port
- # remove port
- sudo firewall-cmd --remove-port=6379/tcp --permanent
- # restart service firewall
- sudo firewall-cmd --reload
- # Check os version in Linux
- # debian
- cat /etc/os-release
- lsb_release -a
- # CentOs
- hostnamectl
- # kernel version
- uname -r
- # another option
- cat /proc/version
- cat /etc/issue
- more /etc/issue
- less /etc/issue
- # The procedure to run the .sh file shell script on Linux is as follows:
- # Set execute permission on your script:
- chmod +x script-name-here.sh
- #To run your script, enter:
- ./script-name-here.sh
- # OR
- sh script-name-here.sh
- # OR
- bash script-name-here.sh
- # pemberian hak akses readwrite direktori, default tidak recruisive tambahkan -R untuk recruisive
- chmod -R 0777 /mydirectory
- chmod -R 0755 /my-cool-directory
- # view free disk
- df -h
- df -a #shows the file system's complete disk usage even if the Available field is 0
- # melihat memory
- free -m
- cat /proc/meminfo
- vmstat -s
- top
- # restart linux
- sudo reboot
- shutdown -r +5
- # echo dari file
- echo "$(<a.txt )"
- # melihat info cpu
- cat /proc/cpuinfo
- # melihat jumlah thread cpu
- nproc --all
- echo "Threads: $(nproc --all)"
- # melihat dari konfigurasi
- getconf _NPROCESSORS_ONLN
- echo "Number of CPU/cores online at $HOSTNAME: $(getconf _NPROCESSORS_ONLN)"
- # socket, core cpu dll
- lscpu
- # contoh hasil
- Architecture: x86_64
- CPU op-mode(s): 32-bit, 64-bit
- Byte Order: Little Endian
- CPU(s): 8
- On-line CPU(s) list: 0-7
- Thread(s) per core: 1
- Core(s) per socket: 1
- Socket(s): 8
- NUMA node(s): 1
- Vendor ID: GenuineIntel
- CPU family: 6
- Model: 85
- Model name: Intel(R) Xeon(R) Platinum 8170 CPU @ 2.10GHz
- Stepping: 4
- CPU MHz: 2095.078
- BogoMIPS: 4190.15
- Hypervisor vendor: VMware
- Virtualization type: full
- L1d cache: 32K
- L1i cache: 32K
- L2 cache: 1024K
- L3 cache: 36608K
- NUMA node0 CPU(s): 0-7
- # diringkas
- lscpu | grep -E '^Thread|^Core|^Socket|^CPU\('
- # unzip
- # extract to mydir
- unzip wer.zip -d mydir
- # silent mode (-q perform operations quietly (-qq = even quieter))
- unzip -qq wer.zip
- # zip, jangan sertakan / di belakang direktori
- zip -r nginx.zip nginx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement