Bab 1. Tutorial GNU/Linux

Daftar Isi

1.1. Dasar-dasar konsol
1.1.1. Prompt shell
1.1.2. The shell prompt under GUI
1.1.3. Akun root
1.1.4. Prompt shell root
1.1.5. Alat administrasi sistem GUI
1.1.6. Konsol virtual
1.1.7. Cara meninggalkan command prompt
1.1.8. Bagaimana mematikan sistem
1.1.9. Memulihkan suatu konsol yang waras
1.1.10. Saran paket tambahan untuk newbie
1.1.11. Akun pengguna tambahan
1.1.12. konfigurasi sudo
1.1.13. Waktu bermain
1.2. Sistem berkas mirip Unix
1.2.1. Dasar-dasar file Unix
1.2.2. Sistem file internal
1.2.3. Hak akses Filesystem
1.2.4. Kontrol izin untuk berkas yang baru dibuat: umask
1.2.5. Izin untuk grup pengguna (grup)
1.2.6. Timestamps
1.2.7. Links
1.2.8. Named pipes (FIFOs)
1.2.9. Sockets
1.2.10. Device files
1.2.11. Special device files
1.2.12. procfs and sysfs
1.2.13. tmpfs
1.3. Midnight Commander (MC)
1.3.1. Customization of MC
1.3.2. Starting MC
1.3.3. File manager in MC
1.3.4. Command-line tricks in MC
1.3.5. The internal editor in MC
1.3.6. The internal viewer in MC
1.3.7. Auto-start features of MC
1.3.8. FTP virtual filesystem of MC
1.4. The basic Unix-like work environment
1.4.1. The login shell
1.4.2. Customizing bash
1.4.3. Special key strokes
1.4.4. Mouse operations
1.4.5. The pager
1.4.6. The text editor
1.4.7. Setting a default text editor
1.4.8. Using vim
1.4.9. Recording the shell activities
1.4.10. Basic Unix commands
1.5. The simple shell command
1.5.1. Command execution and environment variable
1.5.2. The "$LANG" variable
1.5.3. The "$PATH" variable
1.5.4. The "$HOME" variable
1.5.5. Command line options
1.5.6. Shell glob
1.5.7. Return value of the command
1.5.8. Typical command sequences and shell redirection
1.5.9. Command alias
1.6. Unix-like text processing
1.6.1. Unix text tools
1.6.2. Regular expressions
1.6.3. Replacement expressions
1.6.4. Global substitution with regular expressions
1.6.5. Extracting data from text file table
1.6.6. Script snippets for piping commands

Saya rasa belajar sistem komputer seperti belajar bahasa asing baru. Meskipun buku dan dokumentasi tutorial sangat membantu, Anda harus mempraktikkannya sendiri. Untuk membantu Anda memulai dengan lancar, saya menguraikan beberapa hal mendasar.

Desain kuat dari Debian GNU/Linux berasal dari sistem operasi Unix, yaitu, suatu sistem operasi yang multiuser, multitasking. Anda harus belajar untuk mengambil keuntungan dari kekuatan fitur-fitur ini dan kemiripan antara Unix dan GNU/Linux.

Jangan menghindar dari teks yang berorientasi Unix dan jangan hanya mengandalkan teks GNU/Linux, karena ini merampas banyak informasi berguna.

[Catatan] Catatan

Jika Anda telah menggunakan salah satu sistem mirip Unix untuk sementara waktu dengan baris perintah, Anda mungkin tahu segala sesuatu yang saya jelaskan di sini. Harap gunakan ini sebagai uji realita dan penyegaran.

Saat memulai sistem, Anda disajikan layar login berbasis karakter bila Anda tidak memasang lingkungan GUI seperti misalnya sistem desktop GNOME atau KDE. Misalnya nama host Anda adalah foo, sapaan login tampak sebagai berikut.

Bila Anda memasang suatu lingkungan GUI , maka Anda masih dapat menuju ke sapaan login berbasis karakter dengan Ctrl-Alt-F3, dan Anda dapat kembali ke lingkungan GUI melalui Ctrl-Alt-F2 (lihat Bagian 1.1.6, “Konsol virtual” di bawah untuk lebih lanjut).

foo login:

Pada sapaan login, Anda mengetikkan nama pengguna Anda, mis. penguin, dan menekan tombol Enter, lalu ketikkan password Anda dan tekan tombol Enter lagi.

[Catatan] Catatan

Mengikuti tradisi Unix, username dan password sistem Debian membedakan huruf besar kecil. Nama pengguna biasanya dipilih hanya dari huruf kecil. Akun pengguna pertama biasanya dibuat saat instalasi. Akun pengguna tambahan dapat dibuat dengan adduser(8) oleh root.

Sistem mengawali dengan pesan sapaan yang disimpan dalam "/etc/motd" (Message Of The Day, Pesan Hari Ini) dan menyajikan suatu sapaan perintah.

Debian GNU/Linux 11 foo tty1

foo login: penguin
Password:
Linux foo 5.10.0-6-amd64 #1 SMP Debian 5.10.28-1 (2021-04-09) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu May 13 08:47:13 JST 2021 on tty1
foo:~$

Sekarang Anda berada di shell. Shell menafsirkan perintah-perintah Anda.

Jika Anda menginstal lingkungan GUI selama instalasi, Anda akan disajikan dengan layar login grafis saat memulai sistem Anda. Anda mengetikkan nama pengguna dan kata sandi Anda untuk log masuk ke akun pengguna biasa. Gunakan tab untuk menavigasi antara nama pengguna dan kata sandi, atau gunakan klik primer tetikus.

You can gain the shell prompt under GUI environment by starting a x-terminal-emulator program such as gnome-terminal(1), rxvt(1) or xterm(1). Under the GNOME Desktop environment, press SUPER-key (Windows-key) and typing in "terminal" to the search prompt does the trick.

Di bawah beberapa sistem Desktop lain (seperti fluxbox), mungkin ada titik awal yang jelas untuk menu. Jika ini terjadi, cobalah mengklik (kanan) latar belakang layar desktop dan berharap untuk munculnya suatu menu.

Akun root juga disebut superuser atau pengguna istimewa. Dari akun ini, Anda dapat melakukan tugas-tugas administrasi sistem berikut.

  • Baca, tulis, dan hapus file apapun di sistem terlepas dari hak akses file mereka

  • Setel kepemilikan file dan hak akses file apapun pada sistem

  • Tetapkan kata sandi pengguna non-istimewa di sistem

  • Login ke akun manapun tanpa password mereka

Kekuatan akun root tak terbatas ini mengharuskan Anda untuk mempertimbangkan dan bertanggung jawab saat menggunakannya.

[Awas] Awas

Jangan pernah berbagi password root dengan yang lain.

[Catatan] Catatan

Izin dalam sebuah berkas (termasuk perangkat keras seperti dll. CD-ROM yang sekedar suatu berkas lain untuk sistem Debian) dapat membuatnya tidak dapat digunakan atau tidak dapat diakses oleh pengguna non-root. Meskipun penggunaan akun root adalah cara cepat untuk menguji situasi semacam ini, resolusi harus dilakukan melalui pengaturan hak akses berkas dan keanggotaan grup pengguna yang tepat (Lihat Bagian 1.2.3, “Hak akses Filesystem”).

Ketika menu desktop Anda tidak memulai alat administrasi sistem GUI secara otomatis dengan hak istimewa yang sesuai, Anda dapat memulai mereka dari prompt shell root dari emulator terminal, seperti gnome-terminal(1), rxvt(1), atau xterm(1). Lihat Bagian 1.1.4, “Prompt shell root” dan Bagian 7.8, “X server connection”.

[Awas] Awas

Jangan pernah memulai pengelola tampilan/sesi GUI di bawah akun root dengan mengetikkan root ke prompt manajer tampilan seperti gdm3(1).

Jangan pernah menjalankan program GUI remote tidak terpercaya di bawah X Window ketika informasi penting ditampilkan karena itu dapat menguping X layar Anda.

Dalam sistem Debian default, ada enam konsol mode teks mirip VT100 yang dapat ditukar, tersedia untuk memulai shell perintah langsung pada host Linux. Kecuali Anda berada di lingkungan GUI, Anda dapat beralih antara konsol virtual dengan menekan tombol Alt kiri dan salah satu tombol F1-F6 secara bersamaan. Setiap konsol mode teks memungkinkan login yang independen ke akun dan menawarkan lingkungan multiuser. Lingkungan multiuser ini adalah fitur Unix yang hebat, dan sangat adiktif.

Jika Anda berada dalam lingkungan GUI, Anda mendapatkan akses ke konsol mode teks 3 dengan menekan tombol Ctrl-Alt-F3, yaitu tombol Ctrl kiri, tombol Alt kiri, dan tombol F3 ditekan bersamaan. Anda dapat bisa kembali ke lingkungan GUI, biasanya berjalan pada konsol virtual 2, dengan menekan Alt-F2.

Anda juga dapat berpindah ke konsol virtual lain, mis. ke konsol 3, dari baris perintah.

# chvt 3

Sama seperti OS moden lain manapun dimana operasi berkas melibatkan penyinggahan data dalam memori untuk peningkatan kinerja, sistem Debian memerlukan prosedur shutdown yang tepat sebelum daya aman dimatikan. Ini adalah untuk mempertahankan integritas berkas, dengan memaksa semua perubahan dalam memori harus ditulis ke disk. Jika perangkat lunak kendali daya tersedia, prosedur shutdown secara otomatis mematikan daya sistem. (Jika tidak, Anda mungkin harus menekan tombol power selama beberapa detik setelah prosedur shutdown.)

Anda bisa mematikan sistem di bawah mode multi user normal dari command line.

# shutdown -h now

Anda bisa mematikan sistem di bawah mode single-user dari commandline.

# poweroff -i -f

Lihat Bagian 6.3.8, “How to shutdown the remote system on SSH”.

Meskipun instalasi minimal sistem Debian tanpa task lingkungan desktop apa pun telah menyediakan fungsionalitas dasar Unix, ide yang baik untuk menginstal beberapa perintah tambahan dan paket terminal karakter berbasis curses seperti mc dan vim dengan apt-get(8) bagi pemula untuk mengawali dengan yang berikut ini.

# apt-get update
 ...
# apt-get install mc vim sudo
 ...

Jika Anda sudah menginstal paket ini, tidak ada paket baru yang diinstal.


Mungkin ada baiknya membaca beberapa dokumentasi informatif.


Anda dapat menginstal beberapa paket berikut ini.

# apt-get install package_name

Untuk workstation pengguna tunggal biasa seperti sistem Debian desktop pada PC laptop, biasanya menggunakan konfigurasi sederhana sudo(8) sebagai berikut untuk membiarkan pengguna yang tidak memiliki hak istimewa, mis. penguin, untuk mendapatkan hak administratif hanya dengan kata sandi penggunanya tetapi tanpa kata sandi root.

# echo "penguin  ALL=(ALL) ALL" >> /etc/sudoers

Sebagai alternatif, juga biasa dilakukan sebagai berikut untuk membiarkan pengguna biasa, mis. penguin, untuk mendapatkan hak administratif tanpa kata sandi.

# echo "penguin  ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

Trik ini hanya boleh digunakan untuk workstation pengguna tunggal yang Anda kelola dan di mana Anda adalah satu-satunya pengguna.

[Awas] Awas

Jangan membuat akun pengguna biasa di workstation multiuser seperti ini karena akan sangat buruk bagi keamanan sistem.

[Perhatian] Perhatian

Kata sandi dan akun penguin dalam contoh di atas membutuhkan perlindungan seperti kata sandi root dan akun root.

Hak administratif dalam konteks ini adalah milik seseorang yang berwenang untuk melakukan tugas administrasi sistem pada workstation. Jangan pernah memberikan hak semacam itu kepada manajer di departemen Admin di perusahaan Anda atau bos Anda, kecuali mereka memiliki wewenang dan kemampuan.

[Catatan] Catatan

Untuk memberikan hak akses ke perangkat terbatas dan berkas terbatas, Anda mesti mempertimbangkan untuk menggunakan group untuk memberikan akses terbatas daripada menggunakan hak istimewa root melalui sudo(8) .

Dengan konfigurasi yang lebih bijaksana dan hati-hati, sudo(8) dapat memberikan hak administratif terbatas kepada pengguna lain pada sistem bersama tanpa membagikan kata sandi root. Ini dapat membantu akuntabilitas dengan host dengan banyak administrator sehingga Anda dapat mengetahui siapa yang melakukan apa. Di sisi lain, Anda mungkin tidak ingin orang lain memiliki hak istimewa seperti itu.

Di GNU/Linux dan sistem operasi mirip Unix lainnya, berkas diatur ke dalam direktori. Semua berkas dan direktori diatur dalam satu pohon besar yang berakar pada "/". Disebut pohon karena jika Anda menggambar sistem berkas, itu terlihat seperti pohon tetapi terbalik.

Berkas dan direktori ini dapat tersebar di beberapa perangkat. mount(8) berfungsi untuk mencantolkan sistem berkas yang ditemukan pada beberapa perangkat ke pohon berkas besar. Sebaliknya, umount(8) melepaskannya lagi. Pada kernel Linux terbaru, mount(8) dengan beberapa opsi dapat mengikat bagian dari pohon berkas di tempat lain atau dapat mengait sistem berkas sebagai shared, private, slave, atau unbindable. Opsi pemasangan yang didukung untuk setiap sistem berkas tersedia di "/usr/share/doc/linux-doc-*/Documentation/filesystems/".

Direktori pada sistem Unix disebut folder pada beberapa sistem lain. Harap perhatikan juga bahwa tidak ada konsep untuk drive seperti "A:" pada sistem Unix mana pun. Ada satu sistem berkas, dan semuanya disertakan. Ini adalah keuntungan besar dibandingkan dengan Windows.

Berikut adalah beberapa dasar-dasar file Unix.

[Catatan] Catatan

Meskipun Anda dapat menggunakan hampir semua huruf atau simbol dalam nama berkas, dalam praktiknya adalah ide yang buruk untuk melakukannya. Sebaiknya hindari karakter yang sering memiliki arti khusus pada baris perintah, termasuk spasi, tab, baris baru, dan karakter khusus lainnya: { } ( ) [ ] ' ` " \ / > < | ; ! # & ^ * % @ $ . Jika Anda ingin memisahkan kata dalam sebuah nama, pilihan yang baik adalah titik, tanda hubung, dan garis bawah. Anda juga dapat menggunakan huruf besar untuk setiap kata, "SepertiIni". Pengguna Linux yang berpengalaman cenderung menghindari spasi dalam nama berkas.

[Catatan] Catatan

Kata "root" dapat berarti "pengguna root" atau "direktori root". Konteks penggunaannya harus membuatnya jelas.

[Catatan] Catatan

Kata path digunakan tidak hanya untuk nama berkas lengkap seperti di atas tetapi juga untuk path pencarian perintah. Makna yang dimaksud biasanya jelas dari konteksnya.

Praktik terbaik terperinci untuk hierarki berkas dijelaskan dalam Standar Hierarki Sistem Berkas/Filesystem Hierarchy Standard ("/usr/share/doc/debian-policy/fhs/fhs-2.3.txt.gz" dan hier(7)). Anda harus mengingat fakta-fakta berikut di awal.


Mengikuti tradisi Unix, sistem GNU/Linux Debian menyediakan sistem berkas di mana data fisik pada hard disk dan perangkat penyimpanan lainnya berada, dan interaksi dengan perangkat keras seperti layar konsol dan konsol serial jarak jauh diwakili secara terpadu di bawah "/dev/".

Setiap berkas, direktori, pipa bernama (cara dua program dapat berbagi data), atau perangkat fisik pada sistem Debian GNU/Linux memiliki struktur data yang disebut inode yang menjelaskan atribut terkait seperti pengguna yang memilikinya (pemilik), grup yang diikutinya, waktu terakhir diakses, dll. Gagasan untuk mewakili hampir semua hal dalam sistem berkas adalah inovasi Unix, dan kernel Linux modern telah mengembangkan gagasan ini lebih jauh. Sekarang, bahkan informasi tentang proses yang berjalan di komputer dapat ditemukan di sistem berkas.

Representasi abstrak dan kesatuan entitas fisik dan proses internal ini sangat kuat karena ini memungkinkan kita untuk menggunakan perintah yang sama untuk jenis operasi yang sama pada banyak perangkat yang sama sekali berbeda. Bahkan dimungkinkan untuk mengubah cara kerja kernel dengan menulis data ke file khusus yang terkait dengan proses yang berjalan.

[Tip] Tip

Jika Anda perlu mengidentifikasi korespondensi antara pohon berkas dan entitas fisik, jalankan mount(8) tanpa argumen.

Izin sistem berkas dari sistem seperti Unix ditentukan untuk tiga kategori pengguna yang terpengaruh.

  • pengguna yang memiliki berkas (u)

  • Pengguna lain di grup tempat berkas tersebut termasuk (g)

  • Semua pengguna lainnya (o) juga disebut sebagai "dunia" dan "semua orang"

Untuk file tersebut, setiap izin yang sesuai memungkinkan tindakan berikut.

  • Izin baca (r) memungkinkan pemilik untuk memeriksa konten berkas.

  • Izin tulis (w) memungkinkan pemilik untuk memodifikasi berkas.

  • Izin eksekusi (x) memungkinkan pemilik untuk menjalankan berkas sebagai perintah.

Untuk direktori, setiap izin yang sesuai memungkinkan tindakan berikut.

  • Izin baca (r) memungkinkan pemilik untuk membuat daftar isi direktori.

  • Izin tulis (w) memungkinkan pemilik untuk menambah atau menghapus berkas dalam direktori.

  • Izin eksekusi (x) memungkinkan pemilik untuk mengakses berkas dalam direktori.

Di sini, izin eksekusi pada direktori berarti tidak hanya mengizinkan pembacaan berkas di direktori itu tetapi juga untuk memungkinkan melihat atribut mereka, seperti ukuran dan waktu modifikasi.

ls(1) digunakan untuk menampilkan informasi izin (dan lebih banyak lagi) untuk berkas dan direktori. Ketika dipanggil dengan opsi "-l", ini menampilkan informasi berikut dalam urutan yang diberikan.

  • Tipe berkas (karakter pertama)

  • Izin akses berkas (sembilan karakter, masing-masing terdiri dari tiga karakter untuk pengguna, grup, dan lainnya dalam urutan ini)

  • Banyaknya hard link ke berkas

  • Nama dari pengguna yang memiliki berkas tersebut

  • Nama dari grup pemilik berkas tersebut

  • Ukuran berkas dalam karakter (byte)

  • Tanggal dan waktu berkas (mtime)

  • Nama berkas


