linux:bash:command
This is an old revision of the document!
Table of Contents
Catatan Bash Command Linux
Beberapa catatan bash command linux
LS Modified File
Perintah LS Menampilkan File modifikasi terakhir
ls -1tr /folder/
LS Ignore file string
Perintah LS mengabaikan string file tertentu
ls -l /folder/ --ignore=*.java
Determinte Variable Empty or Not
Menentukan atau mengecek variable kosong atau berisi
ini apabila variable kosong
if [[ -z $variable ]] if [[ -z "$variable" ]]
dan ini apabila tidak kosong
if [[ ! $variable ]] if [[ ! "$variable" ]]
Bash Loop From LS
Looping dari hasil ls
bisa dengan cara ini
for task in $(ls -1tr $task_file | head -3); do ... ... done
atau anda bisa menyimpan command di dalam string kemudian mengeksekusi dengan eval. contoh seperti ini.
command=ls -1tr $task_file --ignore=*.auto | head -3 if [[ -z $command ]]; then cmd='ls -1tr $task_file | head -3' else cmd='ls -1tr $task_file --ignore=*.auto | head -3' fi for task in $(eval $cmd); do ... ... done
TOP -c command
Top menampilkan proses linux filter berdasarkan command
top -bc |grep name_of_process
sumber : http://stackoverflow.com/a/24273554
Layanan
Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |linux/bash/command.1482202153.txt.gz · Last modified: 2016/12/19 21:49 by kbadmin