#menemukan email
grep [a-Az-Z0-9]@[a-zA-Z].[a-Az-Z]
#menemukan tag di html menggunakan curl
curl 'https://website.com/' | grep '<title>'
#tampilkan hanya baris ke 9 didalam file
head -9 file.name | tail -1
#baris 9-15
head -15 file.name | tail -9
#baris pertama - 15
head -15 file.name
#baris ke 5 - 10 kolom 5
awk '{print $5}' file.name | head -10 | tail -5
#tampilkan baris ke 11-15 dengan nomor
nl file.name | head -15 | tail -5
#hanya baris pertama - 5
head -n +5 file.name
#tampilkan 10 baris dari 81 - 90 with no
nl file.name | head -90 | tail -10
#execute perintah saat tengah malam
echo "ls -l" | at midnight
#dowload dari website
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
#lihat layanan aktivitas jaringan direaltime
lsof -i
#tampilkan system file hirarki
man hier
#cek distro terinstall
cat /etc/issue
#graphical tree
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
#hex intercept stdout stderr di proses lain
strace -ff -e trace=write -e write=1,2 -p SOME_PID
#buat pdf dari man
man -t [command] | ps2pdfwr - [namafile]
man -t ls | ps2pdfwr - lsguide.pdf
#streaming yt
i="8uyxVmdaJ-w";mplayer -fs $(curl -s "http://www.youtube.com/get_video_info?&video_id=$i" | echo -e $(sed 's/%/\\x/g;s/.*\(v[0-9]\.lscache.*\)/http:\/\/\1/g') | grep -oP '^[^|,]*')
#remove file tapi bukan yg di define
rm -f !(filename.txt)
#hapus semua file kecuali yang defined
rm !(*.png|*.txt|*.tar)
#hasilkan text acak panjang
strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d ''; echo
#hapus recursive semua directory yg kosong
find . -type d -empty -delete
#delete everything kecuali extensi .sh
find . ! -name '*.sh' -delete
#hapus semua kecuali yang ditentukan
find . -type f ! \( -name '*.sh' -or -name '*.py' \) -delete
#temukan file >500mb dan <1gb
sudo find / -type f -size +500M -size -1G #size disesuaikan
#temukan file lebih besar dari 200mb dan lokasinya
sudo find / -type f -size +200M -exec du -h {} \;
#temukan file berextensi mp4, tampilakn lokasi dan ukurannya
sudo find / -type f -iname '.mp4' -exec du -h {} \;
#print line number 5 using sed
sed -n 5p name.file
#hapus line 50 didalam file
sed -i 50d file.txt
#mulai perintah dan kill after 5 detik
timeout 5s htop
#cek public myip addr
curl ip.me
#list only directory
ls -d */
#ls semua kecuali file.dat
ls !(*.dat)
#get your going ip addr
dig +short myip.opendns.com @resolver1.opendns.com
#make pohon folder
mkdir -p script/python/{python2,python3}
#folder induk script
#sub folder python isi python2 python3
#check tanggal website certificate ssl
echo | openssl s_client -connect www.google.com:443 2>/dev/null |openssl x509 -dates -noout
#send pesan ke another user in shell
echo "Hallo" | wall
#list ip terkonek ke myhost
netstat -lantp | grep ESTABLISHED |awk '{print $5}' | awk -F: '{print $1}' | sort -u
#daftar directory terbesar di current folder
du -hs */ | sort -hr | head
#urutkan dari yang terbesar termasuk hiden
du -h --max-depth=1 | sort -rh
#open file with default program
xdg-open [path] atau file
#display bandwidth statistik saat ini
ifstat -nt
#monitor memory yang digunakan
watch vmstat -sSM
#cek infromation bios
sudo dmidecode -t bios
#check speed ram
sudo dmidecode --type 17 | more
#lebih simple
sudo dmidecode --type 17 | grep -i 'speed'
#apa nama komputer yang digunakan
sudo dmidecode | grep Product
#simpan semua output
sudo dmidecode > dmidecode.stat
#kill process by id
kill -9 [PID]
#kill process by name
killall [nama proses]
killall -I [process name] #flag I ignore case
pkill -x [process name]
#ganti space di nama file with underscore
rename -v 's/ /_/g' * #flag v cetak if sukses #flag g global
#ubah lowercase ke uppercase didir saat ini
rename 'y/A-Z/a-z/' *
#list network di linux
apropos network | more
#ganti old_string kolom 5 ke new_string
awk '{gsub("old_string","new_string",$5)}1' file.name
#print semua column kecuali column 7
awk '{ $7=""; print }' file.name
#ambil random line didalam file
nl filename.txt | shuf -n1
#random file || folder
shuf -n1 -e *
#gen random caragter 1 - 20
gpg --gen-random --armor 1 22
#buat file cepat
> file
touch file
#membuat 50 file berextensi txt
touch {1..50}.txt
#get all installed package from debian system
dpkg --get-selections
#daftar complit list package
dpkg-query --list
#display os terinstall
cat /etc/*release
#list all command in system
ls ${PATH//:/ }
#documentasi python
pydoc3 socket # atau module lain
#print 40 x angka 0 di shell with python
python3 -c 'print ("0"*40)'
#python di shell
python3 -c 'import os;print (os.system("whoami"))'
grep [a-Az-Z0-9]@[a-zA-Z].[a-Az-Z]
#menemukan tag di html menggunakan curl
curl 'https://website.com/' | grep '<title>'
#tampilkan hanya baris ke 9 didalam file
head -9 file.name | tail -1
#baris 9-15
head -15 file.name | tail -9
#baris pertama - 15
head -15 file.name
#baris ke 5 - 10 kolom 5
awk '{print $5}' file.name | head -10 | tail -5
#tampilkan baris ke 11-15 dengan nomor
nl file.name | head -15 | tail -5
#hanya baris pertama - 5
head -n +5 file.name
#tampilkan 10 baris dari 81 - 90 with no
nl file.name | head -90 | tail -10
#execute perintah saat tengah malam
echo "ls -l" | at midnight
#dowload dari website
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
#lihat layanan aktivitas jaringan direaltime
lsof -i
#tampilkan system file hirarki
man hier
#cek distro terinstall
cat /etc/issue
#graphical tree
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
#hex intercept stdout stderr di proses lain
strace -ff -e trace=write -e write=1,2 -p SOME_PID
#buat pdf dari man
man -t [command] | ps2pdfwr - [namafile]
man -t ls | ps2pdfwr - lsguide.pdf
#streaming yt
i="8uyxVmdaJ-w";mplayer -fs $(curl -s "http://www.youtube.com/get_video_info?&video_id=$i" | echo -e $(sed 's/%/\\x/g;s/.*\(v[0-9]\.lscache.*\)/http:\/\/\1/g') | grep -oP '^[^|,]*')
#remove file tapi bukan yg di define
rm -f !(filename.txt)
#hapus semua file kecuali yang defined
rm !(*.png|*.txt|*.tar)
#hasilkan text acak panjang
strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d ''; echo
#hapus recursive semua directory yg kosong
find . -type d -empty -delete
#delete everything kecuali extensi .sh
find . ! -name '*.sh' -delete
#hapus semua kecuali yang ditentukan
find . -type f ! \( -name '*.sh' -or -name '*.py' \) -delete
#temukan file >500mb dan <1gb
sudo find / -type f -size +500M -size -1G #size disesuaikan
#temukan file lebih besar dari 200mb dan lokasinya
sudo find / -type f -size +200M -exec du -h {} \;
#temukan file berextensi mp4, tampilakn lokasi dan ukurannya
sudo find / -type f -iname '.mp4' -exec du -h {} \;
#print line number 5 using sed
sed -n 5p name.file
#hapus line 50 didalam file
sed -i 50d file.txt
#mulai perintah dan kill after 5 detik
timeout 5s htop
#cek public myip addr
curl ip.me
#list only directory
ls -d */
#ls semua kecuali file.dat
ls !(*.dat)
#get your going ip addr
dig +short myip.opendns.com @resolver1.opendns.com
#make pohon folder
mkdir -p script/python/{python2,python3}
#folder induk script
#sub folder python isi python2 python3
#check tanggal website certificate ssl
echo | openssl s_client -connect www.google.com:443 2>/dev/null |openssl x509 -dates -noout
#send pesan ke another user in shell
echo "Hallo" | wall
#list ip terkonek ke myhost
netstat -lantp | grep ESTABLISHED |awk '{print $5}' | awk -F: '{print $1}' | sort -u
#daftar directory terbesar di current folder
du -hs */ | sort -hr | head
#urutkan dari yang terbesar termasuk hiden
du -h --max-depth=1 | sort -rh
#open file with default program
xdg-open [path] atau file
#display bandwidth statistik saat ini
ifstat -nt
#monitor memory yang digunakan
watch vmstat -sSM
#cek infromation bios
sudo dmidecode -t bios
#check speed ram
sudo dmidecode --type 17 | more
#lebih simple
sudo dmidecode --type 17 | grep -i 'speed'
#apa nama komputer yang digunakan
sudo dmidecode | grep Product
#simpan semua output
sudo dmidecode > dmidecode.stat
#kill process by id
kill -9 [PID]
#kill process by name
killall [nama proses]
killall -I [process name] #flag I ignore case
pkill -x [process name]
#ganti space di nama file with underscore
rename -v 's/ /_/g' * #flag v cetak if sukses #flag g global
#ubah lowercase ke uppercase didir saat ini
rename 'y/A-Z/a-z/' *
#list network di linux
apropos network | more
#ganti old_string kolom 5 ke new_string
awk '{gsub("old_string","new_string",$5)}1' file.name
#print semua column kecuali column 7
awk '{ $7=""; print }' file.name
#ambil random line didalam file
nl filename.txt | shuf -n1
#random file || folder
shuf -n1 -e *
#gen random caragter 1 - 20
gpg --gen-random --armor 1 22
#buat file cepat
> file
touch file
#membuat 50 file berextensi txt
touch {1..50}.txt
#get all installed package from debian system
dpkg --get-selections
#daftar complit list package
dpkg-query --list
#display os terinstall
cat /etc/*release
#list all command in system
ls ${PATH//:/ }
#documentasi python
pydoc3 socket # atau module lain
#print 40 x angka 0 di shell with python
python3 -c 'print ("0"*40)'
#python di shell
python3 -c 'import os;print (os.system("whoami"))'
youtube-dl -f 251 'https://www.youtube.com/watch?v=EGHluJmsSs4'/ -o - | ffplay -nodisp -autoexit -i -