chown(1) digunakan dari akun root untuk mengubah pemilik berkas. chgrp(1) digunakan dari pemilik berkas atau akun root untuk mengubah grup berkas. chmod(1) digunakan dari pemilik berkas atau akun root untuk mengubah izin akses berkas dan direktori. Sintaks dasar untuk memanipulasi berkas foo adalah sebagai berikut.

# chown newowner foo
# chgrp newgroup foo
# chmod  [ugoa][+-=][rwxXst][,...] foo

Misalnya, Anda dapat membuat pohon direktori agar dimiliki oleh pengguna foo dan dipakai bersama oleh grup bar dengan cara berikut ini.

# cd /some/location/
# chown -R foo:bar .
# chmod -R ug+rwX,o=rX .

Ada tiga bit izin khusus lagi.

  • Bit set user ID (s atau S alih-alih x pengguna)

  • Bit set group ID (s atau S alih-alih x grup)

  • Bit sticky (t atau T alih-alih x lainnya)

Di sini keluaran dari "ls -l" untuk bit ini adalah dalam kapital jika bit eksekusi yang disembunyikan oleh keluaran ini tak ditata.

Menyetel set ID pengguna pada berkas executable memungkinkan pengguna untuk menjalankan berkas executable dengan ID pemilik berkas (misalnya root). Demikian pula, pengaturan set ID grup pada berkas executable memungkinkan pengguna untuk menjalankan berkas executable dengan ID grup berkas (misalnya root). Karena pengaturan ini dapat menyebabkan risiko keamanan, mengaktifkannya memerlukan kehati-hatian ekstra.

Mengatur set ID grup pada direktori akan mengaktifkan skema pembuatan berkas seperti BSD di mana semua berkas yang dibuat dalam direktori menjadi milik grup dari direktori.

Menyetel sticky bit pada direktori mencegah berkas dalam direktori dihapus oleh pengguna yang bukan pemilik berkas. Untuk mengamankan konten berkas di direktori yang dapat ditulis dunia seperti "/tmp" atau dalam direktori yang dapat ditulis grup, seseorang tidak hanya harus mengatur ulang izin tulis untuk berkas tersebut, tetapi juga mengatur sticky bit pada direktori. Jika tidak, berkas dapat dihapus dan berkas baru dapat dibuat dengan nama yang sama oleh setiap pengguna yang memiliki akses tulis ke direktori.

Berikut adalah beberapa contoh menarik dari izin berkas.

$ ls -l /etc/passwd /etc/shadow /dev/ppp /usr/sbin/exim4
crw------T 1 root root   108, 0 Oct 16 20:57 /dev/ppp
-rw-r--r-- 1 root root     2761 Aug 30 10:38 /etc/passwd
-rw-r----- 1 root shadow   1695 Aug 30 10:38 /etc/shadow
-rwsr-xr-x 1 root root   973824 Sep 23 20:04 /usr/sbin/exim4
$ ls -ld /tmp /var/tmp /usr/local /var/mail /usr/src
drwxrwxrwt 14 root root  20480 Oct 16 21:25 /tmp
drwxrwsr-x 10 root staff  4096 Sep 29 22:50 /usr/local
drwxr-xr-x 10 root root   4096 Oct 11 00:28 /usr/src
drwxrwsr-x  2 root mail   4096 Oct 15 21:40 /var/mail
drwxrwxrwt  3 root root   4096 Oct 16 21:20 /var/tmp

Ada mode numerik alternatif untuk menjelaskan izin berkas dengan chmod(1). Mode numerik ini menggunakan 3 hingga 4 digit angka oktal lebar (radix = 8).


Ini terdengar rumit tetapi sebenarnya cukup sederhana. Jika Anda melihat beberapa (2-10) kolom pertama dari keluaran perintah "ls -l" dan membacanya sebagai representasi biner (basis=2) dari izin berkas ("-" menjadi "0" dan "rwx" menjadi "1"), 3 digit terakhir dari nilai mode numerik harus masuk akal sebagai representasi oktal (basis=8) dari izin berkas bagi Anda.

Misalnya, coba yang berikut ini

$ touch foo bar
$ chmod u=rw,go=r foo
$ chmod 644 bar
$ ls -l foo bar
-rw-r--r-- 1 penguin penguin 0 Oct 16 21:39 bar
-rw-r--r-- 1 penguin penguin 0 Oct 16 21:35 foo
[Tip] Tip

Jika Anda perlu mengakses informasi yang ditampilkan oleh "ls -l" dalam skrip shell, Anda harus menggunakan perintah terkait seperti test(1), stat(1 ), dan readlink(1). Bawaan shell seperti "[" atau "test" dapat digunakan juga.

Untuk membuat izin grup diterapkan ke pengguna tertentu, pengguna tersebut perlu dijadikan anggota grup menggunakan "sudo vigr" untuk /etc/group dan "sudo vigr -s" untuk /etc/gshadow. Anda harus log masuk setelah log keluar (atau menjalankan "exec newgrp") untuk mengaktifkan konfigurasi grup baru.

[Catatan] Catatan

Atau, Anda dapat secara dinamis menambahkan pengguna ke grup selama proses otentikasi dengan menambahkan baris "auth optional pam_group.so" ke "/etc/pam.d/common-auth" dan pengaturan "/etc/security/group.conf". (Lihat Bab 4, Authentication and access controls.)

Perangkat keras hanyalah jenis berkas lain di sistem Debian. Jika Anda memiliki masalah dalam mengakses perangkat seperti CD-ROM dan flash disk USB dari akun pengguna, Anda harus menjadikan pengguna tersebut anggota grup yang relevan.

Beberapa grup terkenal yang disediakan sistem mengizinkan anggotanya mengakses berkas dan perangkat tertentu tanpa hak istimewa root.


[Tip] Tip

Anda harus tergabung dalam grup dialout untuk mengkonfigurasi ulang modem, dial ke mana pun, dll. Tetapi jika root membuat berkas konfigurasi yang telah ditentukan sebelumnya untuk rekan tepercaya di "/etc/ppp/peers/", Anda hanya perlu menjadi bagian dari grup dip untuk membuat koneksi IP Dialup ke rekan tepercaya tersebut menggunakan perintah pppd(8), pon(1), dan poff(1).

Beberapa grup terkenal yang disediakan sistem mengizinkan anggotanya untuk menjalankan perintah tertentu tanpa hak istimewa root.


