User Tools

Site Tools


linux:bash:command

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:bash:command [2016/12/11 22:58] – [Determinte Variable Empty or Not] kbadminlinux:bash:command [2024/10/12 05:02] (current) kbadmin
Line 31: Line 31:
 <code> <code>
 for task in $(ls -1tr  $task_file | head -3); do for task in $(ls -1tr  $task_file | head -3); do
 +...
 +...
 done done
 </code> </code>
  
-atau dengan cara ini+atau anda bisa menyimpan command di dalam string kemudian mengeksekusi dengan eval. contoh seperti ini
 +<code>
  
 +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
 +</code>
 +
 +===== TOP -c command =====
 +Top menampilkan proses linux filter berdasarkan command
 +<code>
 +top -bc |grep name_of_process
 +</code>
 +sumber : http://stackoverflow.com/a/24273554
 +
 +===== Mendapatkan Lokasi Path Saat ini - Current Working Path  =====
 +Berikut ini adalah command bash untuk mendapatkan lokasi pointer saat ini
 +<code>
 +$ echo "$PWD"
 +</code>
 +
 +===== Merubah Nama File Mengandung Underscore =====
 +Merubah nama file yang mengandung underscore dengan nama lain
 +<code>
 +rename "_" "bb" /path/*.mp3
 +</code>
  
  
  

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash/command.1481515110.txt.gz · Last modified: 2016/12/11 22:58 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki