From 262eac5ed0919670cc8a37d418cbb8a8aa7c3c5e Mon Sep 17 00:00:00 2001 From: Ahmad Zafrullah Date: Wed, 14 Sep 2016 17:52:11 +0700 Subject: [PATCH 01/25] add ID translation --- README-id.md | 572 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 572 insertions(+) create mode 100644 README-id.md diff --git a/README-id.md b/README-id.md new file mode 100644 index 0000000..6af36fb --- /dev/null +++ b/README-id.md @@ -0,0 +1,572 @@ +🌍 +*[Čeština](README-cs.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* + + +# Seni dalam Baris Perintah + +[![Bergabung dengan obrolan di https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +- [Meta](#meta) +- [Dasar-dasar](#dasar-dasar) +- [Penggunaan sehari-hari](#penggunaan-sehari-hari) +- [Mengolah berkas dan data](#mengolah-berkas-dan-data) +- [Analisa Sistem](#analisa-sistem) +- [Perintah satu baris](#perintah-satu-baris) +- [Tidak penting tapi bermanfaat](#tidak-penting-tapi-bermanfaat) +- [Khusus OS X](#khusus-os-x) +- [Khusus Windows](#khusus-windows) +- [Bacaan lebih lanjut](#bacaan-lebih-lanjut) +- [Penyangkalan](#penyangkalan) + + +![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](cowsay.png) + +Mahir dalam baris perintah merupakan keahlian yang sering diabaikan atau masih dianggap misteri, tapi hal tersebut dapat meningkatkan fleksibilitas dan produktivitas sebagai seorang teknisi secara jelas. Halaman ini merupakan kumpulan catatan dan tips dalam menggunakan baris perintah sebagaimana yang kita ketahui sangat berguna ketika bekerja pada sistem Linux. Beberapa merupakan tips dasar, dan beberapa cukup spesifik, terkini, atau yang jarang digunakan. Halaman ini tidak panjang, tetapi jika anda dapat menggunakan dan mengingat semua perintah yang ada pada halaman ini, berarti anda memiliki pengetahuan yang cukup luas. + +Proyek ini merupakan hasil dari banyak [penulis dan penerjemah](AUTHORS.md). +Beberapa diantaranya [pertama kali](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands) +[muncul](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) +di [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), +namun kemudian dialihkan ke GitHub, dimana banyak orang-orang yang lebih berbakat dari penulis awal telah membuat banyak penyempurnaan. +[**Silakan berkontribusi**](/CONTRIBUTING.md) jika anda melihat ada kesalahan atau memiliki suatu ide yang lebih baik. + +## Meta + +Batasan masalah: + +- Panduan ini ditujukan bagi pemula dan yang telah berpengalaman. Tujuan utamanya cukup *luas* (segala hal adalah penting), *spesifik* (memberikan contoh kongkrit dari kasus yang umum terjadi), dan *ringkas* (hindari hal yang tidak penting atau menyimpang yang dapat ditemukan). Setiap tip adalah penting dalam beberapa kondisi atau dapat menjadi pilihan alternatif. +- Ditulis untuk Linux, dengan pengecualian dari bagian "[Khusus OS X](#os-x-only)" and "[Khusus Windows](#windows-only)". Banyak yang menggunakan atau memasangnya dalam varian UNIX atau OS X lainnya (bahkan menggunakan Cygwin). +- Berfokus pada Bash interaktif, meskipun banyak tip yang dapat digunakan pada terminal lainnya dan skrip Bash secara umum. +- Mengandung perintah UNIX "standar" sebagaimana yang telah diketahui bahwa membutuhkan instalasi paket spesial -- selama dirasa cukup penting untuk diikut sertakan. + +Catatan: + +- Untuk menjaga tetap memungkinkan dalam satu halaman, materi tidak disertakan dengan referensi secara langsung. Anda cukup paham untuk mengetahui lebih detil mengenai penjelasan setiap perintah, misalnya menggunakan Google. Gunakan `apt-get`, `yum`, `dnf`, `pacman`, `pip` atau `brew` (seperlunya) untuk memasang program baru. +- Gunakan [Explainshell](http://explainshell.com/) untuk bantuan mengenai perintah, opsi, saluran, dan lain sebagainya. + + +## Dasar-dasar + +- Pelajari dasar Bash. Sebenarnya dengan mengetikkan `man bash` anda bisa mengetahui semuanya; sangat mudah untuk dilakukan dan cukup singkat. Sebagai alternatif terminal dapat menjadi menyenangkan, tapi Bash lebih baik dan selalu tersedia (hanya mempelajari *only* zsh, fish, etc., ketika menggunakan laptop pribadi anda, membatasi anda dalam banyak situasi, seperti menggunakan server yang sudah ada). + +- Pelajari setidaknya satu pengolah teks dengan baik. Secara ideal Vim (`vi`), yang mana merupakan pengolah teks berbasis terminal terbaik saat ini (meskipun anda menggunakan Emacs, sebuah IDE yang besar, atau pengolah teks modern yang unik sepanjang masa). + +- Ketahui cara membaca dokumentasi dengan `man` (sebagai informasi tambahan, `man man` menampilkan daftar bagian dalam bentuk nomor, misalnya 1 adalah perintah-perintah "reguler", 5 adalah berkas-berkas atau aturan-aturan, dan 8 adalah untuk administrasi). Temukan halaman `man` dengan `apropos`. Ketahui bahwa beberapa perintah tidak dapat dijalankan secara langsung, kecuali bawaan dari Bash, dan anda dapat mencari bantuan mengenai hal tersebut dengan `help` dan `help -d`. Anda dapat mencari tahu apakah suatu perintah dapat dijalankan langsung, perintah bawaan atau sebuah alias dapat diketahui dengan `type perintah`. + +- Pelajari tentang pengalihan hasil keluaran dan masukan menggunakan `>` dan `<` dan saluran menggunakan `|`. Ketahui bahwa `>` menimpa hasil keluaran dari sebuah berkas sedangkan `>>` menambahkan keluaran dibagian akhir dari berkas. Pelajari tentang `stdout` dan `stderr`. + +- Pelajari tentang penyebaran berkas dengan `*` (dan mungkin `?` dan `[`...`]`) dan tanda petik dan perbedaan antara petik dua `"` dan petik sati `'`. (Penjelasan lebih lanjut pada penyebaran variabel dibawah.) + +- Biasakan diri dengan pengelolaan tugas pada Bash: `&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`, dan lain sebagainya. + +- Ketahui tentang `ssh`, dan dasar autentikasi tanpa kata kunci, melalui `ssh-agent`, `ssh-add`, dan lain sebagainya. + +- Dasar pengelolaan berkas: `ls` dan `ls -l` (pelajari juga maksud setiap kolom pada `ls -l`), `less`, `head`, `tail` dan `tail -f` (atau yang lebih baik, `less +F`), `ln` dan `ln -s` (pelajari perbedaan dan keuntungan menggunakan hard dan soft link), `chown`, `chmod`, `du` (untuk penjelasan singkat penggunaan disk: `du -hs *`). Untuk pengelolaan berkas sistem, `df`, `mount`, `fdisk`, `mkfs`, `lsblk`. Pelajari apa itu inode (`ls -i` atau `df -i`). + +- Dasar pengelolaan jaringan: `ip` atau `ifconfig`, `dig`. + +- Pelejari dan gunakan sistem pengelolaan kontrol versi, seperti `git`. + +- Ketahui regular expression (regex) dengan baik, dan beberapa flags untuk `grep`/`egrep`. Flag `-i`, `-o`, `-v`, `-A`, `-B`, dan `-C` bermanfaat untuk dipelajari. + +- Pelajari cara menggunakan `apt-get`, `yum`, `dnf` atau `pacman` (tergantung distro yang digunakan) untuk melakukan instalasi paket. Dan pastikan anda mempunyai `pip` untuk menginstall alat baris perintah berbasis Python (dibawah ini beberapa lebih mudah diinstall menggunakan `pip`). + + +## Penggunaan sehari-hari + +- Dalam Bash, gunakan **Tab** untuk melengkapi secara otomatis suatu perintah atau daftar perintah yang tersedia dan **ctrl-r** untuk mencari riwayat perintah (setelah ditekan, ketikan kata kunci yang ingin dicari, tekan **ctrl-r** untuk berpindah antara perintah-perintah yang sesuai, tekan **Enter** untuk menjalankan perintah, atau menekan tanda panah kanan di keyboard). + +- Dalam Bash, gunakan **ctrl-w** untuk untuk menghapus kata terakhir, dan **ctrl-u** untuk menghapus semua kata mulai dari baris pertama. Gunakan **alt-b** dan **alt-f** untuk memindahkan kata, **ctrl-a** untuk memindahkan kursor kebaris paling depan, **ctrl-e** untuk memindahkan kursor kebaris paling akhir, **ctrl-k** untuk menghentikan bagian akhir dari baris, **ctrl-l** untuk membersihkan layar tampilan. Lihat `man readline` untuk menampilkan semua kombinasi tombol yang ada dalam Bash. Ada cukup bnyak kombinasi. Contohnya **alt-.** berpindah melalui perintah sebelumnya, dan **alt-*** melebarkan glob. + +- Sebagai alternatif, jika anda lebih sendang menggunakan gaya kombinasi `vi`, gunakan `set -o vi` (dan `set -o emacs` untuk mengembalikan kepengaturan awal). + +- Untuk mengelola perintah yang panjang, setelah melakukan pengaturan pengolah teks (sebagai contoh `export EDITOR=vim`), menekan kombinasi **ctrl-x** **ctrl-e** akan membuka perintah saat ini pada pengolah teks untuk melakukan pengelolaah secara langsung. Atau dalam gaya `vi`, **escape-v**. + +- Untuk melihat perintah terakhir yang digunakan, `history`. Tambahkan `!n` dibagian akhir (dimana `n` merupakan jumlah perintah) untuk dijalankan kembali. Terdapat beberapa penyingkatan yang dapat digunakan, diantaranya yang paling sering digunakan `!$` untuk parameter terakhir dan `!!` untuk perintah terakhir (baca "HISTORY EXPANSION" pada halaman manual `man`). Bagaimanapun, sering digantikan dengan kombinasi **ctrl-r** dan **alt-.**. + +- Pindah ke direktori home dengan `cd`. Akses berkas yang berada dibawah direktori home dengan awalan `~` (misalnya `~/.bashrc`). Dalam skrip `sh` direktori home dinyatakan dalam `$HOME`. + +- Untuk kembali ke direktori sebelumnya: `cd -`. + +- Jika dalam menulis perintah anda berubah fikiran, tekan **alt-#** untuk menambahkan `#` pada awal perintah untuk menjadikannya sebuah komentar (atau **ctrl-a**, **#**, **enter**). Selanjutnya anda dapat mengakses perintah tersebuh dikemudian dengan menggunakan `history`. + +- Gunakan `xargs` (atau `parallel`). Sangat bagus. Anda dapat mengontrol berapa banyak item yang dapat dijalankan per-baris (`-L`) atau menjalankannya secara bersamaan (`-P`). Jika anda tidak yakin hal tersebut akan berjalan dengan baik, gunakan `xargs echo` terlebih dahulu. Atau `I{}` juga sangat bermanfaat. Contohnya: +```bash + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- `pstree -p` dapat membantu menampilkan daftar proses yang sedang berjalan. + +- Gunakan `pgrep` dan `pkill` untuk mencari proses sinyal berdasarkan nama (`-f` juga cukup membantu). + +- Pelajari jenis sinyal yang dapat dikirimkan ke proses. Contoh, untuk menunda sebuah proses, gunakan `kill -STOP [pid]`. Untuk daftar semua sinyal, lihat `man 7 signal`. + +- Gunakan `nohup` atau `disown` untuk membuat proses tetap berjalan selamanya. + +- Lihat kemana sebuah proses terhubung (listening) melalui `netstat -lntp` atau `ss -plat` (untuk TCP, gunakan `-u` untuk UDP). + +- Lihat juga `lsoft` untuk membuka socket dan berkas. + +- Lihat `uptime` atau `w` untuk mengetahui berapa sistem sudah berjalan (aktif). + +- Gunakan `alias` untuk membuat jalan pintas untuk perintah-perintah yang sering digunakan. Misalnya, `alias ll='ls -latr'` akan menghasilkan alias `ll`. + +- Menyimpan alias, pengaturan shell, dan fungsi yang sering digunakan di `~/.bashrc`, dan [atur shell untuk dibaca ketika login](http://superuser.com/a/183980/7106). Hal tersebut akan membuat pengaturan dapat berjalan disemua sesi. + +- Letakkan pengaturan dari variabel sebagai perintah yang akan dijalankan ketika login di `~/.bash_profile`. Pisahkan konfigurasi yang dibutuhkan untuk menjalankan grafik login dan tugas-tugas `cron`. + +- Singkronkan berkas konfigurasi (seperti `.bashrc` dan `.bash_profile`) pada banyak komputer dengan Git. + +- Pahami bahwa dibutuhkan perhatian lebih ketika variabel dan nama berkas mengandung spasi. Batasi variabel Bash dengan tanda petik, misalnya `"$FOO"`. Sebaiknya gunakan opsi `-0` atau `-print0` untuk membuat karakter null dalam membatasi nama berkas, misalnya `locate -0 pattern | xargs -0 ls -al` atau `find / -print0 -type d | xargs -0 ls -al`. Untuk membuat perulangan nama berkas yang mengandung spasi dalam `for`, atur IFS sebagai baris baru dengan `IFS=$'\n'` . + +- Dalam skrip Bash, gunakan `set -x` (atau lainnya `set -v`, yang mana akan menamilkan raw masukan dalam log, termasuk variabel dan komentar) untuk keperluan debugging. Gunakan mode `strict` kecuali ada alasan lebih baik untuk tidak menggunakan `set -e` untuk membatalkan perintah ketika terjadi kesalahan (kode exit tidak 0). Gunakan `set -u` untuk mendeteksi variabel yang belum ditentukan tapi sudah digunakan. Pertimbangkan `set -o pipefail` juga, untuk kesalahan didalam saluran. Untuk skrip terkait, gunakan `trap` pada EXIT atau ERR. Disarankan untuk memulai dari skrip berikut, dimana akan mendeteksi dan membatalkan perintah ketika terjadi kesalahan tertentu kemudian menampilkannya dalam pesan: +```bash + set -euo pipefail + trap "echo 'Kesalahan: Skrip gagal: harap periksa kembali perintah yang anda masukkan'" ERR +``` + +- Dalam skrip Bash, bagian dalam shell (ditulis didalam tanda kurung) merupakan cara terbaik untuk menggabungkan perintah. Sebuah contoh yang sering digunakan adalah berpindah ke direktori kerja yang lain, contohnya: +```bash + # melakukan sesuatu dalam direktori kerja saat ini + (cd /direktori/kerja/lainnya && suatu-perintah) + # melanjutkan pekerjaan dalam direktori yang sebenarnya +``` + +- Dalam Bash, ada banyak jenis dari pengembangan variabel. Memeriksa ketersediaan variabel: `$(nama_variabel:?pesan kesalahan)`. Sebagai contoh, jika skrip membutuhkan sebuah parameter, cukup menulis `berkas_masukan=$(1:?penggunaan: $0 berkas_masukan)`. Contoh dalam aritmatika: `i=$(( (i + 1) % 5 ))`. Urutan: `{1..10}`. Pemangkasan string: `${var%akhiran}` dan `${var#awalan}`. Sebagai contoh jika `var=foo.pdf`, maka `echo ${var%.pdf}.txt` akan menghasilkan `foo.txt`. + +- Kurung kurawal `{`...`}` dapat mengurangi kesalahan dama mengetik teks yang sama dan membuat kombinasi dari banyak item secara otomatis. Ini sangat membantu misalnya dalam perintah `mv foo.{txt,pdf} suatu-direktori` (memindahkan kedua berkas sekaligus), `cp suatuberkas{,.bak}` (memiliki makna sama dengan `cp suatuberkas suatuberkas.bak`) atau `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (memiliki makna membuat semua kemungkinan kombinasi untuk struktur direktori). + +- Keluaran dari perintah dapat diperlakukan sebagai sebuah berkas dengan `<(suatu perintah)`. Misalnya, membandingkan `/etc/hosts` yang ada pada lokal dengan server: +```sh + diff /etc/hosts <(ssh suatuserver cat /etc/hosts) +``` + +- Ketahui tentang "here documents" dalam Bash dengan `cat < berkaslog 2>&1` atau `suatu-perintah &>berkaslog`. Biasanya, untuk memastikan suatu perintah tidak meninggalkan berkas tetap terbuka setelah menerima masukan, coba pada terminal anda saat ini, merupakan hal baik untuk menambahkan `>> 2+3 +5 +``` + +## Mengolah berkas dan data + +- Untuk menemukan berkas berdasarkan nama dalam direktori saat ini, `find . -iname '*sesuatu*'` (atau yang mirip). Untuk mencari berkas dibanyak tempat berdasarkan nama, gunakan `locate sesuatu` (tapi ingat `updatedb` mungkin belum menyimpan berkas terbaru yang dibuat). + +- Untuk pencarian umum berdasarkan isi berkas (lebih dalam dibandingkan dengan `grep -r`), gunakan [`ag`](https://github.com/ggreer/the_silver_searcher). + +- Untuk mengkonversi HTML menjadi teks: `lynx -dump -stdin` + +- Untuk Markdown, HTML, dan semua jenis konversi dokumen, coba [`pandoc`](http://pandoc.org/). + +- Jika anda mengelola XML, `xmlstarlet` adalah pilihan yang paling tua namun terbaik. + +- Untuk JSON, gunakan [`jq`](http://stedolan.github.io/jq/). + +- Untuk YAML, gunakan [`shyaml`](https://github.com/0k/shyaml). + +- Untuk Excel atau berkas CSV, [csvkit](https://github.com/onyxfish/csvkit) menyediakan `in2csv`, `csvcut`, `csvjoin`, `csvgrep`, dan lain sebagainya. + +- Untuk Amazon S3, [`s3cmd`](https://github.com/s3tools/s3cmd) lebih nyaman digunakan dan [`s4cmd`](https://github.com/bloomreach/s4cmd) lebih cepat. Amazon [`aws`](https://github.com/aws/aws-cli) dan yang telah dikembangkan [`saws`](https://github.com/donnemartin/saws) tetap penting untuk pekerjaan yang berhubungan dengan AWS lainnya. + +- Ketahui tentang `sort` dan `uniq`, termasuk opsi `-u` dan `-d` -- lihat Perintah satu baris dibawah. Lihat juga `comm`. + +- Ketahui tentang `cut`, `paste`, dan `join` dalam memanipulasi teks pada berkas. Banyak orang menggunakan `cut` tapi melupakan tentang `join`. + +- Ketahui tentang `wc` untuk menghitung jumlah baris (`-l`), karakter (`-m`), kata (`-w`) dan byte (`-c`). + +- Ketahui tentang `tee` untuk menyalin dari stdin sebuah berkas ke stdout, seperti dalam `ls -al | tee file.txt`. + +- Untuk kalkulasi yang cukup kompleks, termasuk pengelompokan, konversi nilai, dan statistik, pertimbangkan untuk menggunakan [`datamash`](https://www.gnu.org/software/datamash/). + +- Ketahui bahwa locale cukup berdampak pada banyak perintah, termasuk pengurutan (pemeriksaan) dan dan kinerja. Kebanyakan distribusi Linux akan menggunakan `LANG` atau variabel locale lainnya untuk melakukan pengaturan bahasa seperti ID Indonesia. Tapi waspada karena pengurutan akan berubah jika locale juga telah dirubah. Dan ketahui aktifitas i18n dapat membuat banyak perintah *seringkali* menjadi lambat. Dalam kondisi tertentu (seperti beberapa perintah operasi dibawah) anda dapat menghindari i18n dan menggunakan pengurutan tradisional, gunakan `export LC_ALL=C`. + +- Anda dapat menentukan perintah tertentu dengan memberikan awalan saat pemanggilan dengan variabel pengaturan, seperti `TZ=Pacific/Fiji date`. + +- Ketahui mengenai dasar `awk` dan `sed` untuk manipulasi data. Sebagai contoh, menjumlahkan semua nomor yang ada pada kolom ketiga dari sebuah berkas: `awk '{ x += $3 } END { print x }'`. Ini memungkinkan komputasi 3x lebih cepat dan 3x lebih singkat dibandingkan dengan persamaan Python. + +- Untuk mengganti semua string yang cocok, dalam satu atau lebih dari satu berkas: +```sh + perl -pi.bak -e 's/string-lama/string-baru/g' my-files-*.txt +``` + +- Untuk mengganti nama banyak berkas atau mencari dan/atau mengganti dalam berkas, coba [`repren`](https://github.com/jlevy/repren). (Dalam beberapa kasus perintah `rename` memungkinkan untuk mengganti banyak nama sekaligus, namun perlu berhati-hati karena fungsionalitas mungkin tidak akan sama pada distribusi Linux lainnya.) +```sh + # Mengganti nama berkas, direktori, dan isi berkas secara penuh dari foo --> bar: + repren --full --preserve-case --from foo --to bar . + # Mengembalikan backup berkas whatever.bak -> whatever: + repren --renames --from '(.*)\.bak' --to '\1' *.bak + # Sama seperti diatas, menggunakan rename, jika ada yang cocok: + rename 's/\.bak$//' *.bak +``` + +- Sesuai dengan yang ada pada halaman manual, `rsync` adalah perintah untuk menyalin berkas yang cukup cepat dan memiliki banyak fitur. Mampu melakukan singkronisasi antar host yang mana sangat berguna untuk host lokal. Jika keamanan tidak diutamakan, gunakan `rsync` daripada `scp` untuk pemulihan tanpa harus mengulang dari awal. Perintah tersebut merupakan [cara tercepat](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) untuk menghapus banyak berkas sekaligus: +```sh +mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir +``` + +- Gunakan `shuf` untuk mengacak atau memilih baris secara acak dalam sebuah berkas. + +- Ketahui perintah `sort`. Untuk angka, funakan opsi `-n`, atau `-h` untuk menampilkan angka yang mudah dibaca manusia (contoh `du -h`). Ketahui bagaimana cara kerja kunci (`-t` dan `-k`). Terkadang membutuhkan `k1,1` untuk mengurutkan kolom pertama saja; `k1` berarti mengurutkan semua barus. Pengurutan yang stabil (`sort -s`) juga cukup berguna. FContoh, untuk mengurutkan yang pertama berdasarkan kolom 2, yang kedua berdasarkan kolom 1, akan menjadi `soft -k1,1 | sort -s -k2m2`. + +- Jika perlu untuk membuat tab pada terminal dalam Bash (misalnya argumen `-t` untuk mengurutkan), tekan **ctrl-v** **[Tab]** atau dengan menulis `$'\t'` (menulis langsung lebih baik dari copy/paste). + +- Alat yang umum digunakan untuk menambal sumber kode adalah `diff` dan `patch`. Lihat juga `diffstat` untuk hasil berupa statistik dari `diff` dan `sdiff`. Ingat bahwa `diff -r` berlaku pada semua direktori. Gunakan `diff -r tree1 tree2 | diffstat` untuk ringkasan perubahan. Gunakan `vimdiff` untuk membandingkan dan memperbarui berkas. + +- Untuk berkas binari, gunakan `hd`, `hexdump` atau `xxd` untuk menampilkan kode hex yang sederhana dan `bvi` atau `blew` untuk memperbarui berkas biner. + +- Alat lainnya untuk berkas biner, `strings` (dikombinasikan dengan `grep`, dan lainnya) memungkinkan pencarian teks berdasarkan bit-bit. + +- Untuk membandingkan berkas biner (kompresi delta), gunakan `xdelta3`. + +- Untuk mengkonversi sandi penulisan teks, coba `iconv`. Atau `uconv` untuk penggunaan lebih lanjut; telah mendukung hal yang berkaitan dengan Unicode. Sebagai contoh, perintah berikut membuat tulisan kecil dan menghapus semua aksen (dengan mengembangkan atau menghapusnya). +```sh + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt +``` +- Untuk memecah berkas menjadi beberapa bagian, lihat `split` (memisahkan berdasarkan ukuran) dan `csplit` (memisahkan berdasarkan pola). + +- Untuk memanipulasi tanggal dan waktu, gunakan `dateadd`, `datediff`, `strptime` etc. dari [`dateutils`](http://www.fresse.org/dateutils/). + +- Gunakan `zless`, `zmore`, `zcat`, dan `zgrep` untuk digunakan pada berkas yang terkompres. + +- Atribut dari sebuah berkas dapat diset melalui `chattr` dan disediakan alternatif untuk level terendah pada hak akses berkas. Sebagai contoh, untuk melindungi ketidak sengajaan pada penghapusan berkas gunakan flag kebal: `sudo chattr +i /direktori/berkas/penting` + +- Gunakan `getfacl` dan `setfacl` untuk menyimpan dan mengembalikan hak akses pada suatu berkas. Contohnya: +```sh + getfacl -R /suatu/path > hakakses.txt + setfacl --restore=hakakses.txt +``` + +## Analisa sistem + +- Untuk analisa web, `curl` dan `curl -I` cukup berguna, atau yang sama lainnya seperti `wget`, atau yang lebih modern [`httpie`](https://github.com/jkbrzt/httpie). + +- Untuk mengetahui status CPU/penyimpanan, perintah klasik `top` (lebih baik lagi `htop`), `iostat`, dan `iotop`. Gunakan `iostat -mxz 15` untuk melihat detil CPU tiap bagian (partition) penyimpanan dan pengetahuan tentang kinerja. + +- Untuk detail koneksi jaringan, gunakan `netstat` dan `ss`. + +- Untuk melihat sekilas yang terjadi pada sistem, `dstat` cukup berguna. Untuk detil secara menyeluruh, gunakan [`glances`](https://github.com/nicolargo/glances). + +- Untuk status memory, jalankan dan perhatikan keluaran dari `free` dan `vmstat`. Dalam kondisi tertentu, hati-hati terhadap "cached" yang dihasilkann oleh kernel Linux, jadi perhatikan sebaik mungkin keluaran dari `free`. + +- Analisa sistem Java sedikit berbeda, tapi ada trik sederhana untuk JVM dari Oracle dan yang lainnya yakni dapat dijalankan perintah `kill -3 ` dan penelusuran (full stack trace) dan beberapa ringkasan utama (termasuk informasi pembangkitan sampah sistem, informasi yang sangat berguna) akan dikeluarkan melalui stderr/logs. JDK seperti `jps`, `jstat`, jstack`, `jmap` cukup berguna. [Perlengkapan SJK](https://github.com/aragozin/jvm-tools) untuk penggunaan lebih lanjut. + +- Gunakan `mtr` sebagai pilihan terbaik `traceroute`, untuk menelusuri masalah jaringan. + +- Untuk mengungkapkan kenapa penyimpanan penuh, perintah `ncdu` lebih menghemat waktu dibangdingkan `du -sh *`. + +- Untuk mencari socket atau process yang sedang menggunakan bandwidth, coba `iftop` atau `nethogs`. + +- Perintah `ab` (paket dari Apache) sangat berguna untuk melihat kinerja dari server web. Untuk test lebih lanjut, gunakan `siege`. + +- Untuk analisa jaringan yang lebih serius, `wireshark`, `tshark`, atau `ngrep`. + +- Ketahui tentang `strace` dan `ltrace`. Perintah tersebut membantu ketika sebuah program gagal, hang, atau crash secara tiba-tiba, atau jika ingin mengetahui kinerja aplikasi secara umum. Catatan gunakan opsi profiling (`-c`), dan kemampuan untuk menertakan proses yang sedang berjalan (`-p`). + +- Ketahui tentang `ldd` untuk memeriksa pustaka berbagi dan sebagainya. + +- Ketahui bagaimana cara terhubung dengan proses yang sedang berjalan dengan `gdb` dan periksa alur stack-nya. + +- Gunakan `/proc` untuk melakukan analisis permasalahan secara live. Contohnya: `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps` (dimana `xxx` adalah ID proses id atau pid). + +- Untuk mengetahui kesalahan yang terjadi pada proses analisa sebelumnya, gunakan `sar`. Perintah tersebut dapat menampilkan riwayat statistik pada CPU, memory, jaringan, dan lain sebagainya. + +- Untuk analisa kinerja sistem lebih mendalam, periksa `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux)), dan [`sysdig`](https://github.com/draios/sysdig). + +- Periksa Sistem Operasi yang digunakan dengan `uname` atau `uname -a` (Unix/kernel pada umumnya) atau `lsb_release -a` (distro linux). + +- Gunakan `dmesg` ketika terjadi sesuatu yang tidak disangka (mungkin masalah perangkat kerasa atau driver). + +- Jika anda menghapus sebuah berkas dan tidak dapat meningkatkan kapasitas media penyimpanan sebagaimana hasil pengecekan `du`, periksa kemungkinan berkas tersebut sedang digunakan oleh suatu proses: +`lsof | grep deleted | grep "berkas-yang-sangat-besar"` + + +## Perintah satu baris + +Beberapa contoh untuk menggabungkan perintah sekaligus: + +- Terkadang cukup membantu ketika ingin mencari kesamaan, kesatuan, dan perbedaan dari beberapa berkas melalui `sort`/`uniq`. Misalkan `a` dan `b` adalah berkas yang berbeda. Perintah ini cukup cepat, dan dapat bekerja pada berkas dengan ukuran sampai gigabyte. (Pengurutan tidak dibatasi oleh memory, tapi diperlukan opsi `-T` jika `/tmp` berada dalam partisi root yang kecil.) Lihat juga catatan tentang `LC_ALL` diatas dan opsi yang terdapat pada `sort` (penjelasan lebih jelas dibawah berikut). +```sh + cat a b | sort | uniq > c # c berisi kesatuan antara a dan b + cat a b | sort | uniq -d > c # c berisi persamaan antara a dan b + cat a b b | sort | uniq -u > c # c berisi perbedaan antara a dan b +``` + +- Gunakan `grep . *` untuk menguji isi dari semua berkas dalam sebuah direktori (hasil tiap berisnya berkaitan dengan nama berkas), atau `head -180 *` (setiap berkas memiliki informasi kepala). Hal ini sangat bermanfaat untuk direktori yang berisi berkas konfigurasi seperti `/sys`, `/proc`, `/etc`. + +- Untuk menjumlahkan semua nomor pada kolom ketiga dari sebuah berkas (memungkinkan proses 3x lebih cepat dan skrip 3x lebih pendek dari Python): +```sh + awk '{ x += $3 } END { print x }' suatuberkas +``` + +- Untuk melihat ukuran atau tanggal berkas dalam bentuk struktur pohon, mirip dengan rekursif `ls -l` namun lebih mudah untuk dibaca dari `ls -lR`: +```sh + find . -type f -ls +``` + +- Ketika terdapat sebuah berkas teks seperti log web server, dan nilai tertentu muncul pada beberapa baris, misalnya parameter `acct_id` yang terdapat pada URL. Jika ingin mengetahui berapa banyak akses `acct_id`: +```sh + cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn +``` + +- Untuk memantau perubahan secara terus menerus, gunakan `watch`, misalnya perubahan berkas pada sebuah direktori, gunakan `watch -d -n 2 'ls -rtlh | tail` atau pada pengaturan jaringan wifi ketika melakukan perbaikan dengan `watch -d -n 2 ifconfig`. + +- Jalankan fungsi berikut untuk mendapatkan sesuatu yang acak dari dokumen ini (mengolah Markdown dan mengeluarkan sebuah item): +```sh + function taocl() { + curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | + pandoc -f markdown -t html | + xmlstarlet fo --html --dropdtd | + xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | + xmlstarlet unesc | fmt -80 + } +``` + +## Tidak penting tapi bermanfaat + +- `expr` : melakukan perhitungan aritmatika atau mengevaluasi regular expression (regex) + +- `m4` : pemroses macro yang sederhana + +- `yes` : menampilkan cukup banyak string + +- `cal` : menampilkan kalender + +- `env` : menjalankan sebuah perintah (berguna dalam skrip) + +- `printenv` : menampilkan variabel environment (berguna dalam analisa dan skrip) + +- `look` : mencari kata dalam bahasa English (atau baris dalam sebuah berkas) diawali dengan sebuah string + +- `cut`, `paste` dan `join`: manipulasi data + +- `fmt`: teks dengan format paragraf + +- `pr`: teks dengan format halaman/kolom + +- `fold`: membatasi baris dari teks + +- `column`: membuat format teks jadi rata, lebar kolom tertentu atau bentuk tabel + +- `expand` dan `unexpand`: konversi antara tab dan spasi + +- `nl`: menambahkan baris baru + +- `seq`: menampilkan angka + +- `bc`: kalkulator + +- `factor`: angka faktorial + +- [`gpg`](https://gnupg.org/): mengenkripsi dan menandatangani berkas + +- `toe`: isi dari tabel terminfo + +- `nc`: analisa jaringan dan aktifitas datanya + +- `socat`: jalur tunda dan penerus jalur tcp (mirip dengan `netcat`) + +- [`slurm`](https://github.com/mattthias/slurm): visualisasi aktifitas jaringan + +- `dd`: memindahkan data antar berkas atau perangkat + +- `file`: identifikasi jenis dari berkas + +- `tree`: menampilkan struktur pohon dari direktori dan subdirektori secara bersarang; mirip `ls` namun dapat rekursif + +- `stat`: informasi berkas + +- `time`: menjadwalkan dan menjalankan sebuah perintah + +- `timeout`: menjalankan sebuah perintah dalam waktu yang telah ditentukan dan melanjutkan kembali dalam waktu yang telah ditentukan pula. + +- `lockfile`: membuat berkas dengan tanda hanya dapat dihapus oleh `rm -f` + +- `logrotate`: menggulirkan, mengkompres serta mengirimkan via email berkas logs + +- `watch`: menjalankan program secara berulang, menampilkan hasil dan/atau memfokuskan pada perubahan + +- `tac`: menmapilkan kebalikan dari berkas + +- `shuf`: memilih baris secara acak dari sebuah berkas + +- `comm`: membandingkan berkas yang terurut berdasarkan baris + +- `pv`: memantau perkembangan data yang melalui sebuah saluran + +- `hd`, `hexdump`, `xxd`, `biew` dan `bvi`: menampilkan atau memperbaiki berkas dalam biner + +- `strings`: mengeluarkan teks dari berkas biner + +- `tr`: konversi atau menipulasi sebuah karakter + +- `iconv` atau `uconv`: konversi kode teks + +- `split` dan `csplit`: membagi berkas + +- `sponge`: membaca semua masukan sebelum menuliskannya, berguna untuk membaca dan menulis pada berkas yang sama, misalnya `grep -v sesuatu nama-berkas | sponge nama-berkas` + +- `units`: konversi dan kalkulasi unit; mengkonversi jarak mil per dua minggu (lihat juga `/usr/share/units/definitions.units`) + +- `apg`: membangkitkan kata kunci acak + +- `7z`: kompresi berkas dengan rasio yang tinggi + +- `ldd`: informasi dynamic library + +- `nm`: simbil dari objek berkas + +- `ab`: patokan untuk web server + +- `strace`: analisa sistem pemanggilan + +- `mtr`: traceroute yang lebih baik untuk analisa jaringan + +- `cssh`: visual shell dalam jumlah banyak secara bersamaan + +- `rsync`: singkronisasi berkas dan direktori melalui SSH atau berkas sistem dalam satu mesin + +- `wireshark` dan `tshark`: penangkap paket dan analisa jaringan + +- `ngrep`: grep untuk jaringan + +- `host` dan `dig`: pencarian DNS + +- `lsof`: deskripsi berkas process dan informasi socket + +- `dstat`: berguna untuk statistik sistem + +- [`glances`](https://github.com/nicolargo/glances): tingkat tinggi, informasi singkat banyak subsistem + +- `iostat`: statistik penggunaan penyimpanan + +- `mpstat`: statistik penggunaan CPU + +- `vmstat`: statistik penggunaan memory + +- `htop`: versi terbaru dari top + +- `last`: riwayat login + +- `w`: melihat siapa yang sedang login + +- `id`: informasi identitas pengguna atau grup + +- `sar`: riwayat statistik sistem + +- `iftop` or `nethogs`: penggunaan jaringan berdasarkan socket atau process + +- `ss`: statistik socket + +- `dmesg`: pesan ketika boot dan sistem error + +- `sysctl`: melihat dan mengkonfigurasi parameter kernel Linux saat sedang berjalan + +- `hdparm`: manipulasi atau melihat kinerja media SATA/ATA + +- `lsblk`: daftar blok perangkat: berbentuk struktur pohon yang berisi media penyimpanan beserta partisinya + +- `lshw`, `lscpu`, `lspci`, `lsusb`, `dmidecode`: informasi perangkat keras, termasuk CPU, BIOS, RAID, grafis, dan lain sebagainya. + +- `lsmod` and `modinfo`: menampilkan daftar dan detil modul kernel + +- `fortune`, `ddate`, dan `sl`: tergantung bagaimana anda menyebutnya "bermanfaat" + + +## Khusus OS X + +Berikut ini *hanya* berlaku pada OS X. + +- Manajemen paket menggunakan `brew` (homebrew) dan/atau `port` (MacPorts). Dapat digunakan untuk memasang banyak aplikasi OS X untuk menggunakan perintah-perintah diatas. + +- Salin keluaran dari perintah ke aplikasi desktop menggunakan `pbcopy` dan tempel menggunakan `pbpaste`. + +- Untuk mengaktifkan tombol Option pada aplikasi Terminal OS X sebagai tombol alt (seperti menggunakan perintah diatas **alt-b**, **alt-f**, dan lain sebagainya), buka Preferences -> Profiles -> Keyboard dan pilih "Use Option as Meta key". + +- Untuk membuka berkas pada aplikasi desktop, gunakan `open` atau `open -a /Applications/namaaplikasi.app`. + +- Spotlight: Mencari berkas dengan `mdfind` dan menampilkan metadata (seperti info EXIF foto) dengan `mdls`. + +- Berhati-hati karena OS X berbasis pada BSD Unix, dan banyak perintah (seperti `ps`, `ls`, `tail`, `awk`, `sed`) beberapa memiliki varian yang berbeda dengan Linux, yang mana akan berdampak besar pada System V-style Unix dan peralatan GNU lainnya. Perbedaannya dapat diketahui dengan mencari pada halaman manual "BSD General Command Manual". Pada beberapa kasus versi GNU dapat dipasang juga (seperti `gawk` dan `gsed` untuk GNU awk dan sed). Ketika menulis skrip Bash lintas platform, hundari beberapa perintah (seperti mempertimbangkan Python atau `perl`) atau coba kembali dengan hati-hati. + +- Untuk mendapatkan informasi rilis OS X, gunakan `sw_vers`. + +## Hanya Windows + +- Akses fasilitas dari Shell Unix pada Microsoft Windows dengan memasang [Cygwin](https://cygwin.com/). Banyak hal telah dijelaskan pada dokumen ini akan bekerja secara normal. + +- Pasang program Unix tambahan dengan paket manajer Cygwin. + +- Gunakan `mintty` sebagai aplikasi perintah baris. + +- Akses clipboard pada Windows pada `/dev/clipboard`. + +- Gunakan `cygstart` untuk membuka berkas melalui aplikasi yang telah terdaftar. + +- Akses registry pada Windows dengan `regtool`. + +- Ingat bahwa `C:\` Windows akan menjadi `/cygdrive/c` pada Cygwin, dan `/` pada Cygwin akan berada di `C:\cygwin` pada Windows. Konversi antara Cygwin dan gaya Windows file path dengan `cygpath`. Hal ini berguna dalam skrip yang menjalankan program Windows. + +- Anda dapat menjalankan skrip sistem administrasi pada Windows dari perintah baris dengan mempelajari dan menggunakan `wmic`. + +## Bacaan lebih lanjut + +- [awesome-shell](https://github.com/alebcay/awesome-shell): Daftar alat dan sumber Shell lainnya. +- [awesome-osx-command-line](https://github.com/herrbischoff/awesome-osx-command-line): Penjelasan lebih dalam perintah baris pada OS X. +- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) untuk menulis skrip Shell yang lebih baik. +- [shellcheck](https://github.com/koalaman/shellcheck): Analisis Shell skrip. Pada dasarnya, lint untuk bash/sh/zsh. +- [Filenames and Pathnames in Shell](http://www.dwheeler.com/essays/filenames-in-shell.html): Cara menangani nama berkas yang baik dan benar pada skrip Shell. +- [Data Science at the Command Line](http://datascienceatthecommandline.com/#tools): Perintah dan alat yang berguna untuk mengolah data sains, dari buku dengan nama yang sama. + +## Penyangkalan + +Dengan pengecualian dari tugas yang sangat kecil, kode ditulis sehingga orang lain dapat membacanya. Dengan kekuatan datang tanggung jawab. Bahkan Anda * dapat * melakukan sesuatu di Bash tidak berarti Anda harus! ;) +Dengan beberapa pengecualian, sebuah kode ditulis sehingga orang lain dapat membacanya. Dengan adanya kekuatan datang pula tanggung jawab. Faktanya anda *dapat* melakukan hal yang tidak seharusnya dalam Bash! ;) + + +## Lisensi + +[![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/) + +Hasil kerja ini memiliki lisensi dibatah [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). From c217bd3f4d8f86ee391426fcde1924f5de64cb6b Mon Sep 17 00:00:00 2001 From: Ahmad Zafrullah Date: Wed, 14 Sep 2016 18:35:51 +0700 Subject: [PATCH 02/25] ID: sync updates from README.md --- README-id.md | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/README-id.md b/README-id.md index 6af36fb..0182567 100644 --- a/README-id.md +++ b/README-id.md @@ -1,11 +1,14 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Seni dalam Baris Perintah +[![Ajukan pertanyaan](https://img.shields.io/badge/%3f-Ask%20a%20Question-ff69b4.svg)](https://airtable.com/shrzMhx00YiIVAWJg) + [![Bergabung dengan obrolan di https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + - [Meta](#meta) - [Dasar-dasar](#dasar-dasar) - [Penggunaan sehari-hari](#penggunaan-sehari-hari) @@ -28,7 +31,7 @@ Beberapa diantaranya [pertama kali](http://www.quora.com/What-are-some-lesser-kn [muncul](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) di [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), namun kemudian dialihkan ke GitHub, dimana banyak orang-orang yang lebih berbakat dari penulis awal telah membuat banyak penyempurnaan. -[**Silakan berkontribusi**](/CONTRIBUTING.md) jika anda melihat ada kesalahan atau memiliki suatu ide yang lebih baik. +[**Silakan ajukan pertanyaan**](https://airtable.com/shrzMhx00YiIVAWJg) jika anda memiliki pertanyaan seputar perintah baris. [**Silakan berkontribusi**](/CONTRIBUTING.md) jika anda melihat ada kesalahan atau memiliki suatu ide yang lebih baik! ## Meta @@ -142,6 +145,13 @@ Catatan: diff /etc/hosts <(ssh suatuserver cat /etc/hosts) ``` +- Ketika menulis skrip disarankan untuk membatasi semua kode dalam kurung kurawal. Jika penutuh kurung kurawal tidak ditemukan, skrip tidak dapat dijalankan karena terjadi kesalahan. Hal ini biasanya terjadi ketika mengunduh skrip dari web, kemungkinan beberapa bagian dari skrip yang telah diunduh sengaja ditulis untuk menghindari eksekusi: +```bash +{ + # Kode disini +} +``` + - Ketahui tentang "here documents" dalam Bash dengan `cat < berkaslog 2>&1` atau `suatu-perintah &>berkaslog`. Biasanya, untuk memastikan suatu perintah tidak meninggalkan berkas tetap terbuka setelah menerima masukan, coba pada terminal anda saat ini, merupakan hal baik untuk menambahkan `` dan penelusuran (full stack trace) dan beberapa ringkasan utama (termasuk informasi pembangkitan sampah sistem, informasi yang sangat berguna) akan dikeluarkan melalui stderr/logs. JDK seperti `jps`, `jstat`, jstack`, `jmap` cukup berguna. [Perlengkapan SJK](https://github.com/aragozin/jvm-tools) untuk penggunaan lebih lanjut. -- Gunakan `mtr` sebagai pilihan terbaik `traceroute`, untuk menelusuri masalah jaringan. +- Gunakan [`mtr`](http://www.bitwizard.nl/mtr/) sebagai pilihan terbaik `traceroute`, untuk menelusuri masalah jaringan. -- Untuk mengungkapkan kenapa penyimpanan penuh, perintah `ncdu` lebih menghemat waktu dibangdingkan `du -sh *`. +- Untuk mengungkapkan kenapa penyimpanan penuh, perintah [`ncdu`](https://dev.yorhel.nl/ncdu) lebih menghemat waktu dibangdingkan `du -sh *`. -- Untuk mencari socket atau process yang sedang menggunakan bandwidth, coba `iftop` atau `nethogs`. +- Untuk mencari socket atau process yang sedang menggunakan bandwidth, coba [`iftop`](http://www.ex-parrot.com/~pdw/iftop/) atau [`nethogs`](https://github.com/raboof/nethogs). - Perintah `ab` (paket dari Apache) sangat berguna untuk melihat kinerja dari server web. Untuk test lebih lanjut, gunakan `siege`. -- Untuk analisa jaringan yang lebih serius, `wireshark`, `tshark`, atau `ngrep`. +- Untuk analisa jaringan yang lebih serius, [`wireshark`](https://wireshark.org/), [`tshark`](https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html), atau [`ngrep`](http://ngrep.sourceforge.net/). - Ketahui tentang `strace` dan `ltrace`. Perintah tersebut membantu ketika sebuah program gagal, hang, atau crash secara tiba-tiba, atau jika ingin mengetahui kinerja aplikasi secara umum. Catatan gunakan opsi profiling (`-c`), dan kemampuan untuk menertakan proses yang sedang berjalan (`-p`). @@ -310,7 +322,7 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir - Gunakan `/proc` untuk melakukan analisis permasalahan secara live. Contohnya: `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps` (dimana `xxx` adalah ID proses id atau pid). -- Untuk mengetahui kesalahan yang terjadi pada proses analisa sebelumnya, gunakan `sar`. Perintah tersebut dapat menampilkan riwayat statistik pada CPU, memory, jaringan, dan lain sebagainya. +- Untuk mengetahui kesalahan yang terjadi pada proses analisa sebelumnya, gunakan [`sar`](http://sebastien.godard.pagesperso-orange.fr/). Perintah tersebut dapat menampilkan riwayat statistik pada CPU, memory, jaringan, dan lain sebagainya. - Untuk analisa kinerja sistem lebih mendalam, periksa `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux)), dan [`sysdig`](https://github.com/draios/sysdig). @@ -451,7 +463,7 @@ Beberapa contoh untuk menggabungkan perintah sekaligus: - `apg`: membangkitkan kata kunci acak -- `7z`: kompresi berkas dengan rasio yang tinggi +- `xz`: kompresi berkas dengan rasio yang tinggi - `ldd`: informasi dynamic library @@ -461,15 +473,15 @@ Beberapa contoh untuk menggabungkan perintah sekaligus: - `strace`: analisa sistem pemanggilan -- `mtr`: traceroute yang lebih baik untuk analisa jaringan +- [`mtr`](http://www.bitwizard.nl/mtr/): traceroute yang lebih baik untuk analisa jaringan - `cssh`: visual shell dalam jumlah banyak secara bersamaan - `rsync`: singkronisasi berkas dan direktori melalui SSH atau berkas sistem dalam satu mesin -- `wireshark` dan `tshark`: penangkap paket dan analisa jaringan +- [`wireshark`](https://wireshark.org/) dan [`tshark`](https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html): penangkap paket dan analisa jaringan -- `ngrep`: grep untuk jaringan +- [`ngrep`](http://ngrep.sourceforge.net/): grep untuk jaringan - `host` dan `dig`: pencarian DNS @@ -493,9 +505,9 @@ Beberapa contoh untuk menggabungkan perintah sekaligus: - `id`: informasi identitas pengguna atau grup -- `sar`: riwayat statistik sistem +- [`sar`](http://sebastien.godard.pagesperso-orange.fr/): riwayat statistik sistem -- `iftop` or `nethogs`: penggunaan jaringan berdasarkan socket atau process +- [`iftop`](http://www.ex-parrot.com/~pdw/iftop/) or [`nethogs`](https://github.com/raboof/nethogs): penggunaan jaringan berdasarkan socket atau process - `ss`: statistik socket @@ -534,6 +546,10 @@ Berikut ini *hanya* berlaku pada OS X. ## Hanya Windows +Berikut ini *hanya* berlaku pada Windows. + +- Pada Windows 10, anda dapat menggunakan [Bash di Ubuntu pada Windows](https://msdn.microsoft.com/commandline/wsl/about), dimana menyediakan lingkungan Bash yang mirip dengan perintah baris pada lingkungan Unix. Sebagai tambahan, memungkinkan program Linux untuk berjalan pada Windows. Namun disisi lain tidak memungkinkan untuk menjalankan aplikasi windows melalui jendela Bash. + - Akses fasilitas dari Shell Unix pada Microsoft Windows dengan memasang [Cygwin](https://cygwin.com/). Banyak hal telah dijelaskan pada dokumen ini akan bekerja secara normal. - Pasang program Unix tambahan dengan paket manajer Cygwin. @@ -550,6 +566,10 @@ Berikut ini *hanya* berlaku pada OS X. - Anda dapat menjalankan skrip sistem administrasi pada Windows dari perintah baris dengan mempelajari dan menggunakan `wmic`. +- Pilihan lainnya untuk membuat mendapatkan Unix pada Windows adalah [Cash](https://github.com/dthree/cash). Sebagai catatan bahwa hanya tersedia beberapa fasilitas perintah baris Unix yang tersedia dalam lingkungan ini. + +- Sebagai pilihan alternatif untuk mendapatkan alat pengembangan dalam GNU (seperti GCC) pada Windows adalah [MinGW](http://www.mingw.org/) dan paketnya [MSYS](http://www.mingw.org/wiki/msys), dimana menyediakan beberapa fasilitas seperti bash, gawk, make dan grep. MSYS tidak sepenuhnya memiliki semua fasilitas jika dibandingkan dengan Cygwin. Cygwin biasanya berguna untuk membuat port Windows dari Unix. + ## Bacaan lebih lanjut - [awesome-shell](https://github.com/alebcay/awesome-shell): Daftar alat dan sumber Shell lainnya. From 15078231034199f1587320d98b1ab294511c681a Mon Sep 17 00:00:00 2001 From: Ahmad Zafrullah Date: Wed, 14 Sep 2016 18:38:55 +0700 Subject: [PATCH 03/25] ID: update links to lang in README*.md --- README-cs.md | 2 +- README-de.md | 2 +- README-el.md | 2 +- README-es.md | 2 +- README-fr.md | 2 +- README-id.md | 1 - README-it.md | 2 +- README-ja.md | 2 +- README-ko.md | 2 +- README-pt.md | 2 +- README-ru.md | 2 +- README-sl.md | 2 +- README-uk.md | 2 +- README-zh-Hant.md | 2 +- README-zh.md | 2 +- README.md | 2 +- 16 files changed, 15 insertions(+), 16 deletions(-) diff --git a/README-cs.md b/README-cs.md index 33cfddf..c938186 100644 --- a/README-cs.md +++ b/README-cs.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Umění příkazové řádky diff --git a/README-de.md b/README-de.md index 6e3d9ba..b81abb1 100644 --- a/README-de.md +++ b/README-de.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line diff --git a/README-el.md b/README-el.md index e7b3861..e0ca1a9 100644 --- a/README-el.md +++ b/README-el.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Η Τέχνη της Γραμμής Εντολών diff --git a/README-es.md b/README-es.md index fbfd016..f0628c9 100644 --- a/README-es.md +++ b/README-es.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # El Arte del Terminal diff --git a/README-fr.md b/README-fr.md index 4e03ca5..bee268c 100644 --- a/README-fr.md +++ b/README-fr.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # L'art de la ligne de commande diff --git a/README-id.md b/README-id.md index 0182567..015b28f 100644 --- a/README-id.md +++ b/README-id.md @@ -1,7 +1,6 @@ 🌍 *[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* - # Seni dalam Baris Perintah [![Ajukan pertanyaan](https://img.shields.io/badge/%3f-Ask%20a%20Question-ff69b4.svg)](https://airtable.com/shrzMhx00YiIVAWJg) diff --git a/README-it.md b/README-it.md index 40b650f..daeed12 100644 --- a/README-it.md +++ b/README-it.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line (Traduzione Italiana) diff --git a/README-ja.md b/README-ja.md index dda5fd3..cedd94b 100644 --- a/README-ja.md +++ b/README-ja.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* 原文のコミット [ee4b00bc396087d27231f60512aeb77b19ce734e](https://github.com/jlevy/the-art-of-command-line/blob/ee4b00bc396087d27231f60512aeb77b19ce734e/README.md) diff --git a/README-ko.md b/README-ko.md index 992233a..3872748 100644 --- a/README-ko.md +++ b/README-ko.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line diff --git a/README-pt.md b/README-pt.md index 3df275e..d583810 100644 --- a/README-pt.md +++ b/README-pt.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # A arte da linha de comando diff --git a/README-ru.md b/README-ru.md index 91a9251..1029892 100644 --- a/README-ru.md +++ b/README-ru.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Искусство командной строки diff --git a/README-sl.md b/README-sl.md index 654578c..def321d 100644 --- a/README-sl.md +++ b/README-sl.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Umetnost ukazne vrstice diff --git a/README-uk.md b/README-uk.md index bf17d4c..61870a5 100644 --- a/README-uk.md +++ b/README-uk.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Мистецтво командного рядка diff --git a/README-zh-Hant.md b/README-zh-Hant.md index 16fa13a..f358941 100644 --- a/README-zh-Hant.md +++ b/README-zh-Hant.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # 命令列的藝術 diff --git a/README-zh.md b/README-zh.md index ebc4bdb..cee0555 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # 命令行的艺术 diff --git a/README.md b/README.md index 42f45d9..1f655cd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line From 42b1ac9da6b6078b5ae004de8e723b666da6bef9 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 3 Oct 2016 18:20:44 +0200 Subject: [PATCH 04/25] sl: Update translation --- README-sl.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/README-sl.md b/README-sl.md index 654578c..c936a50 100644 --- a/README-sl.md +++ b/README-sl.md @@ -4,8 +4,11 @@ # Umetnost ukazne vrstice +[![Vprašajte](https://img.shields.io/badge/%3f-Ask%20a%20Question-ff69b4.svg)](https://airtable.com/shrzMhx00YiIVAWJg) + [![Join the chat at https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + - [Meta](#meta) - [Osnove](#osnove) - [Vsakodnevna uporaba](#vsakodnevna-uporaba) @@ -29,7 +32,7 @@ se je [prvotno](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix- [pojavilo](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) na [Quori](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), vendar se je premaknilo na GitHub, kjer so ljudje bolj talentirani od prvotnega avtorja naredili številne izboljšave. -[**Prosimo, prispevajte**](/CONTRIBUTING.md), če vidite napako ali nekaj, kar bi lahko bilo boljše! +[**Vprašajte**](https://airtable.com/shrzMhx00YiIVAWJg), če imate vprašanje povezano z ukazno vrstico. [**Prosimo, prispevajte**](/CONTRIBUTING.md), če vidite napako ali nekaj, kar bi lahko bilo boljše! ## Meta @@ -98,7 +101,6 @@ Opombe: cat hosts | xargs -I{} ssh root@{} hostname ``` - - `pstree -p` je priročen prikaz drevesa procesov. - Uporabite `pgrep` in `pkill`, da najdete ali signalizirate procese po imenu (`-f` je v pomoč). @@ -136,7 +138,7 @@ Opombe: # continue in original dir ``` -- V Bash-u bodite pozorni, saj je veliko vrst razširjenih spremenljivk. Preverjanje, če spremenljivka obstaja: `${name:?error message}`. Na primer, če skripta Bash zahteva en argument, samo napišite `input_file=${1:?usage: $0 input_file}`. Aritmetična raširitev: `i=$(( (i + 1) % 5 ))`. Sekvence: `{1..10}`. Obrezovanje nizov: `${var%suffix}` in `${var#prefix}`. Na primer, če je `var=foo.pdf`, potem `echo ${var%.pdf}.txt` izpiše `foo.txt`. +- V Bash-u bodite pozorni, saj je veliko vrst razširjenih spremenljivk. Preverjanje, če spremenljivka obstaja: `${name:?error message}`. Na primer, če skripta Bash zahteva en argument, samo napišite `input_file=${1:?usage: $0 input_file}`. Uporaba privzete vrednosti, če je spremenljivka prazna: `${name:-default}`. Če želite, imeti dodatni (opcijski) parameter dodan k prejšnjemu primeru, lahko uporabite nekaj takega `output_file=${2:-logfile}`. Če je $2 izpuščen in tako prazen, bo `output_file` nastavljen na `logfile`. Aritmetična raširitev: `i=$(( (i + 1) % 5 ))`. Sekvence: `{1..10}`. Obrezovanje nizov: `${var%suffix}` in `${var#prefix}`. Na primer, če je `var=foo.pdf`, potem `echo ${var%.pdf}.txt` izpiše `foo.txt`. - Lupinska razširitev zavitih oklepajev z `{`...`}` lahko pomaga zmanjšati potrebo po ponovnem vpisovanju podobnega teksta in avtomatizira kombiniranje elementov. To je v pomoč v primerih kot je `mv foo.{txt,pdf} some-dir` (ki premakne obe datoteki), `cp somefile{,.bak}` (kar razširi v `cp somefile somefile.bak`) ali `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (kar razširi vse možne kombinacije in ustvari drevo direktorijev). @@ -145,6 +147,13 @@ Opombe: diff /etc/hosts <(ssh somehost cat /etc/hosts) ``` +- Ko pišete skripte, boste morda želeli dati vašo kodo v zavite oklepaje. Če zapirajoči se oklepaj manjka, se vaša skripta ne bo izvršila zaradi sintaktične napake. To je smiselno, ko se vašo skripto prenese iz spleta, saj preprečuje izvrševanje delno prenešene skripte: +```bash +{ + # Vaša koda +} +``` + - Spoznajte t.i. "here" dokumente v Bash-u, kot pri `cat <logfile 2>&1` ali `some-command &>logfile`. Pogosto zagotavlja, da ukaz ne pusti ročaja odprte datoteke za standardni vnos, kar ga veže na terminal v katerem se nahajate, je tudi dobra praksa, da dodate ` Date: Wed, 19 Oct 2016 21:57:47 +0800 Subject: [PATCH 05/25] Updates zh translation --- README-zh.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README-zh.md b/README-zh.md index ebc4bdb..7dc460b 100644 --- a/README-zh.md +++ b/README-zh.md @@ -137,7 +137,7 @@ # continue in original dir ``` -- 在 Bash 中,要注意其中有许多形式的扩展。检查变量是否存在:`${name:?error message}`。例如,当 Bash 脚本需要一个参数时,可以使用这样的代码 `input_file=${1:?usage: $0 input_file}`。数学表达式:`i=$(( (i + 1) % 5 ))`。序列:`{1..10}`。截断字符串:`${var%suffix}` 和 `${var#prefix}`。例如,假设 `var=foo.pdf`,那么 `echo ${var%.pdf}.txt` 将输出 `foo.txt`。 +- 在 Bash 中,要注意变量展开的形式有很多。检查变量是否存在:`${name:?error message}`。例如,当 Bash 脚本只需要一个参数时,可以使用这样的代码 `input_file=${1:?usage: $0 input_file}`。在变量为空时使用默认值:`${name:-default}`。如果你要在之前的例子中再加一个(可选的)参数,可以使用类似这样的代码 `output_file=${2:-logfile}`,如果省略了 $2,它的值就为空,于是 `output_file` 就会被设为 `logfile`。数学表达式:`i=$(( (i + 1) % 5 ))`。序列:`{1..10}`。截断字符串:`${var%suffix}` 和 `${var#prefix}`。例如,假设 `var=foo.pdf`,那么 `echo ${var%.pdf}.txt` 将输出 `foo.txt`。 - 使用括号扩展(`{`...`}`)来减少输入相似文本,并自动化文本组合。这在某些情况下会很有用,例如 `mv foo.{txt,pdf} some-dir`(同时移动两个文件),`cp somefile{,.bak}`(会被扩展成 `cp somefile somefile.bak`)或者 `mkdir -p test-{a,b,c}/subtest-{1,2,3}`(会被扩展成所有可能的组合,并创建一个目录树)。 @@ -146,6 +146,13 @@ diff /etc/hosts <(ssh somehost cat /etc/hosts) ``` +- 编写脚本时,你可能会想要把代码都放在大括号里。缺少关括号的话,代码就会因为语法错误而无法执行。如果你的脚本是要放在网上供人下载的,这样的写法就体现出它的好处了,因为没有完全下载的脚本无法执行: +```bash +{ + # 在这里写代码 +} +``` + - 了解 Bash 中的“here documents”,例如 `cat <logfile 2>&1`。通常,为了保证命令不会在标准输入里残留一个打开了的文件句柄导致你当前所在的终端无法操作,添加 ` Date: Mon, 24 Oct 2016 21:46:07 -0400 Subject: [PATCH 06/25] trivial fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42f45d9..9cd79cb 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Notes: - See also `lsof` for open sockets and files. -- See `uptime` or `w` to know the how long the system has been running. +- See `uptime` or `w` to know how long the system has been running. - Use `alias` to create shortcuts for commonly used commands. For example, `alias ll='ls -latr'` creates a new alias `ll`. @@ -193,7 +193,7 @@ Notes: - For running a command as another user, use `sudo`. Defaults to running as root; use `-u` to specify another user. Use `-i` to login as that user (you will be asked for _your_ password). -- For switching the shell to another user, use `su username` or `su - username`. Include the `-` to get an environment as if the user just logged in. Omitting the username defaults to root. You will be asked for the password _of the user you are switching to_. +- For switching the shell to another user, use `su username` or `su - username`. The latter with "-" gets an environment as if another user just logged in. Omitting the username defaults to root. You will be asked for the password _of the user you are switching to_. - Know about the [128K limit](https://wiki.debian.org/CommonErrorMessages/ArgumentListTooLong) on command lines. This "Argument list too long" error is common when wildcard matching large numbers of files. (When this happens alternatives like `find` and `xargs` may help.) From 340ba0fd057f01335311d844201767ff3c1041a8 Mon Sep 17 00:00:00 2001 From: Eric Guirbal Date: Tue, 25 Oct 2016 12:06:00 +0200 Subject: [PATCH 07/25] fr: Synchronize the translation --- README-fr.md | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/README-fr.md b/README-fr.md index 4e03ca5..108d4f0 100644 --- a/README-fr.md +++ b/README-fr.md @@ -3,7 +3,9 @@ # L'art de la ligne de commande -[![Join the chat at https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Ask a Question](https://img.shields.io/badge/%3f-Ask%20a%20Question-ff69b4.svg)](https://airtable.com/shrzMhx00YiIVAWJg) + +[![Join the chat at https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%19Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - [Méta](#méta) - [Notions de base](#notions-de-base) @@ -27,6 +29,7 @@ Cette page n'est pas bien longue, mais si vous pouvez retenir et vous servir de Ce document est le fruit du travail de [nombreux auteurs et traducteurs](AUTHORS.md). Une partie de celui-ci a été [initialement](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands) [publiée](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) sur [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), mais il se trouve maintenant sur GitHub, où des personnes plus compétentes que l'auteur originel ont apporté de nombreuses améliorations. +[**N'hésitez pas à poser des questions**](https://airtable.com/shrzMhx00YiIVAWJg) sur la ligne de commande. [**Merci de contribuer**](/CONTRIBUTING.md) si vous voyez une erreur ou quelque chose qui pourrait être amélioré ! @@ -179,10 +182,15 @@ Un exemple classique consiste à se déplacer temporairement dans un autre répe # continue dans le répertoire original ``` -- Remarquez qu'en Bash il y a de nombreux types d'expansion des variables. -Vérifier l'existence d'une variable : `${name:?error message}`. -Par exemple, si un script en Bash exige un unique argument, il vous suffit d'écrire `input_file=${1:?usage: $0 input_file}`. -L'expansion arithmétique : `i=$(( (i + 1) % 5 ))`. Suites : `{1..10}`. Suppression de sous-chaînes : `${var%suffix}` et `${var#prefix}`. Par exemple, si `var=foo.pdf`, alors `echo ${var%.pdf}.txt` affiche `foo.txt`. +- Notez qu'en Bash, il existe de nombreux types d'expansions de variables. Pour vérifier l'existence d'une variable : `${name:?error message}`. +Par exemple, si un script en Bash exige un unique argument, il suffit d'écrire `input_file=${1:?usage: $0 input_file}`. +Pour utiliser une valeur par défaut si une variable est vide : `$(name:-default}`. +Si vous souhaitez ajouter un paramètre supplémentaire facultatif dans l'exemple précédent, vous pouvez écrire quelque chose comme `output_file=${2:-logfile}`. +Si `$2` est omis et donc vide, `output_file` prendra la valeur `logfile`. +L'évaluation arithmétique : `i=$(( (i+1) % 5)`. +Les listes d'entiers : `{1..10}` +Suppression de préfixes et de suffixes : `${var%suffix}` et `${var#prefix}`. +Par exemple, si `var=foo.pdf`, alors `echo ${var%.pdf}.txt` affiche `foo.txt`. - L'expansion des accolades avec `{`...`}` évite de retaper des textes similaires et automatise les combinaisons d'éléments de listes. C'est utile dans des exemples comme `mv foo.{txt,pdf} some-dir` (qui déplace les deux fichiers), `cp somefile{,.bak}` (équivalent à `cp somefile somefile.bak`) ou `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (qui engendre toutes les combinaisons possibles et crée une arborescence de répertoires). @@ -193,6 +201,15 @@ Par exemple, pour comparer le fichier local `/etc/hosts` avec un fichier distant diff /etc/hosts <(ssh somehost cat /etc/hosts) ``` +- Lorsque vous écrivez des scripts, vous pourriez avoir envie de placer votre code entre accolades. +S'il manque l'accolade fermante, les scripts ne pourront s'exécuter à cause d'une erreur de syntaxe. +C'est particulièrement utile pour des scripts mis à disposition sur le web, afin de prévenir leur exécution lorsqu'ils sont partiellement téléchargés. +```bash +{ + # Votre code ici +} +``` + - Renseignez-vous à propos des « here documents » avec Bash, comme dans `cat < logfile 2>&1` ou `some-command &>logfile`. @@ -234,9 +251,14 @@ Une alternative plus légère pour la persistance des sessions seulement est [`d - Créez un simple serveur web pour partager les fichiers du répertoire courant (et ses sous-répertoires) avec `python -m SimpleHTTPServer 7777` (port 7777 et Python 2) et `python -m http.server 7777` (port 7777 et Python 3). -- Pour exécuter une commande avec des privilèges, utilisez `sudo` (en tant que root) ou `sudo -u` (en tant qu'un autre utilisateur). -Utilisez `su` ou `sudo bash` pour exécuter un shell sous cette utilisateur. -Utilisez `su -` pour simuler une nouvelle connexion en tant que root ou un autre utilisateur. +- Pour exécuter une commande avec les privilèges d'un autre utilisateur, utilisez `sudo`. +Par défaut, cet autre utilisateur est *root* ; utilisez `-u` pour spécifier un autre utilisateur. +Utilisez `-i` pour ouvrir une session en tant que cet autre utilisateur (on vous demandera *votre* mot de passe). + +- Pour basculer le shell sous un autre utilisateur, utilisez `su username` ou `su - username`. +Incluez `-` pour obtenir le même environnement que lorsque cet utilisateur se connecte. +Le nom d'utilisateur par défaut est *root*. +Le système vous demandera le mot de passe *de l'utilisateur cible*. - Sachez que l'argument de la ligne de commande a une [taille limite de 128 Kio](https://wiki.debian.org/CommonErrorMessages/ArgumentListTooLong). L'erreur « Argument list too long » est fréquente avec les jokers qui reconnaissent un grand nombre de fichiers (quand cela se produit des alternatives comme `find` et `xargs` peuvent aider). @@ -403,7 +425,7 @@ Remarquez l'option de profilage (`-c`) et la possibilité de les attacher à un Exemples : `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd`, `/proc/xxx/smaps` (où `xxx` est l'identifiant du processus ou pid). - Pour comprendre pourquoi quelque chose a mal tourné antérieurement, [`sar`](http://sebastien.godard.pagesperso-orange.fr/) peut-être très utile. -Elle fournit un historique concernant l'usage du CPU, de la mémoire, du réseau, etc. +Il fournit un historique concernant l'usage du CPU, de la mémoire, du réseau, etc. - Pour une analyse plus approfondie du système et de ses performances, regardez `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux) et [`sysdig`](https://github.com/draios/sysdig). @@ -550,7 +572,7 @@ Si vous voulez un décompte du nombre de requêtes pour chaque valeur de `acct_i - `apg` : génère des mots de passe aléatoires. -- `7z` : compresse des fichiers avec taux de compression élevé. +- `xz` : compresse des fichiers avec taux de compression élevé. - `ldd` : affiche des informations sur les bibliothèques partagées. From 16cb69190145703ce636049a95f0a33735450c61 Mon Sep 17 00:00:00 2001 From: Eric Guirbal Date: Tue, 25 Oct 2016 12:43:56 +0200 Subject: [PATCH 08/25] fr: translate "here document" --- README-fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-fr.md b/README-fr.md index 108d4f0..85184a5 100644 --- a/README-fr.md +++ b/README-fr.md @@ -210,7 +210,7 @@ C'est particulièrement utile pour des scripts mis à disposition sur le web, af } ``` -- Renseignez-vous à propos des « here documents » avec Bash, comme dans `cat < logfile 2>&1` ou `some-command &>logfile`. Souvent, pour s'assurer qu'une commande ne laisse pas un descripteur de fichier ouvert sur l'entrée standard, l'attachant au terminal dans lequel vous vous trouvez, une bonne pratique consiste à ajouter ` Date: Tue, 25 Oct 2016 12:49:15 +0200 Subject: [PATCH 09/25] Add missing backticks around a parameter --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cd79cb..9196684 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ Notes: # continue in original dir ``` -- In Bash, note there are lots of kinds of variable expansion. Checking a variable exists: `${name:?error message}`. For example, if a Bash script requires a single argument, just write `input_file=${1:?usage: $0 input_file}`. Using a default value if a variable is empty: `${name:-default}`. If you want to have an additional (optional) parameter added to the previous example, you can use something like `output_file=${2:-logfile}`. If $2 is omitted and thus empty, `output_file` will be set to `logfile`. Arithmetic expansion: `i=$(( (i + 1) % 5 ))`. Sequences: `{1..10}`. Trimming of strings: `${var%suffix}` and `${var#prefix}`. For example if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`. +- In Bash, note there are lots of kinds of variable expansion. Checking a variable exists: `${name:?error message}`. For example, if a Bash script requires a single argument, just write `input_file=${1:?usage: $0 input_file}`. Using a default value if a variable is empty: `${name:-default}`. If you want to have an additional (optional) parameter added to the previous example, you can use something like `output_file=${2:-logfile}`. If `$2` is omitted and thus empty, `output_file` will be set to `logfile`. Arithmetic expansion: `i=$(( (i + 1) % 5 ))`. Sequences: `{1..10}`. Trimming of strings: `${var%suffix}` and `${var#prefix}`. For example if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`. - Brace expansion using `{`...`}` can reduce having to re-type similar text and automate combinations of items. This is helpful in examples like `mv foo.{txt,pdf} some-dir` (which moves both files), `cp somefile{,.bak}` (which expands to `cp somefile somefile.bak`) or `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (which expands all possible combinations and creates a directory tree). From 095d11c7ca6b4a9a785cc552e2c1896a4302f3b4 Mon Sep 17 00:00:00 2001 From: Timothy Qiu Date: Tue, 25 Oct 2016 21:24:17 +0800 Subject: [PATCH 10/25] zh: fixes wording for 'the closing brace' --- README-zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-zh.md b/README-zh.md index 7dc460b..c205e72 100644 --- a/README-zh.md +++ b/README-zh.md @@ -146,7 +146,7 @@ diff /etc/hosts <(ssh somehost cat /etc/hosts) ``` -- 编写脚本时,你可能会想要把代码都放在大括号里。缺少关括号的话,代码就会因为语法错误而无法执行。如果你的脚本是要放在网上供人下载的,这样的写法就体现出它的好处了,因为没有完全下载的脚本无法执行: +- 编写脚本时,你可能会想要把代码都放在大括号里。缺少右括号的话,代码就会因为语法错误而无法执行。如果你的脚本是要放在网上供人下载的,这样的写法就体现出它的好处了,因为没有完全下载的脚本无法执行: ```bash { # 在这里写代码 From 2e85152da093da3822bf1f0d3fb9d8cdb55fec8d Mon Sep 17 00:00:00 2001 From: mudongliang Date: Tue, 25 Oct 2016 11:14:23 -0400 Subject: [PATCH 11/25] remove one redundancy line --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 9cd79cb..923999c 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir - The standard tools for patching source code are `diff` and `patch`. See also `diffstat` for summary statistics of a diff and `sdiff` for a side-by-side diff. Note `diff -r` works for entire directories. Use `diff -r tree1 tree2 | diffstat` for a summary of changes. Use `vimdiff` to compare and edit files. -- For binary files, use `hd`, `hexdump` or `xxd` for simple hex dumps and `bvi` or `biew` for binary editing. +- For binary files, use `hd`, `hexdump` or `xxd` for simple hex dumps and `bvi`, `hexedit` or `biew` for binary editing. - Also for binary files, `strings` (plus `grep`, etc.) lets you find bits of text. @@ -452,8 +452,6 @@ A few examples of piecing together commands: - `pv`: monitor the progress of data through a pipe -- `hd`, `hexdump`, `xxd`, `biew` and `bvi`: dump or edit binary files - - `strings`: extract text from binary files - `tr`: character translation or manipulation From 915466e41f05c3400fe4edbe325cefb3e31622d6 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 12:46:32 -0700 Subject: [PATCH 12/25] Part 1 of Romanian translation Part 2 to follow shortly --- README-ro.md | 596 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 596 insertions(+) create mode 100644 README-ro.md diff --git a/README-ro.md b/README-ro.md new file mode 100644 index 0000000..b8726f4 --- /dev/null +++ b/README-ro.md @@ -0,0 +1,596 @@ +🌍 +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* + + +# Arta liniei de comandă + +[![Pune o întrebare](https://img.shields.io/badge/%3f-Ask%20a%20Question-ff69b4.svg)](https://airtable.com/shrzMhx00YiIVAWJg) + +[![Alătură-te discuției https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + +- [Meta](#meta) +- [Bazele](#bazele) +- [Folosire zilnică](#folosire-zilnică) +- [Procesarea fișierelor și a datelor](#procesarea-fișierelor-și-a-datelor) +- [Depanarea sistemului](#depanarea sistemului) +- [Comenzi de o linie](#comenzi-de-o-linie) +- [Obscure dar utile](#obscure-dar-utile) +- [Doar pentru OS X](#doar-pentru-os-x) +- [Doar pentru Windows](#doar-pentru-windows) +- [Mai multe resourse](#mai-multe-resurse) +- [Anunț legal](#anunț-legal) + + +![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](cowsay.png) + +A folosi linia de comandă în mod eficient este o abilitate ignorată și/sau considerată obscură, dar ajută la creșterea flexibilității și productivității ca inginer. Acest ghid reprezintă o selecție de note și sfaturi pe care le-am găsit utile lucrului în Linux. Unele sfaturi sunt elementare, altele sunt foarte specifice, sofisticate sau obscure. Pagina nu este foarte lungă, dar dacă memorați și folosiți lucrurile de aici atunci știți o cantitate semnificativă de informație. + +Această muncă este rezultatul eforturilor [multor autori și translatori](AUTHORS.md). +Multe dintre aceste sfaturi +[au apărut](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands) +[original](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) +pe [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), +și au fost mutat pe GitHub ulteror, unde alți oameni talentați au produs numeroase îmbunătățiri. +[**Vă rugăm întrebați**](https://airtable.com/shrzMhx00YiIVAWJg) dacă aveți nelămuriri legate de linia de comandă. [**Contribuiți**](/CONTRIBUTING.md) dacă identificați o eroare sau ceva ce ar putea fi îmbunătățit! + +## Meta + +Scop: + +- Acest ghid este atât pentru începători cât și pentru avansați. Scopurile sunt *acoperire* (tot ce este important), *specificitate* (oferirea exemplelor concrete pentru cazurilor comune) și *brevitate* (neincluderea lucrurilor neesențiale sau a digresiunilor ce pot fi găsite ușor în alte părți). Fiecare sfat este esențial în câteva situații sau reduce semnificativ timpul necesar efectuării unei cerințe comparativ cu celelalte alternative. +- Ghidul este scris pentru Linux, cu excepția secțiunilor "[Doar pentru OS X](#doar-pentru-os-x)" și "[Doar pentru Windows](#doar-pentru-windows)". Majoritatea sfaturilor din celelate secțiuni se aplică/pot fi instalate pe alte sisteme Unix sau OS X (chiar și în Cygwin). +- Scopul este pe Bash interactiv, chiar dacă unele sfaturi sunt aplicabile și altor shell-uri sau pentru Bash-scripting în general. +- Atât comenzile Unix "standard" cât și cele care necesită instalarea de pachete speciale sunt incluse -- cât timp sfaturile sunt destul de importante cât să merite incluziunea. + +Note: + +- Pentru a păstra totul într-o singură pagină, conținutul este inclus implicit doar prin referințe. Suntem siguri că puteți căuta mai multe detalii după ce aveți ideea/comanda după care să căutați. Folosiți `apt-get`, `yum`, `dnf`, `pacman`, `pip` sau `brew` (după caz) pentru a instala programe noi. +- Folosiți [Explainshell](http://explainshell.com/) pentru a obține un util îndrumar în ce anumite comenzi, opțiuni, etc. fac. + + +## Bazele + +- Învățați folosirea de bază a Bash. De fapt, tastați `man bash` și treceți măcar pe diagonală prin tot conținutul; este ușor de citit și nu este prea lung. Shell-uri alternative pot fi frumoase, dar Bash este puternic și disponibil mereu (a învăța *doar* zsh, etc., chiar dacă e tentant pe laptopul propriu, vă restricționează în anumite situații, cum ar fi în folosirea unor servere existente). + +- Învățați cel puțin un editor de text. Ideal Vim (`vi`), cum nu există un competitor real pentru editarea în terminal (chiar dacă folosiți Emacs, sau un editor modern în majoritatea timpului). + +- Învățați să citiți documentație cu `man` (pentru curiouși, `man man` listează secțiunile, de exemplu 1 este pentru comenzi "uzuale", 5 este pentru fișiere/convenții și 8 pentru administrare). Găsiți pagini de manual cu `apropos`. Rețineți că anumite comenzi nu sunt executable ci comenzi interne în Bash și că puteți obține ajutor despre ele cu `help` sau `help -d`. Puteți vedea dacă o comandă este internă, executabilă sau doar un alias prin folosirea `type command`. + +- Învățați despre redirectarea intrării și ieșirii folosint `>` și `<` și pipe-uri cu `|`. Rețineți că `>` suprascrie fișierul și `>>` adaugă la final. Învățați despre ieșirea standard și ieșirea de eroare standard. + +- Învățați despre expandarea numelor de fișiere cu `*` (și poate `?` și `[`...`]`) și despre folosirea și diferențele dintre `"` și `'`. (Vedeți mai multe în secțiunea despre expandarea variabilelor mai jos). + +- Familiarizați-vă cu managementul job-urilor în Bash: `&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`, etc. + +- Învățați `ssh`, și bazele autentificării fără parolă, via `ssh-agent`, `ssh-add`, etc. + +- Managementul de bază al fișierelor: `ls` și `ls -l` (în special, învățați ce reprezintă fiecare coloană din `ls -l`), `less`, `head`, `tail` și `tail -f` (sau, mai bine, `less +F`), `ln` și `ln -s` (aprofundați diferențele și avantajele între link-urile hard și cele soft), `chown`, `chmod`, `du` (scurt sumar de folosire: `du -hs *`). Pentru managementul sistemului de fișiere: `df`, `mount`, `fdisk`, `mkfs`, `lsblk`. Învățați ce este un inode (`ls -i` sau `df -i`). + +- Concepte de bază de rețea: `ip` sau `ifconfig`, `dig`. + +- Învățați și folosiți un sistem de versionare, precum `git`. + +- Învățați expresii regulare foarte bine, precum și diversele opțiuni pentru `grep`/`egrep`. Relevante sunt `-i`, `-o`, `-v`, `-A`, `-B`, și `-C`. + +- Învațați să folosiți `apt-get`, `yum`, `dnf` sau `pacman` (în funcție de distribuție) pentru a găsi și instala pachete. Fiți siguri că aveți `pip` pentru a instala comenzile bazate pe Python (câteva din utilitarele de mai jos sunt mai ușor de instalat cu `pip`). + + +## Folosire zilnică + +- În Bash, folosiți **Tab** pentru a completa argumente sau a lista comenzile disponibile și **ctrl-r** pentru a căuta în istoricul comenzilor (după apăsare, tastați ce căutați și apăsați repetat **ctrl-r** pentru a cicla prin lista de potriviti, apăsați **Enter** pentru a executa comanda găsită sau săgeată dreapta pentru a putea edita linia curentă). + +- În Bash, folosiți **ctrl-w** pentru a șterge ultimul cuvânt și **ctrl-u** pentru a șterge până la începutul liniei. Folosiți **alt-b** și **alt-f** pentru a naviga cuvânt-cu-cuvânt, **ctrl-a** pentru a muta cursorul la începutul liniei, **ctrl-e** pentru a-l muta la final, **ctrl-k** pentru a șterge până la finalul liniei, **ctrl-l** pentru a curăța tot ecranul. Vizualizați `man readline` pentru a vedea toate tastele implicite din Bash. Sunt o mulțime. De exemplu, **alt-.** ciclează prin toate argumentele anterioare și **alt-*** expandează un glob pattern. + + +- Alternativ, dacă doriți să folosiți tastele ca în vi, folosiți `set -o vi` (și `set -o emacs` pentru a vă întoarce). + +- Pentru a edita comenzi lungi, după setarea editorului (de exemplu `export EDITOR=vim`), **ctrl-x** **ctrl-e** va deschide un editor cu comanda curentă pentru editare. În stilul vi puteți folosi **escape-v**. + +- Comenzile recente le găsiți folosind `history`. Dacă folosiți `!n` (unde `n` este numărul comenzii) atunci o veți executa din nou. Sunt mai multe scurtături pe care le puteți folosi, foarte utile fiind `!$` pentru ultimul argument și `!!` pentru ultima comandă (vedeți "HISTORY EXPANSION" în manual). Acestea pot fi înlocuite ușor cu **ctrl-r** și **alt-.**. + +- Navigați către directorul personal cu `cd`. Accesați fișiere relative la acest director cu prefixul `~` (e.g. `~/.bashrc`). În scripturile `sh`, referiți-vă la directorul personal cu `$HOME`. + +- Pentru a ajunge înapoi în directorul anterior: `cd -`. + +- Dacă sunteți în mijlocul editării unei comenzi dar vreți să renunțați, folosiți **alt-#** pentru a adăuga un `#` la început și a o introduce ca un comentariu (alternativ, **ctrl-a**, **#**, **enter**). Vă puteți întoarce la comandă mai târziu, folosind istoria comenzilor. + +- Folosiți `xargs` (sau `parallel`). Este foarte puternic. Puteți controla câte comenzi execută pe o linie (`-L`) și paralelismul (`-L`). Dacă nu sunteți siguri că ați dat comanda corectă, folosiți întâi `xargs echo`. De asemenea, `-I{}` este foarte ultil. Exemple: +```bash + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- `pstree -p` este o modalitate ușoară de a afișa lista de procese + +- Folosiți `pgrep` și `pkill` pentru a găsi și semnala procesele după nume (`-f` poate fi util). + +- Învățați ce semnale pot fi trimise proceselor. De exemplu, pentru a suspenda un proces puteți folosi `kill -STOP [pid]`. Pentru a obține lista completă, vedeți `man 7 signal`. + +- Folosiți `nohup` sau `disown` dacă doriți să trimiteți un proces în fundal sau să-l mențineți rulând permanent. + +- Verificați ce procese ascultă pe rețea folosind `netstat -lntp` sau `ss -plat` (pentru TCP; adăugați `-u` pentru UDP). + +- Vedeți `lsof` pentru fișiere și socket-uri deschise. + +- Vedeți `uptime` sau `w` pentru a afla cât timp sistemul a fost funcțional. + +- Folosiți `alias` pentru a crea scurtături pentru comenzile folosie des. De exemplu, `alias ll='ls -latr'` creează un nou alias `ll`. + +- Salvați alias-uri, setări shell, și funcții folosite frecvent în `~/.bashrc`, și [instruiți shell-ul de login să-l citească](http://superuser.com/a/183980/7106). Asftel, veți avea aceleași setări în toate terminalele. + +- Salvați setările variabilelor de mediu și comenzile care ar trebui executate la login în `~/.bash_profile`. Configurări separate sunt necesare pentru shell-uri lansate prin logarea în mediul grafic sau din task-uri `cron`. + +- Sincronizați fișierele de configurare (e.g. `.bashrc` and `.bash_profile`) între mai multe calculatoare folosind Git. + +- Tratați cu atenți cazurile când variabilele și fișierele conțin spații. Folosiți ghilimele în acest caz, de exemplu `"$FOO"`. Preferați să folosiți opțiunile `-0` sau `-print0` pentru a folosi caracterul null pentru a delimita fișierele, de exemplu `locate -0 pattern | xargs -0 ls -al` sau `find / -print0 -type d | xargs -0 ls -al`. Pentru a parcurge o listă de fișiere conținând spații într-o buclă for, setați variabile IFS la terminatorul de linie, `IFS=$'\n'`. + +- În scripturile Bash, folosiți `set -x` (sau varianta `set -v`, care produce informație neprocesată, inclusiv variabile neexpandate și comentarii) pentru a depana outputul. Folosiți modurile strice exceptând când aveți un motiv foarte bun împotrivă: folosiți `set -e` pentru a termina execuția în caz de eroare (cod de ieșire nenul). Folosiți `set -u` pentru a detecta variable nesetate. Considerați folosirea `set -o pipefail` pentru erorile cauzate de folosirea eronată a pipe-urilor. Pentru scripturi mai complicate, folosiți `trap` pentru EXIT sau ERR. Un obicei util este să începeți scriptul într-o modalitate care va permite detecția facilă a erorilor și terminarea execuției cu un mesaj: +```bash + set -euo pipefail + trap "echo 'error: Script failed: see failed command above'" ERR +``` + +- În scripturile Bash, subshell-urile (delimitate de paranteze) sunt un mod convenabil pentru a grupa comenzi. De exemplu, va puteți muta într-un alt director: +```bash + # do something in current dir + (cd /some/other/dir && other-command) + # continue in original dir +``` + +- În Bash, există mai multe variante de expandare a variabilelor. Verifacți dacă o variabilă există: `${name:?error message}`. De exemplu, dacă un script necesită un argument unic, folosiți `input_file=${1:?usage: $0 input_file}`. Folosți o valoare implicită pentru cazul când o variabilă este goală: `${name:-default}`. Pentru parametri opționali în exemplul anterior, folosiți `output_file=${2:-logfile}`. Dacă `$2` este omis (gol), `output_file` va fi setat la `logfile`. Expandare aritmetică: `i=$(( (i + 1) % 5 ))`. Secvențe: `{1..10}`. Tăierea unor secvențe din șiruri: `${var%suffix}` și `${var#prefix}`. De exemplu, dacă `var=foo.pdf`, atunci `echo ${var%.pdf}.txt` va scrie `foo.txt`. + +- Expandarea parantezelor folosind `{`...`}` previne re-tastarea textelor similare, automatizând combinațiile de itemuri. Este util în exemple precum `mv foo.{txt,pdf} some-dir` (care mută ambele fișiere), `cp somefile{,.bak}` (care se expandează la `cp somefile somefile.bak`) sau `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (care expandează toate combinațiile posibile și creează arborele de directoare). + +- Outputul unei comenzi poate fi tratat ca un fișier cu `<(some command)`. De exemplu, pentru a compara fișierul `/etc/hosts` local cu unul la distanță: +```sh + diff /etc/hosts <(ssh somehost cat /etc/hosts) +``` + +- Când scrieți cod, puteți prefera să încadrați tot codul în acolade. Dacă acolada de final lipsește, scriptul nu va rula. Este un lucru util, în special pentru scripturile de pe web pentru că previne execuția scripturilor parțial descărcate: +```bash +{ + # Your code here +} +``` + +- Folosiți "here documents", de exemplu `cat <logfile 2>&1` sau `some-command &>logfile`. De regulă, pentru a vă asigura că o comandă nu lasă un fișier deschis, fiind legată de terminalul curent, este o practică bună să adăugați `>> 2+3 +5 +``` + + +## Processing files and data + +- To locate a file by name in the current directory, `find . -iname '*something*'` (or similar). To find a file anywhere by name, use `locate something` (but bear in mind `updatedb` may not have indexed recently created files). + +- For general searching through source or data files (more advanced than `grep -r`), use [`ag`](https://github.com/ggreer/the_silver_searcher). + +- To convert HTML to text: `lynx -dump -stdin` + +- For Markdown, HTML, and all kinds of document conversion, try [`pandoc`](http://pandoc.org/). + +- If you must handle XML, `xmlstarlet` is old but good. + +- For JSON, use [`jq`](http://stedolan.github.io/jq/). + +- For YAML, use [`shyaml`](https://github.com/0k/shyaml). + +- For Excel or CSV files, [csvkit](https://github.com/onyxfish/csvkit) provides `in2csv`, `csvcut`, `csvjoin`, `csvgrep`, etc. + +- For Amazon S3, [`s3cmd`](https://github.com/s3tools/s3cmd) is convenient and [`s4cmd`](https://github.com/bloomreach/s4cmd) is faster. Amazon's [`aws`](https://github.com/aws/aws-cli) and the improved [`saws`](https://github.com/donnemartin/saws) are essential for other AWS-related tasks. + +- Know about `sort` and `uniq`, including uniq's `-u` and `-d` options -- see one-liners below. See also `comm`. + +- Know about `cut`, `paste`, and `join` to manipulate text files. Many people use `cut` but forget about `join`. + +- Know about `wc` to count newlines (`-l`), characters (`-m`), words (`-w`) and bytes (`-c`). + +- Know about `tee` to copy from stdin to a file and also to stdout, as in `ls -al | tee file.txt`. + +- For more complex calculations, including grouping, reversing fields, and statistical calculations, consider [`datamash`](https://www.gnu.org/software/datamash/). + +- Know that locale affects a lot of command line tools in subtle ways, including sorting order (collation) and performance. Most Linux installations will set `LANG` or other locale variables to a local setting like US English. But be aware sorting will change if you change locale. And know i18n routines can make sort or other commands run *many times* slower. In some situations (such as the set operations or uniqueness operations below) you can safely ignore slow i18n routines entirely and use traditional byte-based sort order, using `export LC_ALL=C`. + +- You can set a specific command's environment by prefixing its invocation with the environment variable settings, as in `TZ=Pacific/Fiji date`. + +- Know basic `awk` and `sed` for simple data munging. For example, summing all numbers in the third column of a text file: `awk '{ x += $3 } END { print x }'`. This is probably 3X faster and 3X shorter than equivalent Python. + +- To replace all occurrences of a string in place, in one or more files: +```sh + perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt +``` + +- To rename multiple files and/or search and replace within files, try [`repren`](https://github.com/jlevy/repren). (In some cases the `rename` command also allows multiple renames, but be careful as its functionality is not the same on all Linux distributions.) +```sh + # Full rename of filenames, directories, and contents foo -> bar: + repren --full --preserve-case --from foo --to bar . + # Recover backup files whatever.bak -> whatever: + repren --renames --from '(.*)\.bak' --to '\1' *.bak + # Same as above, using rename, if available: + rename 's/\.bak$//' *.bak +``` + +- As the man page says, `rsync` really is a fast and extraordinarily versatile file copying tool. It's known for synchronizing between machines but is equally useful locally. When security restrictions allow, using `rsync` instead of `scp` allows recovery of a transfer without restarting from scratch. It also is among the [fastest ways](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) to delete large numbers of files: +```sh +mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir +``` + +- Use `shuf` to shuffle or select random lines from a file. + +- Know `sort`'s options. For numbers, use `-n`, or `-h` for handling human-readable numbers (e.g. from `du -h`). Know how keys work (`-t` and `-k`). In particular, watch out that you need to write `-k1,1` to sort by only the first field; `-k1` means sort according to the whole line. Stable sort (`sort -s`) can be useful. For example, to sort first by field 2, then secondarily by field 1, you can use `sort -k1,1 | sort -s -k2,2`. + +- If you ever need to write a tab literal in a command line in Bash (e.g. for the -t argument to sort), press **ctrl-v** **[Tab]** or write `$'\t'` (the latter is better as you can copy/paste it). + +- The standard tools for patching source code are `diff` and `patch`. See also `diffstat` for summary statistics of a diff and `sdiff` for a side-by-side diff. Note `diff -r` works for entire directories. Use `diff -r tree1 tree2 | diffstat` for a summary of changes. Use `vimdiff` to compare and edit files. + +- For binary files, use `hd`, `hexdump` or `xxd` for simple hex dumps and `bvi` or `biew` for binary editing. + +- Also for binary files, `strings` (plus `grep`, etc.) lets you find bits of text. + +- For binary diffs (delta compression), use `xdelta3`. + +- To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example, this command lowercases and removes all accents (by expanding and dropping them): +```sh + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt +``` + +- To split files into pieces, see `split` (to split by size) and `csplit` (to split by a pattern). + +- To manipulate date and time expressions, use `dateadd`, `datediff`, `strptime` etc. from [`dateutils`](http://www.fresse.org/dateutils/). + +- Use `zless`, `zmore`, `zcat`, and `zgrep` to operate on compressed files. + +- File attributes are settable via `chattr` and offer a lower-level alternative to file permissions. For example, to protect against accidental file deletion the immutable flag: `sudo chattr +i /critical/directory/or/file` + +- Use `getfacl` and `setfacl` to save and restore file permissions. For example: +```sh + getfacl -R /some/path > permissions.txt + setfacl --restore=permissions.txt +``` + +## System debugging + +- For web debugging, `curl` and `curl -I` are handy, or their `wget` equivalents, or the more modern [`httpie`](https://github.com/jkbrzt/httpie). + +- To know current cpu/disk status, the classic tools are `top` (or the better `htop`), `iostat`, and `iotop`. Use `iostat -mxz 15` for basic CPU and detailed per-partition disk stats and performance insight. + +- For network connection details, use `netstat` and `ss`. + +- For a quick overview of what's happening on a system, `dstat` is especially useful. For broadest overview with details, use [`glances`](https://github.com/nicolargo/glances). + +- To know memory status, run and understand the output of `free` and `vmstat`. In particular, be aware the "cached" value is memory held by the Linux kernel as file cache, so effectively counts toward the "free" value. + +- Java system debugging is a different kettle of fish, but a simple trick on Oracle's and some other JVMs is that you can run `kill -3 ` and a full stack trace and heap summary (including generational garbage collection details, which can be highly informative) will be dumped to stderr/logs. The JDK's `jps`, `jstat`, `jstack`, `jmap` are useful. [SJK tools](https://github.com/aragozin/jvm-tools) are more advanced. + +- Use [`mtr`](http://www.bitwizard.nl/mtr/) as a better traceroute, to identify network issues. + +- For looking at why a disk is full, [`ncdu`](https://dev.yorhel.nl/ncdu) saves time over the usual commands like `du -sh *`. + +- To find which socket or process is using bandwidth, try [`iftop`](http://www.ex-parrot.com/~pdw/iftop/) or [`nethogs`](https://github.com/raboof/nethogs). + +- The `ab` tool (comes with Apache) is helpful for quick-and-dirty checking of web server performance. For more complex load testing, try `siege`. + +- For more serious network debugging, [`wireshark`](https://wireshark.org/), [`tshark`](https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html), or [`ngrep`](http://ngrep.sourceforge.net/). + +- Know about `strace` and `ltrace`. These can be helpful if a program is failing, hanging, or crashing, and you don't know why, or if you want to get a general idea of performance. Note the profiling option (`-c`), and the ability to attach to a running process (`-p`). + +- Know about `ldd` to check shared libraries etc. + +- Know how to connect to a running process with `gdb` and get its stack traces. + +- Use `/proc`. It's amazingly helpful sometimes when debugging live problems. Examples: `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps` (where `xxx` is the process id or pid). + +- When debugging why something went wrong in the past, [`sar`](http://sebastien.godard.pagesperso-orange.fr/) can be very helpful. It shows historic statistics on CPU, memory, network, etc. + +- For deeper systems and performance analyses, look at `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux)), and [`sysdig`](https://github.com/draios/sysdig). + +- Check what OS you're on with `uname` or `uname -a` (general Unix/kernel info) or `lsb_release -a` (Linux distro info). + +- Use `dmesg` whenever something's acting really funny (it could be hardware or driver issues). + +- If you delete a file and it doesn't free up expected disk space as reported by `du`, check whether the file is in use by a process: +`lsof | grep deleted | grep "filename-of-my-big-file"` + + +## One-liners + +A few examples of piecing together commands: + +- It is remarkably helpful sometimes that you can do set intersection, union, and difference of text files via `sort`/`uniq`. Suppose `a` and `b` are text files that are already uniqued. This is fast, and works on files of arbitrary size, up to many gigabytes. (Sort is not limited by memory, though you may need to use the `-T` option if `/tmp` is on a small root partition.) See also the note about `LC_ALL` above and `sort`'s `-u` option (left out for clarity below). +```sh + cat a b | sort | uniq > c # c is a union b + cat a b | sort | uniq -d > c # c is a intersect b + cat a b b | sort | uniq -u > c # c is set difference a - b +``` + +- Use `grep . *` to quickly examine the contents of all files in a directory (so each line is paired with the filename), or `head -100 *` (so each file has a heading). This can be useful for directories filled with config settings like those in `/sys`, `/proc`, `/etc`. + + +- Summing all numbers in the third column of a text file (this is probably 3X faster and 3X less code than equivalent Python): +```sh + awk '{ x += $3 } END { print x }' myfile +``` + +- To see sizes/dates on a tree of files, this is like a recursive `ls -l` but is easier to read than `ls -lR`: +```sh + find . -type f -ls +``` + +- Say you have a text file, like a web server log, and a certain value that appears on some lines, such as an `acct_id` parameter that is present in the URL. If you want a tally of how many requests for each `acct_id`: +```sh + cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn +``` + +- To continuously monitor changes, use `watch`, e.g. check changes to files in a directory with `watch -d -n 2 'ls -rtlh | tail'` or to network settings while troubleshooting your wifi settings with `watch -d -n 2 ifconfig`. + +- Run this function to get a random tip from this document (parses Markdown and extracts an item): +```sh + function taocl() { + curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | + pandoc -f markdown -t html | + xmlstarlet fo --html --dropdtd | + xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | + xmlstarlet unesc | fmt -80 + } +``` + + +## Obscure dar utile + +- `expr`: execută operații aritmetice sau boleene și expandează expresii regulate + +- `m4`: procesor simplu de macro-uri + +- `yes`: afișează un șir de un număr infinit de ori + +- `cal`: calendar + +- `env`: execută o comandă (util în scripturi) + +- `printenv`: afișează variabilele de mediu (util pentru depanare și scripturi) + +- `look`: idenfică cuvinte în engleză (sau linii de fișier) care încep cu un șir + +- `cut`, `paste` and `join`: manipulează date + +- `fmt`: formatează paragrafe de text + +- `pr`: formatează textul în paragrafe și coloane + +- `fold`: înfășoară liniile unui text + +- `column`: formatează textul în coloane de lungime fixă, în tabele + +- `expand` și `unexpand`: convertește între tab-uri și spații + +- `nl`: adaugă numere liniilor + +- `seq`: afișează numere + +- `bc`: calculator + +- `factor`: factorizează întregi + +- [`gpg`](https://gnupg.org/): criptează și semnează fișiere + +- `toe`: tabel de informații despre terminal + +- `nc`: depanare rețea și transfer de date + +- `socat`: socket relay și forwarder pentru porturi tcp (similar cu `netcat`) + +- [`slurm`](https://github.com/mattthias/slurm): vizualizează traficul de rețea + +- `dd`: mută datele între fișiere și device-uri + +- `file`: identifică tipul unui fișier + +- `tree`: arată un arbore de directoare și subdirectoare, ca `ls` dar recursiv + +- `stat`: informații despre fișier + +- `time`: execută și cronometrează o comandă + +- `timeout`: execută o comandă până la expirarea unei cantițăți de timp, omorând procesul la finalul timpului alocat + +- `lockfile`: creează un fișier semafor care nu poate fi șters decât cu `rm -f` + +- `logrotate`: rotește, comprimă și trimite jurnalele pe mail + +- `watch`: execută o comandă în mod repetat, arătând rezultatele și/sau evidențiind diferențele + +- `tac`: afișează conținutul fișierelor în ordine inversă + +- `shuf`: selectează linii random din fișier + +- `comm`: compară fișiere sortate, linie cu linie + +- `pv`: monitorizează progresul datelor într-un pipe + +- `hd`, `hexdump`, `xxd`, `biew` și `bvi`: afișează sau editează fișiere binare + +- `strings`: extrage șiruri din fișiere + +- `tr`: translatează și manipulează caractere + +- `iconv` sau `uconv`: conversie între codificările posibile ale unui text + +- `split` și `csplit`: sparge fișiere în componente + +- `sponge`: citește tot inputul înainte de a-l afișa, util pentru a citi și apoi a scrie în același fișier: `grep -v something some-file | sponge some-file` + +- `units`: conversii între unități de măsură (vedeți și `/usr/share/units/definitions.units`) + +- `apg`: generateză parole random + +- `xz`: compresor de fișiere foarte eficient + +- `ldd`: informații despre bibliotecile dinamice + +- `nm`: simboluri din fișierele obiect + +- `ab`: benchmarking pentru servere web + +- `strace`: depanare apeluri de sistem + +- [`mtr`](http://www.bitwizard.nl/mtr/): alternative mai bună pentru `traceroute` pentru depanarea rețelei + +- `cssh`: shell vizual, concurent + +- `rsync`: sincronizează fișiere peste SSH sau local + +- [`wireshark`](https://wireshark.org/) și [`tshark`](https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html): capturează trafic de rețea și depanează rețeaua + +- [`ngrep`](http://ngrep.sourceforge.net/): grep pentru rețea + +- `host` și `dig`: interogări DNS + +- `lsof`: informații despre descriptorii de fișiere și sockeți + +- `dstat`: statistici utile despre sistem + +- [`glances`](https://github.com/nicolargo/glances): statistici utile despre sistem, la nivel înalt + +- `iostat`: statistici despre folosirea discului + +- `mpstat`: statistici despre folosirea CPU + +- `vmstat`: statistici despre folosirea memoriei + +- `htop`: versiune îmbunătățită a `top` + +- `last`: istoria login-urilor + +- `w`: cine este logged-in + +- `id`: informații despre useri/grupuri + +- [`sar`](http://sebastien.godard.pagesperso-orange.fr/): istoria statisticilor despre sistem + +- [`iftop`](http://www.ex-parrot.com/~pdw/iftop/) sau [`nethogs`](https://github.com/raboof/nethogs): utilizarea rețelei de fiecare socket sau proces + +- `ss`: statistici socket + +- `dmesg`: erori de sistem sau de pornirea sistemului + +- `sysctl`: vizualizează și configurează parametrii nucleului Linux + +- `hdparm`: manipulare/performanță pentru discuri SATA/ATA + +- `lsblk`: afișează dispozitivele block: discuri și partiții + +- `lshw`, `lscpu`, `lspci`, `lsusb`, `dmidecode`: informații hardware, incluzând CPU, BIOs, RAID, plăci grafice, dispozitive, etc. + +- `lsmod` și `modinfo`: afișează module de kernel + +- `fortune`, `ddate`, și `sl`: depinde dacă considerați locomotive și citate "utile" (utilitare distractive) + + +## OS X only + +These are items relevant *only* on OS X. + +- Package management with `brew` (Homebrew) and/or `port` (MacPorts). These can be used to install on OS X many of the above commands. + +- Copy output of any command to a desktop app with `pbcopy` and paste input from one with `pbpaste`. + +- To enable the Option key in OS X Terminal as an alt key (such as used in the commands above like **alt-b**, **alt-f**, etc.), open Preferences -> Profiles -> Keyboard and select "Use Option as Meta key". + +- To open a file with a desktop app, use `open` or `open -a /Applications/Whatever.app`. + +- Spotlight: Search files with `mdfind` and list metadata (such as photo EXIF info) with `mdls`. + +- Be aware OS X is based on BSD Unix, and many commands (for example `ps`, `ls`, `tail`, `awk`, `sed`) have many subtle variations from Linux, which is largely influenced by System V-style Unix and GNU tools. You can often tell the difference by noting a man page has the heading "BSD General Commands Manual." In some cases GNU versions can be installed, too (such as `gawk` and `gsed` for GNU awk and sed). If writing cross-platform Bash scripts, avoid such commands (for example, consider Python or `perl`) or test carefully. + +- To get OS X release information, use `sw_vers`. + +## Windows only + +These items are relevant *only* on Windows. + +- On Windows 10, you can use [Bash on Ubuntu on Windows](https://msdn.microsoft.com/commandline/wsl/about), which provides a familiar Bash environment with Unix command line utilities. On the plus side, this allows Linux programs to run on Windows. On the other hand this does not support the running of Windows programs from the Bash prompt. + +- Access the power of the Unix shell under Microsoft Windows by installing [Cygwin](https://cygwin.com/). Most of the things described in this document will work out of the box. + +- Install additional Unix programs with the Cygwin's package manager. + +- Use `mintty` as your command-line window. + +- Access the Windows clipboard through `/dev/clipboard`. + +- Run `cygstart` to open an arbitrary file through its registered application. + +- Access the Windows registry with `regtool`. + +- Note that a `C:\` Windows drive path becomes `/cygdrive/c` under Cygwin, and that Cygwin's `/` appears under `C:\cygwin` on Windows. Convert between Cygwin and Windows-style file paths with `cygpath`. This is most useful in scripts that invoke Windows programs. + +- You can perform and script most Windows system administration tasks from the command line by learning and using `wmic`. + +- Another option to get Unix look and feel under Windows is [Cash](https://github.com/dthree/cash). Note that only very few Unix commands and command-line options are available in this environment. + +- An alternative option to get GNU developer tools (such as GCC) on Windows is [MinGW](http://www.mingw.org/) and its [MSYS](http://www.mingw.org/wiki/msys) package, which provides utilities such as bash, gawk, make and grep. MSYS doesn't have all the features compared to Cygwin. MinGW is particularly useful for creating native Windows ports of Unix tools. + +## More resources + +- [awesome-shell](https://github.com/alebcay/awesome-shell): A curated list of shell tools and resources. +- [awesome-osx-command-line](https://github.com/herrbischoff/awesome-osx-command-line): A more in-depth guide for the OS X command line. +- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for writing better shell scripts. +- [shellcheck](https://github.com/koalaman/shellcheck): A shell script static analysis tool. Essentially, lint for bash/sh/zsh. +- [Filenames and Pathnames in Shell](http://www.dwheeler.com/essays/filenames-in-shell.html): The sadly complex minutiae on how to handle filenames correctly in shell scripts. +- [Data Science at the Command Line](http://datascienceatthecommandline.com/#tools): More commands and tools helpful for doing data science, from the book of the same name + +## Disclaimer + +With the exception of very small tasks, code is written so others can read it. With power comes responsibility. The fact you *can* do something in Bash doesn't necessarily mean you should! ;) + + +## License + +[![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/) + +This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). From 186c49e292379dacc74bdbcf34e03a21b59b3ffc Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 15:27:36 -0700 Subject: [PATCH 13/25] Another section done --- README-ro.md | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/README-ro.md b/README-ro.md index b8726f4..b09c99b 100644 --- a/README-ro.md +++ b/README-ro.md @@ -195,7 +195,7 @@ Note: - Pentru a schimba tot shellul către alt user, folosiți `su username` sau `su - username`. Versiunea cu `-` obține și mediul, ca si cum userul tocmai s-a logat. Username-ul implicit este root. Veți fi întrebat parola _utilizatorului către care faceți schimbarea_. -- Amintițivă că orice linie de comandă are o limită de [128K](https://wiki.debian.org/CommonErrorMessages/ArgumentListTooLong). Eroarea "Argument list too long" (listă de argumente prea lungă) este comună dacă un număr mare de fișiere se potrivesc unui șablon. (În acest caz, alternative precum `find` și `xargs` ajută.) +- Amintiți-vă că orice linie de comandă are o limită de [128K](https://wiki.debian.org/CommonErrorMessages/ArgumentListTooLong). Eroarea "Argument list too long" (listă de argumente prea lungă) este comună dacă un număr mare de fișiere se potrivesc unui șablon. (În acest caz, alternative precum `find` și `xargs` ajută.) - Un calculator în bash poate fi obținut prin access to Python: `python`: ``` @@ -204,48 +204,48 @@ Note: ``` -## Processing files and data +## Procesarea fișierelor și a datelor -- To locate a file by name in the current directory, `find . -iname '*something*'` (or similar). To find a file anywhere by name, use `locate something` (but bear in mind `updatedb` may not have indexed recently created files). +- Pentru a localiza un fișier după nume, în directorul curend, `find . -iname '*something*'` (sau similar). Pentru a găsi un fișier oriunde, `locate something` (dar țineți cont de faptul că `updatedb` s-ar putea să nu fi indexat fișierele recente). -- For general searching through source or data files (more advanced than `grep -r`), use [`ag`](https://github.com/ggreer/the_silver_searcher). +- Pentru a căuta în interiorul fișierelor (mai avansat decât `grep -r`), folosiți [`ag`](https://github.com/ggreer/the_silver_searcher). -- To convert HTML to text: `lynx -dump -stdin` +- Pentru a converti HTML la text: `lynx -dump -stdin` - For Markdown, HTML, and all kinds of document conversion, try [`pandoc`](http://pandoc.org/). -- If you must handle XML, `xmlstarlet` is old but good. +- Dacă trebuie să folosiți XML, `xmlstarlet` e vechi dar util. -- For JSON, use [`jq`](http://stedolan.github.io/jq/). +- Pentru JSON, folosiți [`jq`](http://stedolan.github.io/jq/). -- For YAML, use [`shyaml`](https://github.com/0k/shyaml). +- Pentru YAML, folosiți [`shyaml`](https://github.com/0k/shyaml). -- For Excel or CSV files, [csvkit](https://github.com/onyxfish/csvkit) provides `in2csv`, `csvcut`, `csvjoin`, `csvgrep`, etc. +- Pentru Excel sau CSV files, [csvkit](https://github.com/onyxfish/csvkit) oferă `in2csv`, `csvcut`, `csvjoin`, `csvgrep`, etc. -- For Amazon S3, [`s3cmd`](https://github.com/s3tools/s3cmd) is convenient and [`s4cmd`](https://github.com/bloomreach/s4cmd) is faster. Amazon's [`aws`](https://github.com/aws/aws-cli) and the improved [`saws`](https://github.com/donnemartin/saws) are essential for other AWS-related tasks. +- Pentru Amazon S3, [`s3cmd`](https://github.com/s3tools/s3cmd) este ușor de folosit și [`s4cmd`](https://github.com/bloomreach/s4cmd) este mai rapid. [`aws`](https://github.com/aws/aws-cli) de la Amazon și varianta îmbunătățită [`saws`](https://github.com/donnemartin/saws) sunt esențiale pentru alte task-uri legate de AWS. -- Know about `sort` and `uniq`, including uniq's `-u` and `-d` options -- see one-liners below. See also `comm`. +- Învățați `sort` și `uniq`, inclusiv opțiunile `-u` și `-d` pentru `uniq` -- mai multe exemple în secțiunea de comenzi de o linie, mai jos. Vedeți și `comm`. -- Know about `cut`, `paste`, and `join` to manipulate text files. Many people use `cut` but forget about `join`. +- Aflați despre `cut`, `paste`, și `join` pentru a manipula fișiere text. Mulți oameni folosesc `cut` dar uită de `join`. -- Know about `wc` to count newlines (`-l`), characters (`-m`), words (`-w`) and bytes (`-c`). +- Informați-vă despre `wc` pentru a număra liniile (`-l`), caracterele (`-m`), cuvintele (`-w`) și octeții (`-c`) dintr-un fișier. -- Know about `tee` to copy from stdin to a file and also to stdout, as in `ls -al | tee file.txt`. +- Folosți `tee` pentru a copia de la intrarea standard (stdin) într-un fișier și la ieșirea standard (stdout) simultan, ca în `ls -al | tee file.txt`. -- For more complex calculations, including grouping, reversing fields, and statistical calculations, consider [`datamash`](https://www.gnu.org/software/datamash/). +- Pentru operații mai complexe, inclusiv grupare, inversare de câmpuri și statistică, considerați folosirea [`datamash`](https://www.gnu.org/software/datamash/). -- Know that locale affects a lot of command line tools in subtle ways, including sorting order (collation) and performance. Most Linux installations will set `LANG` or other locale variables to a local setting like US English. But be aware sorting will change if you change locale. And know i18n routines can make sort or other commands run *many times* slower. In some situations (such as the set operations or uniqueness operations below) you can safely ignore slow i18n routines entirely and use traditional byte-based sort order, using `export LC_ALL=C`. +- Țineți minte că localizarea (`locale`) influențează foarte multe comenzi în moduri subtile, inclusiv sortare sau performanță. Majoritatea instalărilor Linux setează `LANG` și alte variabile de localizare la o setare precum US English. Sortarea se va schimba dacă schimbați localizare. De asemenea, rutinele de internaționalizare (i18n) pot face comenzile să se execute *mult, mult* mai încet. În unele situații (precum operațiile pe mulțimi de mai jos), puteți ignora rutinele încete de la i18n și folosi sortarea bazată pe octeți, folosind `export LC_ALL=C`. -- You can set a specific command's environment by prefixing its invocation with the environment variable settings, as in `TZ=Pacific/Fiji date`. +- Puteți seta localizarea specifică unei comenzi prin prefixarea acesteia cu variabila de mediu corespunzătoare, ca în `TZ=Pacific/Fiji date`. -- Know basic `awk` and `sed` for simple data munging. For example, summing all numbers in the third column of a text file: `awk '{ x += $3 } END { print x }'`. This is probably 3X faster and 3X shorter than equivalent Python. +- Pentru procesare de bază a textelor, folosiți `awk` și `sed`. De exemplu, pentur a aduna suma numerelor din coloana a treia a unui fișier `awk '{ x += $3 } END { print x }'` este de 3 ori mai rapid și mai scurt decât codul echivalent în Python. -- To replace all occurrences of a string in place, in one or more files: +- Pentru a înlocui toate aparițiile unui șir, în cel puțin un fișier: ```sh perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt ``` -- To rename multiple files and/or search and replace within files, try [`repren`](https://github.com/jlevy/repren). (In some cases the `rename` command also allows multiple renames, but be careful as its functionality is not the same on all Linux distributions.) +- Pentru a redenumi fișiere multiple și/sau căuta în fișiere încercați [`repren`](https://github.com/jlevy/repren). (În unele cazuri, comanda `rename` permite redenumiri multiple, dar țineți cont că funcționalitatea ei nu este aceeași în toate distribuțiile Linux) ```sh # Full rename of filenames, directories, and contents foo -> bar: repren --full --preserve-case --from foo --to bar . @@ -255,39 +255,39 @@ Note: rename 's/\.bak$//' *.bak ``` -- As the man page says, `rsync` really is a fast and extraordinarily versatile file copying tool. It's known for synchronizing between machines but is equally useful locally. When security restrictions allow, using `rsync` instead of `scp` allows recovery of a transfer without restarting from scratch. It also is among the [fastest ways](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) to delete large numbers of files: +- După cum zice și pagina de manual, `rsync` este un utilitar foarte rapid, eficient și versatil de a copia fișiere. Este cunoscut pentru sincronizarea între calculatoare dar poate fi folosit și local. Dacă setăruile de securitate permit, folosirea `rsync` în loc de `scp` permite continuarea unui transfer eșuat fără a-l reporni. Este și una dintre cele [mai rapide metode](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) de a șterge un număr masiv de fișiere: ```sh mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir ``` -- Use `shuf` to shuffle or select random lines from a file. +- Folosiți `shuf` pentru a permuta sau selecta linii aleatoare dintr-un fișier. -- Know `sort`'s options. For numbers, use `-n`, or `-h` for handling human-readable numbers (e.g. from `du -h`). Know how keys work (`-t` and `-k`). In particular, watch out that you need to write `-k1,1` to sort by only the first field; `-k1` means sort according to the whole line. Stable sort (`sort -s`) can be useful. For example, to sort first by field 2, then secondarily by field 1, you can use `sort -k1,1 | sort -s -k2,2`. +- Învățați opțiunile lui `sort`. ForPentru numere folosiți `-n`, sau `-h` pentru numere în format human-readable (de exemplu numere produse de `du -h`). Învățați cum funcționează cheile de sortare (`-t` și `-k`). În special, țineți cont că trebuie să scrieți `-k1,1` pentru a sorta doar prima coloană, `-k1` înseamnă sortare după toată linia. Sortarea stabilă (`sort -s`) poate fi utilă. De exemplu, pentru a sorta după câmpul 2 și apoi după 1: `sort -k1,1 | sort -s -k2,2`. -- If you ever need to write a tab literal in a command line in Bash (e.g. for the -t argument to sort), press **ctrl-v** **[Tab]** or write `$'\t'` (the latter is better as you can copy/paste it). +- Dacă sunteți nevoiți să scrieți un caracter tab în terminal (de exemplu pentru argumentul `-t` al `sort`) apăsați **ctrl-v** **[Tab]** sau scrieți `$'\t'` (ultima versiune e mai bună pentru că permite și copy/paste). -- The standard tools for patching source code are `diff` and `patch`. See also `diffstat` for summary statistics of a diff and `sdiff` for a side-by-side diff. Note `diff -r` works for entire directories. Use `diff -r tree1 tree2 | diffstat` for a summary of changes. Use `vimdiff` to compare and edit files. +- Utilitarele standard pentru patch-uirea codului sunt `diff` și `patch`. De asemenea `diffstat` poate fi folosit pentru sumarizarea unui diff și `sdiff` pentru un diff side-by-side. Țineți cont că `diff -r` operează pe directoare întregi. Folosiți `diff -r tree1 tree2 | diffstat` pentru un sumar al modificărilor. Folosiți `vimdiff` pentru a compara și edita fișiere. -- For binary files, use `hd`, `hexdump` or `xxd` for simple hex dumps and `bvi` or `biew` for binary editing. +- Pentru fișiere binare, folosiți `hd`, `hexdump` sau `xxd` pentru operații simple și `bvi` sau `biew` pentru editare binară -- Also for binary files, `strings` (plus `grep`, etc.) lets you find bits of text. +- Tot pentru fișiere binare, `strings` (plus `grep`, etc.) permite găsirea bucăților de text. -- For binary diffs (delta compression), use `xdelta3`. +- Pentru diff-uri binare (compresie delta), folosiți `xdelta3`. -- To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example, this command lowercases and removes all accents (by expanding and dropping them): +- Pentru a converti codificarea textului, folosiți `iconv` sau `uconv` pentru utilizări mai avansate. Ambele suportă același set de Unicode. De exemplu, comanda următoare transformă în minuscule și elimină accentele (prin expandare sau coborâre): ```sh uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt ``` -- To split files into pieces, see `split` (to split by size) and `csplit` (to split by a pattern). +- Pentru a împărți un text în fragmente, folosiți `split` (după dimensiune) și `csplit` (după un șablon). -- To manipulate date and time expressions, use `dateadd`, `datediff`, `strptime` etc. from [`dateutils`](http://www.fresse.org/dateutils/). +- Folosiți `dateadd`, `datediff`, `strptime` etc. din [`dateutils`](http://www.fresse.org/dateutils/) pentru a manipula expresii legate de timp, dată și oră. -- Use `zless`, `zmore`, `zcat`, and `zgrep` to operate on compressed files. +- Pentru a opera pe fișiere comprimate: `zless`, `zmore`, `zcat`, and `zgrep` -- File attributes are settable via `chattr` and offer a lower-level alternative to file permissions. For example, to protect against accidental file deletion the immutable flag: `sudo chattr +i /critical/directory/or/file` +- Atributele fișierelor pot fi stabilite cu `chattr` și oferă o alternativă de nivel scăzut la permisiunile unui fișier. De exemplu, pentru a vă proteja împotriva ștergerii accidentale puteți folosi flag-ul immutable: `sudo chattr +i /critical/directory/or/file` -- Use `getfacl` and `setfacl` to save and restore file permissions. For example: +- Folosiți `getfacl` și `setfacl` pentru a salva și restaura permisiunile unui fișier. De exemplu: ```sh getfacl -R /some/path > permissions.txt setfacl --restore=permissions.txt From 23d5749d1e6f1c84a80d21eef63a6ae806c185bd Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 15:51:39 -0700 Subject: [PATCH 14/25] Yet another section --- README-ro.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README-ro.md b/README-ro.md index b09c99b..b0cb8dc 100644 --- a/README-ro.md +++ b/README-ro.md @@ -293,47 +293,47 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir setfacl --restore=permissions.txt ``` -## System debugging +## Depanarea sistemului -- For web debugging, `curl` and `curl -I` are handy, or their `wget` equivalents, or the more modern [`httpie`](https://github.com/jkbrzt/httpie). +- Pentru depanarea problemelor legate de internet/web, `curl` și `curl -I` sunt foarte utile, la fel și echivalentele bazate pe `wget` sau pe modernul [`httpie`](https://github.com/jkbrzt/httpie). -- To know current cpu/disk status, the classic tools are `top` (or the better `htop`), `iostat`, and `iotop`. Use `iostat -mxz 15` for basic CPU and detailed per-partition disk stats and performance insight. +- Pentru a vedea starea curentă a CPU-ului sau discului, instrumentele clasice sunt `top` (mai bine `htop`), `iostat`, și `iotop`. Folosiți `iostat -mxz 15` pentru informații de bază despre CPU și detaliate depsre partițiile fiecărui disc, împreună cu sfaturi pentru îmbunătățirea performanței. -- For network connection details, use `netstat` and `ss`. +- Pentru detalii legate de conexiunile la rețea, folosiți `netstat` și `ss`. -- For a quick overview of what's happening on a system, `dstat` is especially useful. For broadest overview with details, use [`glances`](https://github.com/nicolargo/glances). +- O vedere de ansamblu a sistemului poate fi obținută folosind `dstat`. Pentru detalii, folosiți [`glances`](https://github.com/nicolargo/glances). -- To know memory status, run and understand the output of `free` and `vmstat`. In particular, be aware the "cached" value is memory held by the Linux kernel as file cache, so effectively counts toward the "free" value. +- Pentru a vedea starea curentă a memoriei, folosiți și analizați rezultatele `free` și `vmstat`. În particular, țineți cont că valoarea "cached" este memorie reținută de Linux ca un spațiu cache pentru fișiere, deci este efectiv spațiu "liber". -- Java system debugging is a different kettle of fish, but a simple trick on Oracle's and some other JVMs is that you can run `kill -3 ` and a full stack trace and heap summary (including generational garbage collection details, which can be highly informative) will be dumped to stderr/logs. The JDK's `jps`, `jstat`, `jstack`, `jmap` are useful. [SJK tools](https://github.com/aragozin/jvm-tools) are more advanced. +- Depanarea sistemului Java este deosebită dar un truc simplu pe anumite JVM-uri (inclusiv Oracle) este că puteți rula `kill -3 ` și veți obține un stack trace complet și informații despre memoria heap, inclusiv detalii despre garbage collector. Utilitarele `jps`, `jstat`, `jstack`, `jmap` din JDK pot fi utile. [Utilitarele SJK](https://github.com/aragozin/jvm-tools) sunt mai avansate. -- Use [`mtr`](http://www.bitwizard.nl/mtr/) as a better traceroute, to identify network issues. +- Folosiți [`mtr`](http://www.bitwizard.nl/mtr/) ca un `traceroute` mai bun pentru a identifica problemele de rețea. -- For looking at why a disk is full, [`ncdu`](https://dev.yorhel.nl/ncdu) saves time over the usual commands like `du -sh *`. +- Pentru a identifica de ce un disc este plin, [`ncdu`](https://dev.yorhel.nl/ncdu) salvează timp comparativ cu folosirea comenzilor uzuale precum `du -sh *`. -- To find which socket or process is using bandwidth, try [`iftop`](http://www.ex-parrot.com/~pdw/iftop/) or [`nethogs`](https://github.com/raboof/nethogs). +- Pentru a identifica socket-ul sau procesul care consumă cea mai mare bandă din rețea folosiți [`iftop`](http://www.ex-parrot.com/~pdw/iftop/) sau [`nethogs`](https://github.com/raboof/nethogs). -- The `ab` tool (comes with Apache) is helpful for quick-and-dirty checking of web server performance. For more complex load testing, try `siege`. +- Utilitarul `ab` (vine cu Apache) este util pentru a testa rapid performanța serverului web. Pentru testare mai complexă folosiți `siege`. -- For more serious network debugging, [`wireshark`](https://wireshark.org/), [`tshark`](https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html), or [`ngrep`](http://ngrep.sourceforge.net/). +- Pentru depanarea și mai serioasă a rețelei folosiți [`wireshark`](https://wireshark.org/), [`tshark`](https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html), sau [`ngrep`](http://ngrep.sourceforge.net/). -- Know about `strace` and `ltrace`. These can be helpful if a program is failing, hanging, or crashing, and you don't know why, or if you want to get a general idea of performance. Note the profiling option (`-c`), and the ability to attach to a running process (`-p`). +- Învățați despre `strace` și `ltrace`. Aceste utilitare sunt utile dacă un program eșuează, se blochează sau crapă și nu știți de ce, sau dacă vreți să obțineți detalii generale despre performanță. Evidențiem opțiunea de profiling (`-c`), și abilitatea de atașare la un proces care rulează (`-p`). -- Know about `ldd` to check shared libraries etc. +- Folosiți `ldd` pentru a verifica bibliotecile dinamice, etc. -- Know how to connect to a running process with `gdb` and get its stack traces. +- Folosiți `gdb` pentru a vă conecta la un proces care rulează și a obține un stack trace. -- Use `/proc`. It's amazingly helpful sometimes when debugging live problems. Examples: `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps` (where `xxx` is the process id or pid). +- Folosiți `/proc`. Este foarte util în depanarea problemelor pe viu. Exemple: `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps` (unde `xxx` este id-ul procesului - PID-ul lui). -- When debugging why something went wrong in the past, [`sar`](http://sebastien.godard.pagesperso-orange.fr/) can be very helpful. It shows historic statistics on CPU, memory, network, etc. +- Pentru a depana ceva ce a fost greșit în trecut, [`sar`](http://sebastien.godard.pagesperso-orange.fr/) poate fi foarte util. Arată statistici istorice despre CPU, memorie, rețea, etc. -- For deeper systems and performance analyses, look at `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux)), and [`sysdig`](https://github.com/draios/sysdig). +- Pentru analize de detaliu pentru performanța sistemului, folosiți `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux)), și [`sysdig`](https://github.com/draios/sysdig). -- Check what OS you're on with `uname` or `uname -a` (general Unix/kernel info) or `lsb_release -a` (Linux distro info). +- Verificați ce sistem de operare folosiți cu `uname` sau `uname -a` (detalii generale despre nucleu) sau `lsb_release -a` (Linux distro). -- Use `dmesg` whenever something's acting really funny (it could be hardware or driver issues). +- Folosiți `dmesg` oricând ceva funcționează total aiurea (probabil din cauza hardware-ului sau a dispozitivelor fizice). -- If you delete a file and it doesn't free up expected disk space as reported by `du`, check whether the file is in use by a process: +- Dacă ștergeți un fișier și nu se eliberează cantitatea de spațiu de pe disc la care vă așteptați (conform `du`), verificați să nu cumva aveți fișierul folosit de un proces: `lsof | grep deleted | grep "filename-of-my-big-file"` From 77710d04fc5ec4be6f6d8189e138445736e6aee4 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 15:52:14 -0700 Subject: [PATCH 15/25] Link bug --- README-ro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-ro.md b/README-ro.md index b0cb8dc..caa0414 100644 --- a/README-ro.md +++ b/README-ro.md @@ -13,7 +13,7 @@ - [Bazele](#bazele) - [Folosire zilnică](#folosire-zilnică) - [Procesarea fișierelor și a datelor](#procesarea-fișierelor-și-a-datelor) -- [Depanarea sistemului](#depanarea sistemului) +- [Depanarea sistemului](#depanarea-sistemului) - [Comenzi de o linie](#comenzi-de-o-linie) - [Obscure dar utile](#obscure-dar-utile) - [Doar pentru OS X](#doar-pentru-os-x) From 2da53a39e020dec0a97bfc752fb13d085b45f0b6 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 16:28:34 -0700 Subject: [PATCH 16/25] Finalize --- README-ro.md | 84 ++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/README-ro.md b/README-ro.md index caa0414..41f5bbf 100644 --- a/README-ro.md +++ b/README-ro.md @@ -337,38 +337,38 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir `lsof | grep deleted | grep "filename-of-my-big-file"` -## One-liners +## Comenzi-de-o-linie -A few examples of piecing together commands: +Câteva exemple de a construi comenzi complicate din comenzi simple: -- It is remarkably helpful sometimes that you can do set intersection, union, and difference of text files via `sort`/`uniq`. Suppose `a` and `b` are text files that are already uniqued. This is fast, and works on files of arbitrary size, up to many gigabytes. (Sort is not limited by memory, though you may need to use the `-T` option if `/tmp` is on a small root partition.) See also the note about `LC_ALL` above and `sort`'s `-u` option (left out for clarity below). +- Este foarte util uneori că puteți trata fișierele ca mulțimi de rânduri și puteți implementa operațiile pe mulțimi -- intersecție, reuniune și diferență -- folosind `sort`/`uniq`. Presupunând că `a` și `b` sunt fișiere text fără linii duplicate, următoarele comenzi sunt foarte rapide și procesează fișiere de dimensiuni gigantice (`sort` nu este limitat de memorie dar este preferabil să folosiți `-T` dacă `/tmp` este pe o partiție mică). De asemenea, nu uitați de nota despre `LC_ALL` (localizare) de mai sus și de opțiunea `-u` (eliminată mai jos pentru claritate): ```sh cat a b | sort | uniq > c # c is a union b cat a b | sort | uniq -d > c # c is a intersect b cat a b b | sort | uniq -u > c # c is set difference a - b ``` -- Use `grep . *` to quickly examine the contents of all files in a directory (so each line is paired with the filename), or `head -100 *` (so each file has a heading). This can be useful for directories filled with config settings like those in `/sys`, `/proc`, `/etc`. +- Folosiți `grep . *` pentru a examina rapid conținutul fișierelor din director (fiecare linie este împrecheată cu fișierul din care provine) sau `head -100 *` (fiecare fișier are un header). Este un sfat util pentru directoare conținând setări precum `/sys`, `/proc`, `/etc`. -- Summing all numbers in the third column of a text file (this is probably 3X faster and 3X less code than equivalent Python): +- Suma tuturor numerelor din a 3-a coloană a unui fișier (probabil de 3 ori mai rapid și de 3 ori mai puțin cod decât codul Python echivalent): ```sh awk '{ x += $3 } END { print x }' myfile ``` -- To see sizes/dates on a tree of files, this is like a recursive `ls -l` but is easier to read than `ls -lR`: +- Pentru a vedea dimensiunile și data fiecărui fișier dintr-un arbore, metoda următoare este ca un `ls -l` recursiv dar cu un output mai clar decât `ls -lR`: ```sh find . -type f -ls ``` -- Say you have a text file, like a web server log, and a certain value that appears on some lines, such as an `acct_id` parameter that is present in the URL. If you want a tally of how many requests for each `acct_id`: +- Presupunând că aveți un fișier text, de exemplu un jurnal al unui server web, și o anumită valoare apare pe câteva linii, precum o valoare pentru parametrul `acct_id` prezent în URL, dacă doriți un sumar pentru fiecare valoare a lui `acct_id`: ```sh cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn ``` -- To continuously monitor changes, use `watch`, e.g. check changes to files in a directory with `watch -d -n 2 'ls -rtlh | tail'` or to network settings while troubleshooting your wifi settings with `watch -d -n 2 ifconfig`. +- Pentru a monitoriza schimbările folosiți `watch`. De exemplu, verificați schimbările dintr-un director cu `watch -d -n 2 'ls -rtlh | tail'` sau setările de rețea în timp ce depanați probleme cu conexiunea wireless: `watch -d -n 2 ifconfig`. -- Run this function to get a random tip from this document (parses Markdown and extracts an item): +- Folosiți această funcție pentru a obține un sfat aleator din acest document (parsează formatul Markdown și extrage un item): ```sh function taocl() { curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | @@ -531,66 +531,66 @@ A few examples of piecing together commands: - `fortune`, `ddate`, și `sl`: depinde dacă considerați locomotive și citate "utile" (utilitare distractive) -## OS X only +## Doar pentru OS X -These are items relevant *only* on OS X. +Aceste sfaturi sunt relevante *doar* pentru OS X. -- Package management with `brew` (Homebrew) and/or `port` (MacPorts). These can be used to install on OS X many of the above commands. +- Managementul pachetelor cu `brew` (Homebrew) și/sau `port` (MacPorts). Aceste comenzi pot fi folosit pentru a instala multe din comenzile de mai sus pe un Mac. -- Copy output of any command to a desktop app with `pbcopy` and paste input from one with `pbpaste`. +- Copiați outputul unei comenzi către aplicații desktop cu `pbcopy` și lipiți conținutul de la una cu `pbpaste`. -- To enable the Option key in OS X Terminal as an alt key (such as used in the commands above like **alt-b**, **alt-f**, etc.), open Preferences -> Profiles -> Keyboard and select "Use Option as Meta key". +- Pentru a mapa tasta Option în OS X Terminal ca o tastă Alt (pentru comenzile de mai sus precum **alt-b**, **alt-f**, etc.), deschideți Preferences -> Profiles -> Keyboard și selectați "Use Option as Meta key" ("Folosește Option ca tastă Meta"). -- To open a file with a desktop app, use `open` or `open -a /Applications/Whatever.app`. +- Pentru a deschide un fișier cu o aplicație desktop folosiți`open` sau `open -a /Applications/Whatever.app`. -- Spotlight: Search files with `mdfind` and list metadata (such as photo EXIF info) with `mdls`. +- Spotlight: Găsiți fișiere cu `mdfind` și listați meta-date (de exemplu informații EXIF din fotografii) cu `mdls`. -- Be aware OS X is based on BSD Unix, and many commands (for example `ps`, `ls`, `tail`, `awk`, `sed`) have many subtle variations from Linux, which is largely influenced by System V-style Unix and GNU tools. You can often tell the difference by noting a man page has the heading "BSD General Commands Manual." In some cases GNU versions can be installed, too (such as `gawk` and `gsed` for GNU awk and sed). If writing cross-platform Bash scripts, avoid such commands (for example, consider Python or `perl`) or test carefully. +- Țineți minte că OS X este la bază un BSD Unix, și multe comenzi (de exemplu `ps`, `ls`, `tail`, `awk`, `sed`) au un număr de variațiuni subtile comparativ cu Linux, un fapt influențat de diferențele între System V-style Unix și utilitarele GNU. Puteți vedea diferențele observând dacă pagina de manual are antetul "BSD General Commands Manual" ("Manual de comenzi generale BSD"). În unele cazuri, versiunile GNU pot fi instalate în paralel (precum `gawk` și `gsed` pentru GNU awk și sed). În scrierea de aplicații independente de platformă, evitați aceste comenzi (de exemplu folosiți Python sau `perl`) sau testați cu atenție. -- To get OS X release information, use `sw_vers`. +- Informații despre versiunea OS X se pot obține cu `sw_vers`. -## Windows only +## Doar pentru Windows -These items are relevant *only* on Windows. +Aceste sfaturi sunt relevante *doar* pentru Windows. -- On Windows 10, you can use [Bash on Ubuntu on Windows](https://msdn.microsoft.com/commandline/wsl/about), which provides a familiar Bash environment with Unix command line utilities. On the plus side, this allows Linux programs to run on Windows. On the other hand this does not support the running of Windows programs from the Bash prompt. +- În Windows 10, puteți folosi [Bash în Ubuntu în Windows](https://msdn.microsoft.com/commandline/wsl/about), pentru a obține mediul Bash familiar cu comenzile și utilitățile Unix descrise anterior. Ca bonus, acest lucru permite ca programele Linux să ruleze pe Windows. Pe de altă parte, nu puteți rula programe Windows din prompt-ul Bash. -- Access the power of the Unix shell under Microsoft Windows by installing [Cygwin](https://cygwin.com/). Most of the things described in this document will work out of the box. +- Puteți accesa shell-ul Unix sub Windows prin instalarea [Cygwin](https://cygwin.com/). Multe din lucrurile descrise aici vor funcționa implicit. -- Install additional Unix programs with the Cygwin's package manager. +- Programele Unix adiționale se vor instala cu managerul de pachete al lui Cygwin. -- Use `mintty` as your command-line window. +- Folosiți `mintty` ca fereastra de comenzi. -- Access the Windows clipboard through `/dev/clipboard`. +- Accesați clipboard-ul Windows prin intermediul `dev/clipboard`. -- Run `cygstart` to open an arbitrary file through its registered application. +- Folosiți `cygstart` pentru a deschide un fișier arbitrar cu aplicația corespunzătoare -- Access the Windows registry with `regtool`. +- Accesați registrele Windows cu `regtool`. -- Note that a `C:\` Windows drive path becomes `/cygdrive/c` under Cygwin, and that Cygwin's `/` appears under `C:\cygwin` on Windows. Convert between Cygwin and Windows-style file paths with `cygpath`. This is most useful in scripts that invoke Windows programs. +- Observați că o cale de tip `C:\` în Windows devine `/cygdrive/c` sub Cygwin, și că root-ul Cygwin, `/`, apare ca `C:\cygwin` pe Windows. convertiți între căile Cygwin și Windows cu `cygpath`. Acest lucru este util în scripturile care apelează programe Windows. -- You can perform and script most Windows system administration tasks from the command line by learning and using `wmic`. +- Puteți executa majoritatea task-urilor de administrare a sistemului Windows din linia de comandă prin învățarea și folosirea `wmic`. -- Another option to get Unix look and feel under Windows is [Cash](https://github.com/dthree/cash). Note that only very few Unix commands and command-line options are available in this environment. +- O altă opțiune de a obtine un sistem similar Unix sub Windows este [Cash](https://github.com/dthree/cash). Țineți cont că doar câte utilitare Unix sunt în prezent disponibile în acest mediu. -- An alternative option to get GNU developer tools (such as GCC) on Windows is [MinGW](http://www.mingw.org/) and its [MSYS](http://www.mingw.org/wiki/msys) package, which provides utilities such as bash, gawk, make and grep. MSYS doesn't have all the features compared to Cygwin. MinGW is particularly useful for creating native Windows ports of Unix tools. +- O altă opțiune alternativă este să obțineți instrumentele de dezvoltare GNU (precum GCC) cu [MinGW](http://www.mingw.org/) și pachetul [MSYS](http://www.mingw.org/wiki/msys). Astfel veți obtine utilitare precum `bash`, `gawk`, `make` și `grep`. MSYS nu are toate beneficiile Cygwin dar este util în particular pentru a crea versiuni de Windows pentru instrumentele Unix. -## More resources +## Mai multe resurse -- [awesome-shell](https://github.com/alebcay/awesome-shell): A curated list of shell tools and resources. -- [awesome-osx-command-line](https://github.com/herrbischoff/awesome-osx-command-line): A more in-depth guide for the OS X command line. -- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for writing better shell scripts. -- [shellcheck](https://github.com/koalaman/shellcheck): A shell script static analysis tool. Essentially, lint for bash/sh/zsh. -- [Filenames and Pathnames in Shell](http://www.dwheeler.com/essays/filenames-in-shell.html): The sadly complex minutiae on how to handle filenames correctly in shell scripts. -- [Data Science at the Command Line](http://datascienceatthecommandline.com/#tools): More commands and tools helpful for doing data science, from the book of the same name +- [awesome-shell](https://github.com/alebcay/awesome-shell): O listă detaliată a instrumentelor și resurselor pentru shell. +- [awesome-osx-command-line](https://github.com/herrbischoff/awesome-osx-command-line): Un ghid mai detaliat pentru folosirea liniei de comandă sub OS X +- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) pentru a scrie scripturi mai bune.. +- [shellcheck](https://github.com/koalaman/shellcheck): Un utilitar pentru analiza statică a scripturilor. În esență, `lint` pentru bash/sh/zsh. +- [Filenames and Pathnames in Shell](http://www.dwheeler.com/essays/filenames-in-shell.html): Detalii complete despre situația tristă în folosirea căilor către fișiere corect în scripturi independente de platformă +- [Data Science at the Command Line](http://datascienceatthecommandline.com/#tools): Mai multe comenzi și utilitare disponibile pentru analiza datelor, după cartea cu același nume. -## Disclaimer +## Anunț legal -With the exception of very small tasks, code is written so others can read it. With power comes responsibility. The fact you *can* do something in Bash doesn't necessarily mean you should! ;) +Cu excepția unor task-uri foarte mici, codul scris aici este pentru ca alții să-l poate citi. Cu putere vine și responsabilitate. Faptul că *puteți* face cava în Bash nu înseamnă neapărat că și trebuie să-l faceți ;) -## License +## Licență [![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/) -This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). +Această muncă este licențiată sub [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). From 40d0bbbc8a17fa20ac869d856d5f46393e2a43d6 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 16:30:03 -0700 Subject: [PATCH 17/25] Add Romanian language --- README-ro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-ro.md b/README-ro.md index 41f5bbf..47cdb66 100644 --- a/README-ro.md +++ b/README-ro.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Arta liniei de comandă @@ -337,7 +337,7 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir `lsof | grep deleted | grep "filename-of-my-big-file"` -## Comenzi-de-o-linie +## Comenzi de o linie Câteva exemple de a construi comenzi complicate din comenzi simple: From 2848c8bd80eec9f9922f06f6f0bc9793ade93f60 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 29 Oct 2016 16:33:40 -0700 Subject: [PATCH 18/25] Add Romanian links in all files --- README-cs.md | 2 +- README-de.md | 2 +- README-el.md | 2 +- README-es.md | 2 +- README-fr.md | 2 +- README-it.md | 2 +- README-ja.md | 2 +- README-ko.md | 2 +- README-pt.md | 2 +- README-ru.md | 2 +- README-sl.md | 2 +- README-uk.md | 2 +- README-zh-Hant.md | 2 +- README-zh.md | 2 +- README.md | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README-cs.md b/README-cs.md index 33cfddf..6c3757b 100644 --- a/README-cs.md +++ b/README-cs.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Umění příkazové řádky diff --git a/README-de.md b/README-de.md index 6e3d9ba..1d7d31a 100644 --- a/README-de.md +++ b/README-de.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line diff --git a/README-el.md b/README-el.md index e7b3861..b250700 100644 --- a/README-el.md +++ b/README-el.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Η Τέχνη της Γραμμής Εντολών diff --git a/README-es.md b/README-es.md index fbfd016..9bb32ec 100644 --- a/README-es.md +++ b/README-es.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # El Arte del Terminal diff --git a/README-fr.md b/README-fr.md index 4e03ca5..fbabe11 100644 --- a/README-fr.md +++ b/README-fr.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # L'art de la ligne de commande diff --git a/README-it.md b/README-it.md index 40b650f..ca4bf57 100644 --- a/README-it.md +++ b/README-it.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line (Traduzione Italiana) diff --git a/README-ja.md b/README-ja.md index dda5fd3..154d465 100644 --- a/README-ja.md +++ b/README-ja.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* 原文のコミット [ee4b00bc396087d27231f60512aeb77b19ce734e](https://github.com/jlevy/the-art-of-command-line/blob/ee4b00bc396087d27231f60512aeb77b19ce734e/README.md) diff --git a/README-ko.md b/README-ko.md index 992233a..e090e81 100644 --- a/README-ko.md +++ b/README-ko.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line diff --git a/README-pt.md b/README-pt.md index 3df275e..93a8d09 100644 --- a/README-pt.md +++ b/README-pt.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # A arte da linha de comando diff --git a/README-ru.md b/README-ru.md index 91a9251..97bd7b3 100644 --- a/README-ru.md +++ b/README-ru.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Искусство командной строки diff --git a/README-sl.md b/README-sl.md index c936a50..de8157d 100644 --- a/README-sl.md +++ b/README-sl.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Umetnost ukazne vrstice diff --git a/README-uk.md b/README-uk.md index bf17d4c..ee6ae60 100644 --- a/README-uk.md +++ b/README-uk.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # Мистецтво командного рядка diff --git a/README-zh-Hant.md b/README-zh-Hant.md index 16fa13a..c880905 100644 --- a/README-zh-Hant.md +++ b/README-zh-Hant.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # 命令列的藝術 diff --git a/README-zh.md b/README-zh.md index c205e72..dc4b14f 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # 命令行的艺术 diff --git a/README.md b/README.md index 9cd79cb..18506ae 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ 🌍 -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* # The Art of Command Line From 5aea50961b93c80b36137c1148f12cdfbaf71b20 Mon Sep 17 00:00:00 2001 From: Ilja Krauchanka Date: Sun, 30 Oct 2016 05:39:19 +0300 Subject: [PATCH 19/25] Update README-ru.md --- README-ru.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-ru.md b/README-ru.md index 91a9251..7576b21 100644 --- a/README-ru.md +++ b/README-ru.md @@ -567,7 +567,7 @@ mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir ## Дисклеймер -За небольшим исключением, весь код написан так, чтобы другие его смогли прочитать. С большой силой приходит большая ответственность. Из того, что вы *способны* что-то сделать в Баше, вовсе не следует, что это нужно делать! ;) +За небольшим исключением, весь код написан так, чтобы другие его смогли прочитать. С большой силой приходит большая ответственность. Из того, что вы *способны* что-то сделать в Баше, вовсе не означает, что это нужно делать! ;) ## Лицензия From 255d0ed4e527d545b28eaccf14e83ccd3c35a59c Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sun, 30 Oct 2016 09:21:05 -0700 Subject: [PATCH 20/25] Fix typos, add advices from @bgdnlp's review --- README-ro.md | 58 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/README-ro.md b/README-ro.md index 47cdb66..9ab859a 100644 --- a/README-ro.md +++ b/README-ro.md @@ -18,7 +18,7 @@ - [Obscure dar utile](#obscure-dar-utile) - [Doar pentru OS X](#doar-pentru-os-x) - [Doar pentru Windows](#doar-pentru-windows) -- [Mai multe resourse](#mai-multe-resurse) +- [Mai multe resurse](#mai-multe-resurse) - [Anunț legal](#anunț-legal) @@ -31,7 +31,7 @@ Multe dintre aceste sfaturi [au apărut](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands) [original](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) pe [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), -și au fost mutat pe GitHub ulteror, unde alți oameni talentați au produs numeroase îmbunătățiri. +și au fost mutate pe GitHub ulterior, unde alți oameni talentați au produs numeroase îmbunătățiri. [**Vă rugăm întrebați**](https://airtable.com/shrzMhx00YiIVAWJg) dacă aveți nelămuriri legate de linia de comandă. [**Contribuiți**](/CONTRIBUTING.md) dacă identificați o eroare sau ceva ce ar putea fi îmbunătățit! ## Meta @@ -40,13 +40,13 @@ Scop: - Acest ghid este atât pentru începători cât și pentru avansați. Scopurile sunt *acoperire* (tot ce este important), *specificitate* (oferirea exemplelor concrete pentru cazurilor comune) și *brevitate* (neincluderea lucrurilor neesențiale sau a digresiunilor ce pot fi găsite ușor în alte părți). Fiecare sfat este esențial în câteva situații sau reduce semnificativ timpul necesar efectuării unei cerințe comparativ cu celelalte alternative. - Ghidul este scris pentru Linux, cu excepția secțiunilor "[Doar pentru OS X](#doar-pentru-os-x)" și "[Doar pentru Windows](#doar-pentru-windows)". Majoritatea sfaturilor din celelate secțiuni se aplică/pot fi instalate pe alte sisteme Unix sau OS X (chiar și în Cygwin). -- Scopul este pe Bash interactiv, chiar dacă unele sfaturi sunt aplicabile și altor shell-uri sau pentru Bash-scripting în general. +- Se pune accent pe Bash interactiv, chiar dacă unele sfaturi sunt aplicabile și altor shell-uri sau pentru Bash-scripting în general. - Atât comenzile Unix "standard" cât și cele care necesită instalarea de pachete speciale sunt incluse -- cât timp sfaturile sunt destul de importante cât să merite incluziunea. Note: - Pentru a păstra totul într-o singură pagină, conținutul este inclus implicit doar prin referințe. Suntem siguri că puteți căuta mai multe detalii după ce aveți ideea/comanda după care să căutați. Folosiți `apt-get`, `yum`, `dnf`, `pacman`, `pip` sau `brew` (după caz) pentru a instala programe noi. -- Folosiți [Explainshell](http://explainshell.com/) pentru a obține un util îndrumar în ce anumite comenzi, opțiuni, etc. fac. +- Folosiți [Explainshell](http://explainshell.com/) pentru a obține explicații utile despre ce fac anumite comenzi, opțiuni, etc. ## Bazele @@ -55,9 +55,9 @@ Note: - Învățați cel puțin un editor de text. Ideal Vim (`vi`), cum nu există un competitor real pentru editarea în terminal (chiar dacă folosiți Emacs, sau un editor modern în majoritatea timpului). -- Învățați să citiți documentație cu `man` (pentru curiouși, `man man` listează secțiunile, de exemplu 1 este pentru comenzi "uzuale", 5 este pentru fișiere/convenții și 8 pentru administrare). Găsiți pagini de manual cu `apropos`. Rețineți că anumite comenzi nu sunt executable ci comenzi interne în Bash și că puteți obține ajutor despre ele cu `help` sau `help -d`. Puteți vedea dacă o comandă este internă, executabilă sau doar un alias prin folosirea `type command`. +- Învățați să citiți documentație cu `man` (pentru curiouși, `man man` listează secțiunile, de exemplu 1 este pentru comenzi "uzuale", 5 este pentru fișiere/convenții și 8 pentru administrare). Găsiți pagini de manual cu `apropos`. Rețineți că anumite comenzi nu sunt programe executabile ci comenzi interne în Bash și că puteți obține ajutor despre ele cu `help` sau `help -d`. Puteți vedea dacă o comandă este internă, executabilă sau doar un alias prin folosirea `type command`. -- Învățați despre redirectarea intrării și ieșirii folosint `>` și `<` și pipe-uri cu `|`. Rețineți că `>` suprascrie fișierul și `>>` adaugă la final. Învățați despre ieșirea standard și ieșirea de eroare standard. +- Învățați despre redirecționarea intrării și ieșirii folosind `>` și `<` și pipe-uri cu `|`. Rețineți că `>` suprascrie fișierul și `>>` adaugă la final. Învățați despre ieșirea standard și ieșirea de eroare standard. - Învățați despre expandarea numelor de fișiere cu `*` (și poate `?` și `[`...`]`) și despre folosirea și diferențele dintre `"` și `'`. (Vedeți mai multe în secțiunea despre expandarea variabilelor mai jos). @@ -78,7 +78,7 @@ Note: ## Folosire zilnică -- În Bash, folosiți **Tab** pentru a completa argumente sau a lista comenzile disponibile și **ctrl-r** pentru a căuta în istoricul comenzilor (după apăsare, tastați ce căutați și apăsați repetat **ctrl-r** pentru a cicla prin lista de potriviti, apăsați **Enter** pentru a executa comanda găsită sau săgeată dreapta pentru a putea edita linia curentă). +- În Bash, folosiți **Tab** pentru a completa argumente sau a lista comenzile disponibile și **ctrl-r** pentru a căuta în istoricul comenzilor (după apăsare, tastați ce căutați și apăsați repetat **ctrl-r** pentru a cicla prin lista de potriviri, apăsați **Enter** pentru a executa comanda găsită sau săgeată dreapta pentru a putea edita linia curentă). - În Bash, folosiți **ctrl-w** pentru a șterge ultimul cuvânt și **ctrl-u** pentru a șterge până la începutul liniei. Folosiți **alt-b** și **alt-f** pentru a naviga cuvânt-cu-cuvânt, **ctrl-a** pentru a muta cursorul la începutul liniei, **ctrl-e** pentru a-l muta la final, **ctrl-k** pentru a șterge până la finalul liniei, **ctrl-l** pentru a curăța tot ecranul. Vizualizați `man readline` pentru a vedea toate tastele implicite din Bash. Sunt o mulțime. De exemplu, **alt-.** ciclează prin toate argumentele anterioare și **alt-*** expandează un glob pattern. @@ -123,7 +123,7 @@ Note: - Sincronizați fișierele de configurare (e.g. `.bashrc` and `.bash_profile`) între mai multe calculatoare folosind Git. -- Tratați cu atenți cazurile când variabilele și fișierele conțin spații. Folosiți ghilimele în acest caz, de exemplu `"$FOO"`. Preferați să folosiți opțiunile `-0` sau `-print0` pentru a folosi caracterul null pentru a delimita fișierele, de exemplu `locate -0 pattern | xargs -0 ls -al` sau `find / -print0 -type d | xargs -0 ls -al`. Pentru a parcurge o listă de fișiere conținând spații într-o buclă for, setați variabile IFS la terminatorul de linie, `IFS=$'\n'`. +- Tratați cu atenție cazurile când variabilele și fișierele conțin spații. Folosiți ghilimele în acest caz, de exemplu `"$FOO"`. Preferați să folosiți opțiunile `-0` sau `-print0` pentru a folosi caracterul null pentru a delimita fișierele, de exemplu `locate -0 pattern | xargs -0 ls -al` sau `find / -print0 -type d | xargs -0 ls -al`. Pentru a parcurge o listă de fișiere conținând spații într-o buclă for, setați variabile IFS la terminatorul de linie, `IFS=$'\n'`. - În scripturile Bash, folosiți `set -x` (sau varianta `set -v`, care produce informație neprocesată, inclusiv variabile neexpandate și comentarii) pentru a depana outputul. Folosiți modurile strice exceptând când aveți un motiv foarte bun împotrivă: folosiți `set -e` pentru a termina execuția în caz de eroare (cod de ieșire nenul). Folosiți `set -u` pentru a detecta variable nesetate. Considerați folosirea `set -o pipefail` pentru erorile cauzate de folosirea eronată a pipe-urilor. Pentru scripturi mai complicate, folosiți `trap` pentru EXIT sau ERR. Un obicei util este să începeți scriptul într-o modalitate care va permite detecția facilă a erorilor și terminarea execuției cu un mesaj: ```bash @@ -140,7 +140,7 @@ Note: - În Bash, există mai multe variante de expandare a variabilelor. Verifacți dacă o variabilă există: `${name:?error message}`. De exemplu, dacă un script necesită un argument unic, folosiți `input_file=${1:?usage: $0 input_file}`. Folosți o valoare implicită pentru cazul când o variabilă este goală: `${name:-default}`. Pentru parametri opționali în exemplul anterior, folosiți `output_file=${2:-logfile}`. Dacă `$2` este omis (gol), `output_file` va fi setat la `logfile`. Expandare aritmetică: `i=$(( (i + 1) % 5 ))`. Secvențe: `{1..10}`. Tăierea unor secvențe din șiruri: `${var%suffix}` și `${var#prefix}`. De exemplu, dacă `var=foo.pdf`, atunci `echo ${var%.pdf}.txt` va scrie `foo.txt`. -- Expandarea parantezelor folosind `{`...`}` previne re-tastarea textelor similare, automatizând combinațiile de itemuri. Este util în exemple precum `mv foo.{txt,pdf} some-dir` (care mută ambele fișiere), `cp somefile{,.bak}` (care se expandează la `cp somefile somefile.bak`) sau `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (care expandează toate combinațiile posibile și creează arborele de directoare). +- Expandarea parantezelor folosind `{`...`}` previne re-tastarea textelor similare, automatizând combinațiile de elemente. Este util în exemple precum `mv foo.{txt,pdf} some-dir` (care mută ambele fișiere), `cp somefile{,.bak}` (care se expandează la `cp somefile somefile.bak`) sau `mkdir -p test-{a,b,c}/subtest-{1,2,3}` (care expandează toate combinațiile posibile și creează arborele de directoare). - Outputul unei comenzi poate fi tratat ca un fișier cu `<(some command)`. De exemplu, pentru a compara fișierul `/etc/hosts` local cu unul la distanță: ```sh @@ -156,15 +156,15 @@ Note: - Folosiți "here documents", de exemplu `cat <logfile 2>&1` sau `some-command &>logfile`. De regulă, pentru a vă asigura că o comandă nu lasă un fișier deschis, fiind legată de terminalul curent, este o practică bună să adăugați `logfile 2>&1` sau `some-command &>logfile`. De regulă, pentru a vă asigura că o comandă nu lasă un fișier deschis, fiind legată de terminalul curent, este o practică bună să adăugați `>> 2+3 5 @@ -206,13 +206,13 @@ Note: ## Procesarea fișierelor și a datelor -- Pentru a localiza un fișier după nume, în directorul curend, `find . -iname '*something*'` (sau similar). Pentru a găsi un fișier oriunde, `locate something` (dar țineți cont de faptul că `updatedb` s-ar putea să nu fi indexat fișierele recente). +- Pentru a localiza un fișier după nume, în directorul curent, `find . -iname '*something*'` (sau similar). Pentru a găsi un fișier oriunde, `locate something` (dar țineți cont de faptul că `updatedb` s-ar putea să nu fi indexat fișierele recente). - Pentru a căuta în interiorul fișierelor (mai avansat decât `grep -r`), folosiți [`ag`](https://github.com/ggreer/the_silver_searcher). - Pentru a converti HTML la text: `lynx -dump -stdin` -- For Markdown, HTML, and all kinds of document conversion, try [`pandoc`](http://pandoc.org/). +- Pentru Markdown, HTML, și alte conversii de documente, folosiți [`pandoc`](http://pandoc.org/). - Dacă trebuie să folosiți XML, `xmlstarlet` e vechi dar util. @@ -238,7 +238,7 @@ Note: - Puteți seta localizarea specifică unei comenzi prin prefixarea acesteia cu variabila de mediu corespunzătoare, ca în `TZ=Pacific/Fiji date`. -- Pentru procesare de bază a textelor, folosiți `awk` și `sed`. De exemplu, pentur a aduna suma numerelor din coloana a treia a unui fișier `awk '{ x += $3 } END { print x }'` este de 3 ori mai rapid și mai scurt decât codul echivalent în Python. +- Pentru procesare de bază a textelor, folosiți `awk` și `sed`. De exemplu, pentru a aduna suma numerelor din coloana a treia a unui fișier `awk '{ x += $3 } END { print x }'` este de 3 ori mai rapid și mai scurt decât codul echivalent în Python. - Pentru a înlocui toate aparițiile unui șir, în cel puțin un fișier: ```sh @@ -255,14 +255,14 @@ Note: rename 's/\.bak$//' *.bak ``` -- După cum zice și pagina de manual, `rsync` este un utilitar foarte rapid, eficient și versatil de a copia fișiere. Este cunoscut pentru sincronizarea între calculatoare dar poate fi folosit și local. Dacă setăruile de securitate permit, folosirea `rsync` în loc de `scp` permite continuarea unui transfer eșuat fără a-l reporni. Este și una dintre cele [mai rapide metode](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) de a șterge un număr masiv de fișiere: +- După cum zice și pagina de manual, `rsync` este un utilitar foarte rapid, eficient și versatil de a copia fișiere. Este cunoscut pentru sincronizarea între calculatoare dar poate fi folosit și local. Dacă setările de securitate permit, folosirea `rsync` în loc de `scp` permite continuarea unui transfer eșuat fără a-l reporni. Este și una dintre cele [mai rapide metode](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) de a șterge un număr masiv de fișiere: ```sh mkdir empty && rsync -r --delete empty/ some-dir && rmdir some-dir ``` - Folosiți `shuf` pentru a permuta sau selecta linii aleatoare dintr-un fișier. -- Învățați opțiunile lui `sort`. ForPentru numere folosiți `-n`, sau `-h` pentru numere în format human-readable (de exemplu numere produse de `du -h`). Învățați cum funcționează cheile de sortare (`-t` și `-k`). În special, țineți cont că trebuie să scrieți `-k1,1` pentru a sorta doar prima coloană, `-k1` înseamnă sortare după toată linia. Sortarea stabilă (`sort -s`) poate fi utilă. De exemplu, pentru a sorta după câmpul 2 și apoi după 1: `sort -k1,1 | sort -s -k2,2`. +- Învățați opțiunile lui `sort`. Pentru numere folosiți `-n`, sau `-h` pentru numere în format human-readable (de exemplu numere produse de `du -h`). Învățați cum funcționează cheile de sortare (`-t` și `-k`). În special, țineți cont că trebuie să scrieți `-k1,1` pentru a sorta doar prima coloană, `-k1` înseamnă sortare după toată linia. Sortarea stabilă (`sort -s`) poate fi utilă. De exemplu, pentru a sorta după câmpul 2 și apoi după 1: `sort -k1,1 | sort -s -k2,2`. - Dacă sunteți nevoiți să scrieți un caracter tab în terminal (de exemplu pentru argumentul `-t` al `sort`) apăsați **ctrl-v** **[Tab]** sau scrieți `$'\t'` (ultima versiune e mai bună pentru că permite și copy/paste). @@ -348,7 +348,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: cat a b b | sort | uniq -u > c # c is set difference a - b ``` -- Folosiți `grep . *` pentru a examina rapid conținutul fișierelor din director (fiecare linie este împrecheată cu fișierul din care provine) sau `head -100 *` (fiecare fișier are un header). Este un sfat util pentru directoare conținând setări precum `/sys`, `/proc`, `/etc`. +- Folosiți `grep . *` pentru a examina rapid conținutul fișierelor din director (fiecare linie este împerecheată cu fișierul din care provine) sau `head -100 *` (fiecare fișier are un header). Este un sfat util pentru directoare conținând setări precum `/sys`, `/proc`, `/etc`. - Suma tuturor numerelor din a 3-a coloană a unui fișier (probabil de 3 ori mai rapid și de 3 ori mai puțin cod decât codul Python echivalent): @@ -382,7 +382,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: ## Obscure dar utile -- `expr`: execută operații aritmetice sau boleene și expandează expresii regulate +- `expr`: execută operații aritmetice sau logice și expandează expresii regulate - `m4`: procesor simplu de macro-uri @@ -436,7 +436,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: - `time`: execută și cronometrează o comandă -- `timeout`: execută o comandă până la expirarea unei cantițăți de timp, omorând procesul la finalul timpului alocat +- `timeout`: execută o comandă până la expirarea unui timp definit, omorând procesul la finalul timpului alocat - `lockfile`: creează un fișier semafor care nu poate fi șters decât cu `rm -f` @@ -478,7 +478,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: - `strace`: depanare apeluri de sistem -- [`mtr`](http://www.bitwizard.nl/mtr/): alternative mai bună pentru `traceroute` pentru depanarea rețelei +- [`mtr`](http://www.bitwizard.nl/mtr/): alternativă mai bună pentru `traceroute` pentru depanarea rețelei - `cssh`: shell vizual, concurent @@ -508,7 +508,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: - `w`: cine este logged-in -- `id`: informații despre useri/grupuri +- `id`: informații despre utilizatori/grupuri - [`sar`](http://sebastien.godard.pagesperso-orange.fr/): istoria statisticilor despre sistem @@ -535,7 +535,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: Aceste sfaturi sunt relevante *doar* pentru OS X. -- Managementul pachetelor cu `brew` (Homebrew) și/sau `port` (MacPorts). Aceste comenzi pot fi folosit pentru a instala multe din comenzile de mai sus pe un Mac. +- Managementul pachetelor cu `brew` (Homebrew) și/sau `port` (MacPorts). Aceste comenzi pot fi folosite pentru a instala multe din comenzile de mai sus pe un Mac. - Copiați outputul unei comenzi către aplicații desktop cu `pbcopy` și lipiți conținutul de la una cu `pbpaste`. @@ -567,11 +567,11 @@ Aceste sfaturi sunt relevante *doar* pentru Windows. - Accesați registrele Windows cu `regtool`. -- Observați că o cale de tip `C:\` în Windows devine `/cygdrive/c` sub Cygwin, și că root-ul Cygwin, `/`, apare ca `C:\cygwin` pe Windows. convertiți între căile Cygwin și Windows cu `cygpath`. Acest lucru este util în scripturile care apelează programe Windows. +- Observați că o cale de tip `C:\` în Windows devine `/cygdrive/c` sub Cygwin, și că root-ul Cygwin, `/`, apare ca `C:\cygwin` pe Windows. Convertiți între căile Cygwin și Windows cu `cygpath`. Acest lucru este util în scripturile care apelează programe Windows. - Puteți executa majoritatea task-urilor de administrare a sistemului Windows din linia de comandă prin învățarea și folosirea `wmic`. -- O altă opțiune de a obtine un sistem similar Unix sub Windows este [Cash](https://github.com/dthree/cash). Țineți cont că doar câte utilitare Unix sunt în prezent disponibile în acest mediu. +- O altă opțiune de a obține un sistem similar Unix sub Windows este [Cash](https://github.com/dthree/cash). Țineți cont că doar câte utilitare Unix sunt în prezent disponibile în acest mediu. - O altă opțiune alternativă este să obțineți instrumentele de dezvoltare GNU (precum GCC) cu [MinGW](http://www.mingw.org/) și pachetul [MSYS](http://www.mingw.org/wiki/msys). Astfel veți obtine utilitare precum `bash`, `gawk`, `make` și `grep`. MSYS nu are toate beneficiile Cygwin dar este util în particular pentru a crea versiuni de Windows pentru instrumentele Unix. From 769ea693e1bccb713bff681141a9046071132805 Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Sun, 30 Oct 2016 19:45:34 -0700 Subject: [PATCH 21/25] Update authors. --- AUTHORS.md | 39 +++++++++++++++++++++------------------ admin/authors-info.yml | 3 +++ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index c134346..302dcba 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,25 +8,27 @@ They have kindly agreed to review and help update future contributions for the t * [0xCD](https://github.com/0xCD) — [4+](https://github.com/jlevy/the-art-of-command-line/commits?author=0xCD)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3A0xCD) +* [Ahmad Zafrullah (23Pstars)](https://github.com/23Pstars) — [3+](https://github.com/jlevy/the-art-of-command-line/commits?author=23Pstars)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3A23Pstars) — _translation maintainer (id)_ * [Adrian Abreu Gonzalez (aabreuglez)](https://github.com/aabreuglez) — [6+](https://github.com/jlevy/the-art-of-command-line/commits?author=aabreuglez)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aaabreuglez) * [Antonio Ossa (aaossa)](https://github.com/aaossa) — [5+](https://github.com/jlevy/the-art-of-command-line/commits?author=aaossa)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aaaossa) — _translator (es)_ +* [Haoxuan Li (accnme)](https://github.com/accnme) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=accnme)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aaccnme) * [Ahmet Alp Balkan (ahmetalpbalkan)](https://github.com/ahmetalpbalkan) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=ahmetalpbalkan)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aahmetalpbalkan) * [Semir Patel (analogue)](https://github.com/analogue) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=analogue)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aanalogue) * [Andreas Hofmann (andreas-hofmann)](https://github.com/andreas-hofmann) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=andreas-hofmann)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aandreas-hofmann) * [Desmond Stonie (aneasystone)](https://github.com/aneasystone) — [3+](https://github.com/jlevy/the-art-of-command-line/commits?author=aneasystone)/[8+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aaneasystone) -* [Haoxuan Li (angel1a)](https://github.com/angel1a) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=angel1a)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aangel1a) * [anna-4](https://github.com/anna-4) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=anna-4)/[0+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aanna-4) * [anna-d (anna-d)](https://github.com/anna-d) — [19+](https://github.com/jlevy/the-art-of-command-line/commits?author=anna-d)/[5+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aanna-d) — _translation maintainer (el)_ * [Chong Guo (Armour)](https://github.com/Armour) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=Armour)/[0+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AArmour) — _translator (zh)_ * [Brad Beyenhof (augmentedfourth)](https://github.com/augmentedfourth) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=augmentedfourth)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aaugmentedfourth) * [b-jazz (b-jazz)](https://github.com/b-jazz) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=b-jazz)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ab-jazz) * [bafoed](https://github.com/bafoed) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=bafoed)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Abafoed) +* [BogdanLp (bgdnlp)](https://github.com/bgdnlp) — _translator (ro)_ * [Alex Vergara Gil (BishopWolf)](https://github.com/BishopWolf) — [4+](https://github.com/jlevy/the-art-of-command-line/commits?author=BishopWolf)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3ABishopWolf) — _translator (es)_ * [Arturo Fernandez (bsnux)](https://github.com/bsnux) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=bsnux)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Absnux) * [Alex Cabrera (cabreraalex)](https://github.com/cabreraalex) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=cabreraalex)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Acabreraalex) * [Carlos Mantilla (ceoaliongroo)](https://github.com/ceoaliongroo) — [29+](https://github.com/jlevy/the-art-of-command-line/commits?author=ceoaliongroo)/[16+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aceoaliongroo) — _translation maintainer (es)_ * [Chris Kuehl (chriskuehl)](https://github.com/chriskuehl) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=chriskuehl)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Achriskuehl) -* [Corey "See More" Richardson (cmr)](https://github.com/cmr) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=cmr)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Acmr) +* [Corey "cmr" Richardson (cmr)](https://github.com/cmr) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=cmr)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Acmr) * [CodinCat (CodinCat)](https://github.com/CodinCat) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=CodinCat)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3ACodinCat) * [Colas BROUX (ColasBroux)](https://github.com/ColasBroux) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=ColasBroux)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AColasBroux) * [Colin Wang (colinwjd)](https://github.com/colinwjd) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=colinwjd)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Acolinwjd) @@ -35,7 +37,7 @@ They have kindly agreed to review and help update future contributions for the t * [Daniel t. (danasmera)](https://github.com/danasmera) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=danasmera)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adanasmera) * [Dmytro Danylevskyi (danylevskyi)](https://github.com/danylevskyi) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=danylevskyi)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adanylevskyi) * [Dave Loyall (daveloyall)](https://github.com/daveloyall) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=daveloyall)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adaveloyall) -* [Deborah Digges (Deborah-Digges)](https://github.com/Deborah-Digges) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=Deborah-Digges)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3ADeborah-Digges) +* [Deborah Gertrude Digges (Deborah-Digges)](https://github.com/Deborah-Digges) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=Deborah-Digges)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3ADeborah-Digges) * [Jamie Luck (delucks)](https://github.com/delucks) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=delucks)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adelucks) * [Dima Paloskin (dimapaloskin)](https://github.com/dimapaloskin) * [Michael Diamond (dimo414)](https://github.com/dimo414) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=dimo414)/[4+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adimo414) @@ -43,14 +45,14 @@ They have kindly agreed to review and help update future contributions for the t * [Hayato Matsuura (doublemarket)](https://github.com/doublemarket) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=doublemarket)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adoublemarket) — _translation maintainer (ja)_ * [Diomidis Spinellis (dspinellis)](https://github.com/dspinellis) — [12+](https://github.com/jlevy/the-art-of-command-line/commits?author=dspinellis)/[5+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Adspinellis) — _section maintainer (Windows)_ * [Vincent Wong (EaterOA)](https://github.com/EaterOA) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=EaterOA)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AEaterOA) -* [Éric Guirbal (ericguirbal)](https://github.com/ericguirbal) — [25+](https://github.com/jlevy/the-art-of-command-line/commits?author=ericguirbal)/[8+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aericguirbal) — _translation maintainer (fr)_ +* [Éric Guirbal (ericguirbal)](https://github.com/ericguirbal) — [28+](https://github.com/jlevy/the-art-of-command-line/commits?author=ericguirbal)/[10+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aericguirbal) — _translation maintainer (fr)_ * [Fernando Almeida (fernandoalmeida)](https://github.com/fernandoalmeida) — [8+](https://github.com/jlevy/the-art-of-command-line/commits?author=fernandoalmeida)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Afernandoalmeida) * [Yessou Sami (fnzv)](https://github.com/fnzv) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=fnzv)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Afnzv) * [Francesco Malatesta (francescomalatesta)](https://github.com/francescomalatesta) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=francescomalatesta)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Afrancescomalatesta) — _translation maintainer (it)_ * [Gaga Pan (gaga5lala)](https://github.com/gaga5lala) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=gaga5lala)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Agaga5lala) -* [Gernot Pointner (gernd)](https://github.com/gernd) — [6+](https://github.com/jlevy/the-art-of-command-line/commits?author=gernd)/[0+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Agernd) — _translator (de)_ +* [Gernot Pointner (gernd)](https://github.com/gernd) — [6+](https://github.com/jlevy/the-art-of-command-line/commits?author=gernd)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Agernd) — _translator (de)_ * [githubashto](https://github.com/githubashto) — _translator (ru)_ -* [Grigory Rechistov (grigory-rechistov)](https://github.com/grigory-rechistov) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=grigory-rechistov)/[0+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Agrigory-rechistov) — _translator (ru)_ +* [Grigory Rechistov (grigory-rechistov)](https://github.com/grigory-rechistov) — _translator (ru)_ * [Konstantin Gribov (grossws)](https://github.com/grossws) — [3+](https://github.com/jlevy/the-art-of-command-line/commits?author=grossws)/[6+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Agrossws) * [Ashhar Hasan (hashhar)](https://github.com/hashhar) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=hashhar)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ahashhar) * [Beau Hastings (hastinbe)](https://github.com/hastinbe) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=hastinbe)/[4+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ahastinbe) @@ -63,9 +65,9 @@ They have kindly agreed to review and help update future contributions for the t * [Igor Veksler (iveksl2)](https://github.com/iveksl2) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=iveksl2)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aiveksl2) * [J Alan Brogan (jalanb)](https://github.com/jalanb) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=jalanb)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajalanb) * [James Kolce (jameskolce)](https://github.com/jameskolce) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=jameskolce)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajameskolce) -* [Joshua Levy (jlevy)](https://github.com/jlevy) — [140+](https://github.com/jlevy/the-art-of-command-line/commits?author=jlevy)/[38+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajlevy) — _orignal author and project maintainer_ -* [Jesse Sightler (jsight)](https://github.com/jsight) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=jsight)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajsight) -* [Konstantin Mikhaylov (jtraub)](https://github.com/jtraub) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=jtraub)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajtraub) +* [Joshua Levy (jlevy)](https://github.com/jlevy) — [142+](https://github.com/jlevy/the-art-of-command-line/commits?author=jlevy)/[41+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajlevy) — _orignal author and project maintainer_ +* [Jesse Sightler (jsight)](https://github.com/jsight) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=jsight)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajsight) +* [Konstantin Mikhailov (jtraub)](https://github.com/jtraub) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=jtraub)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajtraub) * [Jakub Wilk (jwilk)](https://github.com/jwilk) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=jwilk)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ajwilk) * [Wael Nasreddine (kalbasit)](https://github.com/kalbasit) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=kalbasit)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Akalbasit) * [Colin Chan (kalgynirae)](https://github.com/kalgynirae) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=kalgynirae)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Akalgynirae) @@ -78,35 +80,36 @@ They have kindly agreed to review and help update future contributions for the t * [Dmytro Prokhorenkov (l13t)](https://github.com/l13t) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=l13t)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Al13t) * [Lakshmipathi (Lakshmipathi)](https://github.com/Lakshmipathi) — [10+](https://github.com/jlevy/the-art-of-command-line/commits?author=Lakshmipathi)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3ALakshmipathi) * [Pavel Zhukov (landgraf)](https://github.com/landgraf) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=landgraf)/[0+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Alandgraf) +* [libregeekingkid (libregeekingkid)](https://github.com/libregeekingkid) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=libregeekingkid)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Alibregeekingkid) * [Lampros Mountrakis (lmount)](https://github.com/lmount) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=lmount)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Almount) * [lsrom](https://github.com/lsrom) — [14+](https://github.com/jlevy/the-art-of-command-line/commits?author=lsrom)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Alsrom) — _translation maintainer (cs)_ * [Luke Yeager (lukeyeager)](https://github.com/lukeyeager) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=lukeyeager)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Alukeyeager) * [TAKAGI Masahiro (m-takagi)](https://github.com/m-takagi) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=m-takagi)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Am-takagi) -* [Not Mark (mark-i-m)](https://github.com/mark-i-m) — [5+](https://github.com/jlevy/the-art-of-command-line/commits?author=mark-i-m)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amark-i-m) +* [Who? Me?! (mark-i-m)](https://github.com/mark-i-m) — [5+](https://github.com/jlevy/the-art-of-command-line/commits?author=mark-i-m)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amark-i-m) * [marocchino](https://github.com/marocchino) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=marocchino)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amarocchino) -* [Matjaž Lipuš (matjaz)](https://github.com/matjaz) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=matjaz)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amatjaz) -* [Mayra Cabrera (mayra-cabrera)](https://github.com/mayra-cabrera) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=mayra-cabrera)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amayra-cabrera) +* [Matjaž Lipuš (matjaz)](https://github.com/matjaz) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=matjaz)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amatjaz) +* [Mayra Cabrera (mayra-cabrera)](https://github.com/mayra-cabrera) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=mayra-cabrera)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amayra-cabrera) * [Michael Barlow (michaelbarlow7)](https://github.com/michaelbarlow7) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=michaelbarlow7)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amichaelbarlow7) +* [Mihai Maruseac (mihaimaruseac)](https://github.com/mihaimaruseac) — [8+](https://github.com/jlevy/the-art-of-command-line/commits?author=mihaimaruseac)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amihaimaruseac) — _translation maintainer (ro)_ * [Jinhui-Lin (mintisan)](https://github.com/mintisan) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=mintisan)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amintisan) * [Crisoforo Gaspar Hernández (mitogh)](https://github.com/mitogh) — [3+](https://github.com/jlevy/the-art-of-command-line/commits?author=mitogh)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amitogh) * [miuc (miuc)](https://github.com/miuc) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=miuc)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amiuc) * [Michael Kwardakov (mkwardakov)](https://github.com/mkwardakov) — [5+](https://github.com/jlevy/the-art-of-command-line/commits?author=mkwardakov)/[5+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amkwardakov) * [Harry Moreno (morenoh149)](https://github.com/morenoh149) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=morenoh149)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amorenoh149) -* [Dongliang Mu (mudongliang)](https://github.com/mudongliang) — [3+](https://github.com/jlevy/the-art-of-command-line/commits?author=mudongliang)/[8+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amudongliang) +* [Dongliang Mu (mudongliang)](https://github.com/mudongliang) — [3+](https://github.com/jlevy/the-art-of-command-line/commits?author=mudongliang)/[10+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Amudongliang) * [Nilton Vasques (niltonvasques)](https://github.com/niltonvasques) — [24+](https://github.com/jlevy/the-art-of-command-line/commits?author=niltonvasques)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aniltonvasques) — _translation maintainer (pt)_ * [Oleg Berman (olegberman)](https://github.com/olegberman) — [15+](https://github.com/jlevy/the-art-of-command-line/commits?author=olegberman)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aolegberman) — _translation maintainer (ru)_ -* [osmero](https://github.com/osmero) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=osmero)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aosmero) — _translator (ru)_ +* [osmero](https://github.com/osmero) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=osmero)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aosmero) — _translator (ru)_ * [Serg Petrov (p12se)](https://github.com/p12se) -* [Peter Kokot (peterkokot)](https://github.com/peterkokot) — [46+](https://github.com/jlevy/the-art-of-command-line/commits?author=peterkokot)/[32+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Apeterkokot) — _translation maintainer (sl)_ +* [Peter Kokot (peterkokot)](https://github.com/peterkokot) — [47+](https://github.com/jlevy/the-art-of-command-line/commits?author=peterkokot)/[33+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Apeterkokot) — _translation maintainer (sl)_ * [Ryan (picasso250)](https://github.com/picasso250) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=picasso250)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Apicasso250) * [Chujie Zeng (Psycho7)](https://github.com/Psycho7) — [19+](https://github.com/jlevy/the-art-of-command-line/commits?author=Psycho7)/[8+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3APsycho7) — _translation maintainer (zh)_ * [Rahul Kavale (rahulkavale)](https://github.com/rahulkavale) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=rahulkavale)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Arahulkavale) -* [Raju Devidas Vindane (rajuvindane)](https://github.com/rajuvindane) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=rajuvindane)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Arajuvindane) * [Rasmus Wriedt Larsen (RasmusWL)](https://github.com/RasmusWL) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=RasmusWL)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3ARasmusWL) * [Riley Shaw (rileyjshaw)](https://github.com/rileyjshaw) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=rileyjshaw)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Arileyjshaw) * [Ryan Delaney (rpdelaney)](https://github.com/rpdelaney) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=rpdelaney)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Arpdelaney) * [Remi Verchere (rverchere)](https://github.com/rverchere) — _translator (fr)_ -* [S1SYPHOS (S1SYPHOS)](https://github.com/S1SYPHOS) — [7+](https://github.com/jlevy/the-art-of-command-line/commits?author=S1SYPHOS)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AS1SYPHOS) — _translation maintainer (de)_ +* [Martin Folkers (S1SYPHOS)](https://github.com/S1SYPHOS) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=S1SYPHOS)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AS1SYPHOS) — _translation maintainer (de)_ * [Saksham Sharma (sakshamsharma)](https://github.com/sakshamsharma) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=sakshamsharma)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Asakshamsharma) * [Kit Chan (shukitchan)](https://github.com/shukitchan) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=shukitchan)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ashukitchan) * [Simarpreet Singh (simar7)](https://github.com/simar7) — [0+](https://github.com/jlevy/the-art-of-command-line/commits?author=simar7)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Asimar7) @@ -120,7 +123,7 @@ They have kindly agreed to review and help update future contributions for the t * [taxusyew](https://github.com/taxusyew) — [1+](https://github.com/jlevy/the-art-of-command-line/commits?author=taxusyew)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Ataxusyew) * [Thomas Lee (ThomasLee969)](https://github.com/ThomasLee969) — [12+](https://github.com/jlevy/the-art-of-command-line/commits?author=ThomasLee969)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AThomasLee969) * [Timur (tim-teufel)](https://github.com/tim-teufel) — [4+](https://github.com/jlevy/the-art-of-command-line/commits?author=tim-teufel)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Atim-teufel) -* [Timothy Qiu (timothyqiu)](https://github.com/timothyqiu) — [2+](https://github.com/jlevy/the-art-of-command-line/commits?author=timothyqiu)/[1+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Atimothyqiu) +* [Timothy Qiu (timothyqiu)](https://github.com/timothyqiu) — [4+](https://github.com/jlevy/the-art-of-command-line/commits?author=timothyqiu)/[2+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Atimothyqiu) * [René Ribaud (uggla)](https://github.com/uggla) — [5+](https://github.com/jlevy/the-art-of-command-line/commits?author=uggla)/[10+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Auggla) * [Sungjin Kang (ujuc)](https://github.com/ujuc) — [6+](https://github.com/jlevy/the-art-of-command-line/commits?author=ujuc)/[0+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3Aujuc) — _translator (ko)_ * [Ungsik Yun (Ungsik-Yun)](https://github.com/Ungsik-Yun) — [15+](https://github.com/jlevy/the-art-of-command-line/commits?author=Ungsik-Yun)/[3+](https://github.com/jlevy/the-art-of-command-line/issues?q=author%3AUngsik-Yun) — _translation maintainer (ko)_ diff --git a/admin/authors-info.yml b/admin/authors-info.yml index 11ccafd..cd60d3d 100644 --- a/admin/authors-info.yml +++ b/admin/authors-info.yml @@ -54,3 +54,6 @@ roles: S1SYPHOS: translation maintainer (de) gernd: translator (de) dspinellis: section maintainer (Windows) + mihaimaruseac: translation maintainer (ro) + bgdnlp: translator (ro) + 23Pstars: translation maintainer (id) From a5f87e57942decce2c24e84145b695e58b010f45 Mon Sep 17 00:00:00 2001 From: Timotei Dolean Date: Mon, 31 Oct 2016 22:04:36 +0200 Subject: [PATCH 22/25] Fix some typos Fix some typos in the Romanian translation --- README-ro.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README-ro.md b/README-ro.md index 2ee8070..b30cc22 100644 --- a/README-ro.md +++ b/README-ro.md @@ -39,7 +39,7 @@ pe [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux- Scop: - Acest ghid este atât pentru începători cât și pentru avansați. Scopurile sunt *acoperire* (tot ce este important), *specificitate* (oferirea exemplelor concrete pentru cazurilor comune) și *brevitate* (neincluderea lucrurilor neesențiale sau a digresiunilor ce pot fi găsite ușor în alte părți). Fiecare sfat este esențial în câteva situații sau reduce semnificativ timpul necesar efectuării unei cerințe comparativ cu celelalte alternative. -- Ghidul este scris pentru Linux, cu excepția secțiunilor "[Doar pentru OS X](#doar-pentru-os-x)" și "[Doar pentru Windows](#doar-pentru-windows)". Majoritatea sfaturilor din celelate secțiuni se aplică/pot fi instalate pe alte sisteme Unix sau OS X (chiar și în Cygwin). +- Ghidul este scris pentru Linux, cu excepția secțiunilor "[Doar pentru OS X](#doar-pentru-os-x)" și "[Doar pentru Windows](#doar-pentru-windows)". Majoritatea sfaturilor din celelalte secțiuni se aplică/pot fi instalate pe alte sisteme Unix sau OS X (chiar și în Cygwin). - Se pune accent pe Bash interactiv, chiar dacă unele sfaturi sunt aplicabile și altor shell-uri sau pentru Bash-scripting în general. - Atât comenzile Unix "standard" cât și cele care necesită instalarea de pachete speciale sunt incluse -- cât timp sfaturile sunt destul de importante cât să merite incluziunea. @@ -55,7 +55,7 @@ Note: - Învățați cel puțin un editor de text. Ideal Vim (`vi`), cum nu există un competitor real pentru editarea în terminal (chiar dacă folosiți Emacs, sau un editor modern în majoritatea timpului). -- Învățați să citiți documentație cu `man` (pentru curiouși, `man man` listează secțiunile, de exemplu 1 este pentru comenzi "uzuale", 5 este pentru fișiere/convenții și 8 pentru administrare). Găsiți pagini de manual cu `apropos`. Rețineți că anumite comenzi nu sunt programe executabile ci comenzi interne în Bash și că puteți obține ajutor despre ele cu `help` sau `help -d`. Puteți vedea dacă o comandă este internă, executabilă sau doar un alias prin folosirea `type command`. +- Învățați să citiți documentație cu `man` (pentru curioși, `man man` listează secțiunile, de exemplu 1 este pentru comenzi "uzuale", 5 este pentru fișiere/convenții și 8 pentru administrare). Găsiți pagini de manual cu `apropos`. Rețineți că anumite comenzi nu sunt programe executabile ci comenzi interne în Bash și că puteți obține ajutor despre ele cu `help` sau `help -d`. Puteți vedea dacă o comandă este internă, executabilă sau doar un alias prin folosirea `type command`. - Învățați despre redirecționarea intrării și ieșirii folosind `>` și `<` și pipe-uri cu `|`. Rețineți că `>` suprascrie fișierul și `>>` adaugă la final. Învățați despre ieșirea standard și ieșirea de eroare standard. @@ -73,7 +73,7 @@ Note: - Învățați expresii regulare foarte bine, precum și diversele opțiuni pentru `grep`/`egrep`. Relevante sunt `-i`, `-o`, `-v`, `-A`, `-B`, și `-C`. -- Învațați să folosiți `apt-get`, `yum`, `dnf` sau `pacman` (în funcție de distribuție) pentru a găsi și instala pachete. Fiți siguri că aveți `pip` pentru a instala comenzile bazate pe Python (câteva din utilitarele de mai jos sunt mai ușor de instalat cu `pip`). +- Învățați să folosiți `apt-get`, `yum`, `dnf` sau `pacman` (în funcție de distribuție) pentru a găsi și instala pachete. Fiți siguri că aveți `pip` pentru a instala comenzile bazate pe Python (câteva din utilitarele de mai jos sunt mai ușor de instalat cu `pip`). ## Folosire zilnică @@ -125,7 +125,7 @@ Note: - Tratați cu atenție cazurile când variabilele și fișierele conțin spații. Folosiți ghilimele în acest caz, de exemplu `"$FOO"`. Preferați să folosiți opțiunile `-0` sau `-print0` pentru a folosi caracterul null pentru a delimita fișierele, de exemplu `locate -0 pattern | xargs -0 ls -al` sau `find / -print0 -type d | xargs -0 ls -al`. Pentru a parcurge o listă de fișiere conținând spații într-o buclă for, setați variabile IFS la terminatorul de linie, `IFS=$'\n'`. -- În scripturile Bash, folosiți `set -x` (sau varianta `set -v`, care produce informație neprocesată, inclusiv variabile neexpandate și comentarii) pentru a depana outputul. Folosiți modurile strice exceptând când aveți un motiv foarte bun împotrivă: folosiți `set -e` pentru a termina execuția în caz de eroare (cod de ieșire nenul). Folosiți `set -u` pentru a detecta variable nesetate. Considerați folosirea `set -o pipefail` pentru erorile cauzate de folosirea eronată a pipe-urilor. Pentru scripturi mai complicate, folosiți `trap` pentru EXIT sau ERR. Un obicei util este să începeți scriptul într-o modalitate care va permite detecția facilă a erorilor și terminarea execuției cu un mesaj: +- În scripturile Bash, folosiți `set -x` (sau varianta `set -v`, care produce informație neprocesată, inclusiv variabile neexpandate și comentarii) pentru a depana outputul. Folosiți modurile strice exceptând când aveți un motiv foarte bun împotrivă: folosiți `set -e` pentru a termina execuția în caz de eroare (cod de ieșire nenul). Folosiți `set -u` pentru a detecta variabile nesetate. Considerați folosirea `set -o pipefail` pentru erorile cauzate de folosirea eronată a pipe-urilor. Pentru scripturi mai complicate, folosiți `trap` pentru EXIT sau ERR. Un obicei util este să începeți scriptul într-o modalitate care va permite detecția facilă a erorilor și terminarea execuției cu un mesaj: ```bash set -euo pipefail trap "echo 'error: Script failed: see failed command above'" ERR @@ -586,7 +586,7 @@ Aceste sfaturi sunt relevante *doar* pentru Windows. ## Anunț legal -Cu excepția unor task-uri foarte mici, codul scris aici este pentru ca alții să-l poate citi. Cu putere vine și responsabilitate. Faptul că *puteți* face cava în Bash nu înseamnă neapărat că și trebuie să-l faceți ;) +Cu excepția unor task-uri foarte mici, codul scris aici este pentru ca alții să-l poate citi. Cu putere vine și responsabilitate. Faptul că *puteți* face ceva în Bash nu înseamnă neapărat că și trebuie să-l faceți ;) ## Licență From d122c6b32b186d5f007a78f9bd6ac165701479c9 Mon Sep 17 00:00:00 2001 From: Timotei Dolean Date: Mon, 31 Oct 2016 22:07:16 +0200 Subject: [PATCH 23/25] Improve some wordings in Romanian translation --- README-ro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-ro.md b/README-ro.md index b30cc22..aaa6277 100644 --- a/README-ro.md +++ b/README-ro.md @@ -446,7 +446,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: - `tac`: afișează conținutul fișierelor în ordine inversă -- `shuf`: selectează linii random din fișier +- `shuf`: selectează linii in mod aleator din fișier - `comm`: compară fișiere sortate, linie cu linie @@ -466,7 +466,7 @@ Câteva exemple de a construi comenzi complicate din comenzi simple: - `units`: conversii între unități de măsură (vedeți și `/usr/share/units/definitions.units`) -- `apg`: generateză parole random +- `apg`: generateză parole aleatoare - `xz`: compresor de fișiere foarte eficient From b990959e1b0035a87748cda309b61fee9d2af6eb Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Wed, 14 Dec 2016 15:08:03 -0800 Subject: [PATCH 24/25] Fix badly merged line. --- README-ja.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README-ja.md b/README-ja.md index 73e2b8f..68df2c6 100644 --- a/README-ja.md +++ b/README-ja.md @@ -1,9 +1,5 @@ 🌍 -<<<<<<< HEAD -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Română](README-ro.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* -======= -*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* ->>>>>>> 15078231034199f1587320d98b1ab294511c681a +*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Română](README-ro.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* 原文のコミット [ee4b00bc396087d27231f60512aeb77b19ce734e](https://github.com/jlevy/the-art-of-command-line/blob/ee4b00bc396087d27231f60512aeb77b19ce734e/README.md) From 14d4f4d656fa88cdf94bc6c27d81f2948fd83c67 Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Wed, 14 Dec 2016 15:10:13 -0800 Subject: [PATCH 25/25] Remove blob ref. --- README-ja.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README-ja.md b/README-ja.md index 68df2c6..c3aaca4 100644 --- a/README-ja.md +++ b/README-ja.md @@ -1,8 +1,6 @@ 🌍 *[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Română](README-ro.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)* -原文のコミット [ee4b00bc396087d27231f60512aeb77b19ce734e](https://github.com/jlevy/the-art-of-command-line/blob/ee4b00bc396087d27231f60512aeb77b19ce734e/README.md) - # The Art of Command Line [![Join the chat at https://gitter.im/jlevy/the-art-of-command-line](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)