For the full listing of the system provided users and groups, see the recent version of the "Users and Groups" document in "/usr/share/doc/base-passwd/users-and-groups.html" provided by the base-passwd package.

See passwd(5), group(5), shadow(5), newgrp(1), vipw(8), vigr(8), and pam_group(8) for management commands of the user and group system.

There are three types of timestamps for a GNU/Linux file.


[Catatan] Catatan

ctime bukanlah waktu pembuatan berkas.

[Catatan] Catatan

The actual value of atime on GNU/Linux system may be different from that of the historic Unix definition.

  • Overwriting a file changes all of the mtime, ctime, and atime attributes of the file.

  • Changing ownership or permission of a file changes the ctime and atime attributes of the file.

  • Reading a file changes the atime attribute of the file on the historic Unix system.

  • Reading a file changes the atime attribute of the file on the GNU/Linux system if its filesystem is mounted with "strictatime".

  • Reading a file for the first time or after one day changes the atime attribute of the file on the GNU/Linux system if its filesystem is mounted with "relatime". (default behavior since Linux 2.6.30)

  • Reading a file doesn't change the atime attribute of the file on the GNU/Linux system if its filesystem is mounted with "noatime".

[Catatan] Catatan

The "noatime" and "relatime" mount options are introduced to improve the filesystem read performance under the normal use cases. Simple file read operation under the "strictatime" option accompanies the time-consuming write operation to update the atime attribute. But the atime attribute is rarely used except for the mbox(5) file. See mount(8).

Use touch(1) command to change timestamps of existing files.

For timestamps, the ls command outputs localized strings under non-English locale ("fr_FR.UTF-8").

$ LANG=C  ls -l foo
-rw-rw-r-- 1 penguin penguin 0 Oct 16 21:35 foo
$ LANG=en_US.UTF-8  ls -l foo
-rw-rw-r-- 1 penguin penguin 0 Oct 16 21:35 foo
$ LANG=fr_FR.UTF-8  ls -l foo
-rw-rw-r-- 1 penguin penguin 0 oct. 16 21:35 foo
[Tip] Tip

See Bagian 9.3.4, “Customized display of time and date” to customize "ls -l" output.

There are two methods of associating a file "foo" with a different filename "bar".

See the following example for changes in link counts and the subtle differences in the result of the rm command.

$ umask 002
$ echo "Original Content" > foo
$ ls -li foo
1449840 -rw-rw-r-- 1 penguin penguin 17 Oct 16 21:42 foo
$ ln foo bar     # hard link
$ ln -s foo baz  # symlink
$ ls -li foo bar baz
1449840 -rw-rw-r-- 2 penguin penguin 17 Oct 16 21:42 bar
1450180 lrwxrwxrwx 1 penguin penguin  3 Oct 16 21:47 baz -> foo
1449840 -rw-rw-r-- 2 penguin penguin 17 Oct 16 21:42 foo
$ rm foo
$ echo "New Content" > foo
$ ls -li foo bar baz
1449840 -rw-rw-r-- 1 penguin penguin 17 Oct 16 21:42 bar
1450180 lrwxrwxrwx 1 penguin penguin  3 Oct 16 21:47 baz -> foo
1450183 -rw-rw-r-- 1 penguin penguin 12 Oct 16 21:48 foo
$ cat bar
Original Content
$ cat baz
New Content

The hardlink can be made within the same filesystem and shares the same inode number which the "-i" option with ls(1) reveals.

The symlink always has nominal file access permissions of "rwxrwxrwx", as shown in the above example, with the effective access permissions dictated by permissions of the file that it points to.

[Perhatian] Perhatian

It is generally a good idea not to create complicated symbolic links or hardlinks at all unless you have a very good reason. It may cause nightmares where the logical combination of the symbolic links results in loops in the filesystem.

[Catatan] Catatan

It is generally preferable to use symbolic links rather than hardlinks unless you have a good reason for using a hardlink.

The "." directory links to the directory that it appears in, thus the link count of any new directory starts at 2. The ".." directory links to the parent directory, thus the link count of the directory increases with the addition of new subdirectories.

If you are just moving to Linux from Windows, it soon becomes clear how well-designed the filename linking of Unix is, compared with the nearest Windows equivalent of "shortcuts". Because it is implemented in the filesystem, applications can't see any difference between a linked file and the original. In the case of hardlinks, there really is no difference.

A named pipe is a file that acts like a pipe. You put something into the file, and it comes out the other end. Thus it's called a FIFO, or First-In-First-Out: the first thing you put in the pipe is the first thing to come out the other end.

If you write to a named pipe, the process which is writing to the pipe doesn't terminate until the information being written is read from the pipe. If you read from a named pipe, the reading process waits until there is nothing to read before terminating. The size of the pipe is always zero --- it does not store data, it just links two processes like the functionality offered by the shell "|" syntax. However, since this pipe has a name, the two processes don't have to be on the same command line or even be run by the same user. Pipes were a very influential innovation of Unix.

Misalnya, coba yang berikut ini

$ cd; mkfifo mypipe
$ echo "hello" >mypipe & # put into background
[1] 8022
$ ls -l mypipe
prw-rw-r-- 1 penguin penguin 0 Oct 16 21:49 mypipe
$ cat mypipe
hello
[1]+  Done                    echo "hello" >mypipe
$ ls mypipe
mypipe
$ rm mypipe

Device files refer to physical or virtual devices on your system, such as your hard disk, video card, screen, or keyboard. An example of a virtual device is the console, represented by "/dev/console".

There are 2 types of device files.

  • Character device

    • Accessed one character at a time

    • 1 character = 1 byte

    • E.g. keyboard device, serial port, …

  • Block device

    • accessed in larger units called blocks

    • 1 block > 1 byte

    • E.g. hard disk, …

You can read and write device files, though the file may well contain binary data which may be an incomprehensible-to-humans gibberish. Writing data directly to these files is sometimes useful for the troubleshooting of hardware connections. For example, you can dump a text file to the printer device "/dev/lp0" or send modem commands to the appropriate serial port "/dev/ttyS0". But, unless this is done carefully, it may cause a major disaster. So be cautious.

[Catatan] Catatan

For the normal access to a printer, use lp(1).

The device node number are displayed by executing ls(1) as the following.

