Perintah dasar linux lanjutan
- Dapatkan link
- X
- Aplikasi Lainnya
Perintah Shell Lanjut
df
Fungsi: menampilkan penggunaan filesystem (Ukuran yang tersedia dan terpakai)
Sintaks: df [-option] ... [file] ...
Contoh:
$ df
$ df -h
$ df -h /home
du
Fungsi: menampilkan penggunaan file atau direktori
Sintaks: du [-option] ... [file] ...
Contoh:
$ du /etc
$ du -h /etc
$ du -sh /etc
free
Fungsi: menampilkan penggunaan memory
Sintaks: free [options]
Contoh:
$ free
$ free -h
ps
Fungsi: menampilkan status suatu proses
Sintaks: ps [options]
Contoh:
$ ps
$ ps aux
$ ps -ef
kill
Fungsi: mengirimkan sinyal kepada suatu proses (default:sinyal TERM)
Sintaks: kill [-signal] pid
Contoh:
$ kill 7988
$ kill -9 7988
$ kill -l
Gambar sebelum dijalankan perintahnya
Gambar sebelum dijalankan perintahnya
whereis
Fungsi: menampilkan lokasi binari, source dan halaman manual suatu perintah
Sintaks: whereis [-options] perintah...
Contoh:
$ whereis ls
ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz
$ whereis -b ls
ls: /usr/bin/ls
$ whereis -s ls
ls:
$ whereis -m ls
ls: /usr/share/man/man1/ls.1.gz
which
Fungsi: menampilkan lokasi suatu perintah
Sintaks: which [-a] perintah...
Contoh:
$ which ls
/usr/bin/ls
$ which -a ls
/bin/ls
find
Fungsi: mencari file di dalam struktur direktori linux
Sintaks: find [direktori] [kriteria]
Contoh:
$ find . -name "Linux*"
$ find -name "penyemangat*" -perm 775
./Documents/penyemangat.txt
grep
Sintaks : grep [-option...] patern [file...]
Contoh:
$ grep petik /etc/passwd
petik:x:1000:1000:Joss-Gundul,,,:/home/petik:/bin/bash
head - menampilkan n baris pertama suatu file
Sintaks: head [-cn] file
Keterangan:
-c : characters
-n : lines (default=10)
Contoh:
$ head -n4 /etc/passwd
root:x:0:0:root:/root:/bin/zsh
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
tail - menampilkan n baris terakhir suatu file
Sintaks : tail [-cn] file
Keterangan:
-c : characters
-n : lines (default=10)
Contoh:
$ tail -n4 /etc/passwd
wc - word count
Sintaks: wc [-lwc] file
Keterangan:
-l : line
-w : word
-c : character
Contoh:
$ wc /etc/passwd
cut - memotong
Sintaks : cut [-d”char”] [-fc] file
Keterangan:
-d”char” : delimeter
-f : field
-c : character
cut - memotong
Contoh:
$ cut -d: -f1-4 /etc/passwd
cut - memotong
Contoh:
$ cut -c1-4 /etc/passwd
sort - mengurut
Sintaks : sort [-t”char”] [-kpos] [-nr] file
Keterangan:
-t : delimeter
-k : key
-n : numerical value
-r : reverse order
Contoh:
$ sort -t: -k3 /etc/passwd
tr - translate
Sintaks : tr [-option] set1 [set2]
Contoh:
$ tr abc ABC < /etc/passwd
$ tr a-z A-Z < /etc/passwd
$ tr -d aiueo < /etc/passwd


















Komentar
Posting Komentar