$ ls -l /dev/sda /dev/sr0 /dev/ttyS0 /dev/zero
brw-rw---T  1 root disk     8,  0 Oct 16 20:57 /dev/sda
brw-rw---T+ 1 root cdrom   11,  0 Oct 16 21:53 /dev/sr0
crw-rw---T  1 root dialout  4, 64 Oct 16 20:57 /dev/ttyS0
crw-rw-rw-  1 root root     1,  5 Oct 16 20:57 /dev/zero
  • "/dev/sda" has the major device number 8 and the minor device number 0. This is read/write accessible by users belonging to the disk group.

  • "/dev/sr0" has the major device number 11 and the minor device number 0. This is read/write accessible by users belonging to the cdrom group.

  • "/dev/ttyS0" has the major device number 4 and the minor device number 64. This is read/write accessible by users belonging to the dialout group.

  • "/dev/zero" has the major device number 1 and the minor device number 5. This is read/write accessible by anyone.

On the modern Linux system, the filesystem under "/dev/" is automatically populated by the udev(7) mechanism.

The procfs and sysfs mounted on "/proc" and "/sys" are the pseudo-filesystem and expose internal data structures of the kernel to the userspace. In other word, these entries are virtual, meaning that they act as a convenient window into the operation of the operating system.

The directory "/proc" contains (among other things) one subdirectory for each process running on the system, which is named after the process ID (PID). System utilities that access process information, such as ps(1), get their information from this directory structure.

The directories under "/proc/sys/" contain interfaces to change certain kernel parameters at run time. (You may do the same through the specialized sysctl(8) command or its preload/configuration file "/etc/sysctl.conf".)

People frequently panic when they notice one file in particular - "/proc/kcore" - which is generally huge. This is (more or less) a copy of the content of your computer's memory. It's used to debug the kernel. It is a virtual file that points to computer memory, so don't worry about its size.

The directory under "/sys" contains exported kernel data structures, their attributes, and their linkages between them. It also contains interfaces to change certain kernel parameters at run time.

See "proc.txt(.gz)", "sysfs.txt(.gz)" and other related documents in the Linux kernel documentation ("/usr/share/doc/linux-doc-*/Documentation/filesystems/*") provided by the linux-doc-* package.

The tmpfs is a temporary filesystem which keeps all files in the virtual memory. The data of the tmpfs in the page cache on memory may be swapped out to the swap space on disk as needed.

The directory "/run" is mounted as the tmpfs in the early boot process. This enables writing to it even when the directory "/" is mounted as read-only. This is the new location for the storage of transient state files and replaces several locations described in the Filesystem Hierarchy Standard version 2.3:

  • "/var/run" → "/run"

  • "/var/lock" → "/run/lock"

  • "/dev/shm" → "/run/shm"

See "tmpfs.txt(.gz)" in the Linux kernel documentation ("/usr/share/doc/linux-doc-*/Documentation/filesystems/*") provided by the linux-doc-* package.

Midnight Commander (MC) is a GNU "Swiss army knife" for the Linux console and other terminal environments. This gives newbie a menu driven console experience which is much easier to learn than standard Unix commands.

You may need to install the Midnight Commander package which is titled "mc" by the following.

$ sudo apt-get install mc

Use the mc(1) command to explore the Debian system. This is the best way to learn. Please explore few interesting locations just using the cursor keys and Enter key.

  • "/etc" and its subdirectories

  • "/var/log" and its subdirectories

  • "/usr/share/doc" and its subdirectories

  • "/sbin" and "/bin"

Although MC enables you to do almost everything, it is very important for you to learn how to use the command line tools invoked from the shell prompt and become familiar with the Unix-like work environment.

You should become proficient in one of variants of Vim or Emacs programs which are popular in the Unix-like system.

I think getting used to Vim commands is the right thing to do, since Vi-editor is always there in the Linux/Unix world. (Actually, original vi or new nvi are programs you find everywhere. I chose Vim instead for newbie since it offers you help through F1 key while it is similar enough and more powerful.)

If you chose either Emacs or XEmacs instead as your choice of the editor, that is another good choice indeed, particularly for programming. Emacs has a plethora of other features as well, including functioning as a newsreader, directory editor, mail program, etc. When used for programming or editing shell scripts, it intelligently recognizes the format of what you are working on, and tries to provide assistance. Some people maintain that the only program they need on Linux is Emacs. Ten minutes learning Emacs now can save hours later. Having the GNU Emacs manual for reference when learning Emacs is highly recommended.

All these programs usually come with tutoring program for you to learn them by practice. Start Vim by typing "vim" and press F1-key. You should at least read the first 35 lines. Then do the online training course by moving cursor to "|tutor|" and pressing Ctrl-].

[Catatan] Catatan

Good editors, such as Vim and Emacs, can handle UTF-8 and other exotic encoding texts correctly. It is a good idea to use the GUI environment in the UTF-8 locale and to install required programs and fonts to it. Editors have options to set the file encoding independent of the GUI environment. Please refer to their documentation on multibyte text.

The recent vim(1) starts itself in the sane "nocompatible" option and enters into the NORMAL mode.[1]


Harap gunakan program "vimtutor" untuk belajar vim melalui suatu kursus tutorial interaktif.

The vim program changes its behavior to typed key strokes based on mode. Typing in key strokes to the buffer is mostly done in INSERT-mode and REPLACE-mode. Moving cursor is mostly done in NORMAL-mode. Interactive selection is done in VISUAL-mode. Typing ":" in NORMAL-mode changes its mode to Ex-mode. Ex-mode accepts commands.

[Tip] Tip

The Vim comes with the Netrw package. Netrw supports reading files, writing files, browsing directories over a network, and local browsing! Try Netrw with "vim ." (a period as the argument) and read its manual at ":help netrw".

For the advanced configuration of vim, see Bagian 9.2, “Customizing vim”.

Let's learn basic Unix commands. Here I use "Unix" in its generic sense. Any Unix clone OSs usually offer equivalent commands. The Debian system is no exception. Do not worry if some commands do not work as you wish now. If alias is used in the shell, its corresponding command outputs are different. These examples are not meant to be executed in this order.

Try all following commands from the non-privileged user account.

Tabel 1.17. List of basic Unix commands

command deskripsi
pwd display name of current/working directory
whoami display current user name
id display current user identity (name, uid, gid, and associated groups)
file foo display a type of file for the file "foo"
type -p namaperintah display a file location of command "commandname"
which namaperintah , ,
type namaperintah display information on command "commandname"
apropos kata-kunci find commands related to "key-word"
man -k kata-kunci , ,
whatis namaperintah display one line explanation on command "commandname"
man -a namaperintah display explanation on command "commandname" (Unix style)
info namaperintah display rather long explanation on command "commandname" (GNU style)
ls list contents of directory (non-dot files and directories)
ls -a list contents of directory (all files and directories)
ls -A list contents of directory (almost all files and directories, i.e., skip ".." and ".")
ls -la list all contents of directory with detail information
ls -lai list all contents of directory with inode number and detail information
ls -d list all directories under the current directory
tree display file tree contents
lsof foo list open status of file "foo"
lsof -p pid list files opened by the process ID: "pid"
mkdir foo make a new directory "foo" in the current directory
rmdir foo remove a directory "foo" in the current directory
cd foo change directory to the directory "foo" in the current directory or in the directory listed in the variable "$CDPATH"
cd / change directory to the root directory
cd change directory to the current user's home directory
cd /foo change directory to the absolute path directory "/foo"
cd .. change directory to the parent directory
cd ~foo change directory to the home directory of the user "foo"
cd - change directory to the previous directory
</etc/motd pager display contents of "/etc/motd" using the default pager
touch junkfile create a empty file "junkfile"
cp foo bar copy a existing file "foo" to a new file "bar"
rm junkfile remove a file "junkfile"
mv foo bar rename an existing file "foo" to a new name "bar" ("bar" must not exist)
mv foo bar move an existing file "foo" to a new location "bar/foo" (the directory "bar" must exist)
mv foo bar/baz move an existing file "foo" to a new location with a new name "bar/baz" (the directory "bar" must exist but the directory "bar/baz" must not exist)
chmod 600 foo make an existing file "foo" to be non-readable and non-writable by the other people (non-executable for all)
chmod 644 foo make an existing file "foo" to be readable but non-writable by the other people (non-executable for all)
chmod 755 foo make an existing file "foo" to be readable but non-writable by the other people (executable for all)
find . -name pattern find matching filenames using shell "pattern" (slower)
locate -d . pattern find matching filenames using shell "pattern" (quicker using regularly generated database)
grep -e "pattern" *.html find a "pattern" in all files ending with ".html" in current directory and display them all
top display process information using full screen, type "q" to quit
ps aux | pager display information on all the running processes using BSD style output
ps -ef | pager display information on all the running processes using Unix system-V style output
ps aux | grep -e "[e]xim4*" display all processes running "exim" and "exim4"
ps axf | pager display information on all the running processes with ASCII art output
kill 1234 kill a process identified by the process ID: "1234"
gzip foo compress "foo" to create "foo.gz" using the Lempel-Ziv coding (LZ77)
gunzip foo.gz decompress "foo.gz" to create "foo"
bzip2 foo compress "foo" to create "foo.bz2" using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding (better compression than gzip)
bunzip2 foo.bz2 decompress "foo.bz2" to create "foo"
xz foo compress "foo" to create "foo.xz" using the Lempel–Ziv–Markov chain algorithm (better compression than bzip2)
unxz foo.xz decompress "foo.xz" to create "foo"
tar -xvf foo.tar extract files from "foo.tar" archive
tar -xvzf foo.tar.gz extract files from gzipped "foo.tar.gz" archive
tar -xvjf foo.tar.bz2 extract files from "foo.tar.bz2" archive
tar -xvJf foo.tar.xz extract files from "foo.tar.xz" archive
tar -cvf foo.tar bar/ archive contents of folder "bar/" in "foo.tar" archive
tar -cvzf foo.tar.gz bar/ archive contents of folder "bar/" in compressed "foo.tar.gz" archive
tar -cvjf foo.tar.bz2 bar/ archive contents of folder "bar/" in "foo.tar.bz2" archive
tar -cvJf foo.tar.xz bar/ archive contents of folder "bar/" in "foo.tar.xz" archive
zcat README.gz | pager display contents of compressed "README.gz" using the default pager
zcat README.gz > foo create a file "foo" with the decompressed content of "README.gz"
zcat README.gz >> foo append the decompressed content of "README.gz" to the end of the file "foo" (if it does not exist, create it first)

[Catatan] Catatan

Unix has a tradition to hide filenames which start with ".". They are traditionally files that contain configuration information and user preferences.

For cd command, see builtins(7).

The default pager of the bare bone Debian system is more(1) which cannot scroll back. By installing the less package using command line "apt-get install less", less(1) becomes default pager and you can scroll back with cursor keys.

The "[" and "]" in the regular expression of the "ps aux | grep -e "[e]xim4*"" command above enable grep to avoid matching itself. The "4*" in the regular expression means 0 or more repeats of character "4" thus enables grep to match both "exim" and "exim4". Although "*" is used in the shell filename glob and the regular expression, their meanings are different. Learn the regular expression from grep(1).

Please traverse directories and peek into the system using the above commands as training. If you have questions on any of console commands, please make sure to read the manual page.

Misalnya, coba yang berikut ini

$ man man
$ man bash
$ man builtins
$ man grep
$ man ls

The style of man pages may be a little hard to get used to, because they are rather terse, particularly the older, very traditional ones. But once you get used to it, you come to appreciate their succinctness.

Please note that many Unix-like commands including ones from GNU and BSD display brief help information if you invoke them in one of the following ways (or without any arguments in some cases).

$ commandname --help
$ commandname -h

Now you have some feel on how to use the Debian system. Let's look deep into the mechanism of the command execution in the Debian system. Here, I have simplified reality for the newbie. See bash(1) for the exact explanation.

A simple command is a sequence of components.

  1. Variable assignments (optional)

  2. Command name

  3. Arguments (optional)

  4. Redirections (optional: > , >> , < , << , etc.)

  5. Control operator (optional: && , || , newline , ; , & , ( , ) )

The values of some environment variables change the behavior of some Unix commands.

Default values of environment variables are initially set by the PAM system and then some of them may be reset by some application programs.

  • The PAM system such as pam_env may set environment variables by /etc/pam.conf", "/etc/environment" and "/etc/default/locale".

  • The display manager such as gdm3 may reset environment variables for GUI session.

  • The user specific program initialization may reset environment variables by "~/.profile", "~/.bash_profile" and "~/.bashrc".

The default locale is defined in the "$LANG" environment variable and is configured as "LANG=xx_YY.UTF-8" by the installer or by the subsequent GUI configuration, e.g., "Settings" → "Region & Language" → "Language" / "Formats" for GNOME.

[Catatan] Catatan

I recommend you to configure the system environment just by the "$LANG" variable for now and to stay away from "$LC_*" variables unless it is absolutely needed.

The full locale value given to "$LANG" variable consists of 3 parts: "xx_YY.ZZZZ".



Typical command execution uses a shell line sequence as the following.

$ echo $LANG
en_US.UTF-8
$ date -u
Wed 19 May 2021 03:18:43 PM UTC
$ LANG=fr_FR.UTF-8 date -u
mer. 19 mai 2021 15:19:02 UTC

Here, the program date(1) is executed with different locale values.

Most command executions usually do not have preceding environment variable definition. For the above example, you can alternatively execute as the following.

$ LANG=fr_FR.UTF-8
$ date -u
mer. 19 mai 2021 15:19:24 UTC
[Tip] Tip

When filing a bug report, running and checking the command under "en_US.UTF-8" locale is a good idea if you use non-English environment.

For fine details of the locale configuration, see Bagian 8.1, “The locale”.

Let's try to remember following shell command idioms typed in one line as a part of shell command.


The Debian system is a multi-tasking system. Background jobs allow users to run multiple programs in a single shell. The management of the background process involves the shell builtins: jobs, fg, bg, and kill. Please read sections of bash(1) under "SIGNALS", and "JOB CONTROL", and builtins(1).

Misalnya, coba yang berikut ini

$ </etc/motd pager
$ pager </etc/motd
$ pager /etc/motd
$ cat /etc/motd | pager

Although all 4 examples of shell redirections display the same thing, the last example runs an extra cat command and wastes resources with no reason.

The shell allows you to open files using the exec builtin with an arbitrary file descriptor.

$ echo Hello >foo
$ exec 3foo 4bar  # open files
$ cat <&3 >&4       # redirect stdin to 3, stdout to 4
$ exec 3<&- 4>&-    # close files
$ cat bar
Hello

The file descriptor 0-2 are predefined.


In Unix-like work environment, text processing is done by piping text through chains of standard text processing tools. This was another crucial Unix innovation.

There are few standard text processing tools which are used very often on the Unix-like system.

If you are not sure what exactly these commands do, please use "man command" to figure it out by yourself.

[Catatan] Catatan

Sort order and range expression are locale dependent. If you wish to obtain traditional behavior for a command, use C locale or C.UTF-8 locale instead of normal UTF-8 ones (see Bagian 8.1, “The locale”).

[Catatan] Catatan

Perl regular expressions (perlre(1)), Perl Compatible Regular Expressions (PCRE), and Python regular expressions offered by the re module have many common extensions to the normal ERE.

Regular expressions are used in many text processing tools. They are analogous to the shell globs, but they are more complicated and powerful.

The regular expression describes the matching pattern and is made up of text characters and metacharacters.

A metacharacter is just a character with a special meaning. There are 2 major styles, BRE and ERE, depending on the text tools as described above.


The regular expression of emacs is basically BRE but has been extended to treat "+"and "?" as the metacharacters as in ERE. Thus, there are no needs to escape them with "\" in the regular expression of emacs.

grep(1) can be used to perform the text search using the regular expression.

Misalnya, coba yang berikut ini

$ egrep 'GNU.*LICENSE|Yoyodyne' /usr/share/common-licenses/GPL
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Yoyodyne, Inc., hereby disclaims all copyright interest in the program

Let's consider a text file called "DPL" in which some pre-2004 Debian project leader's names and their initiation date are listed in a space-separated format.

Ian     Murdock   August  1993
Bruce   Perens    April   1996
Ian     Jackson   January 1998
Wichert Akkerman  January 1999
Ben     Collins   April   2001
Bdale   Garbee    April   2002
Martin  Michlmayr March   2003

Awk is frequently used to extract data from these types of files.

Misalnya, coba yang berikut ini

$ awk '{ print $3 }' <DPL                   # month started
August
April
January
January
April
April
March
$ awk '($1=="Ian") { print }' <DPL          # DPL called Ian
Ian     Murdock   August  1993
Ian     Jackson   January 1998
$ awk '($2=="Perens") { print $3,$4 }' <DPL # When Perens started
April 1996

Shells such as Bash can be also used to parse this kind of file.

Misalnya, coba yang berikut ini

$ while read first last month year; do
    echo $month
  done <DPL
... same output as the first Awk example

Here, the read builtin command uses characters in "$IFS" (internal field separators) to split lines into words.

If you change "$IFS" to ":", you can parse "/etc/passwd" with shell nicely.

$ oldIFS="$IFS"   # save old value
$ IFS=':'
$ while read user password uid gid rest_of_line; do
    if [ "$user" = "bozo" ]; then
      echo "$user's ID is $uid"
    fi
  done < /etc/passwd
bozo's ID is 1000
$ IFS="$oldIFS"   # restore old value

(If Awk is used to do the equivalent, use "FS=':'" to set the field separator.)

IFS is also used by the shell to split results of parameter expansion, command substitution, and arithmetic expansion. These do not occur within double or single quoted words. The default value of IFS is space, tab, and newline combined.

Be careful about using this shell IFS tricks. Strange things may happen, when shell interprets some parts of the script as its input.

$ IFS=":,"                        # use ":" and "," as IFS
$ echo IFS=$IFS,   IFS="$IFS"     # echo is a Bash builtin
IFS=  , IFS=:,
$ date -R                         # just a command output
Sat, 23 Aug 2003 08:30:15 +0200
$ echo $(date -R)                 # sub shell --> input to main shell
Sat  23 Aug 2003 08 30 36 +0200
$ unset IFS                       # reset IFS to the default
$ echo $(date -R)
Sat, 23 Aug 2003 08:30:50 +0200

The following scripts do nice things as a part of a pipe.


A one-line shell script can loop over many files using find(1) and xargs(1) to perform quite complicated tasks. See Bagian 10.1.5, “Idioms for the selection of files” and Bagian 9.4.9, “Repeating a command looping over files”.

When using the shell interactive mode becomes too complicated, please consider to write a shell script (see Bagian 12.1, “The shell script”).



[1] Even the older vim can starts in the sane "nocompatible" mode by starting it with the "-N" option.