Langsung ke konten utama

linux terminal - bg fg ctrl+z

linux terminal - bg fg ctrl+z

ada kalanya sebuah proses perlu dijalankan secara backgroud, mungkin karena proses yang membutuhkan waktu lama atau cuman sekedar ingin menutup layar ssh :D

1. Executing a background job
Appending an ampersand ( & ) to the command runs the job in the background.
For example, when you execute a find command that might take a lot time to execute, you can put it in the background as shown below. Following example finds all the files under root file system that changed within the last 24 hours.
# yourcommand &

2. Sending the current foreground job to the background using CTRL-Z and bg command

You can send an already running foreground job to background as explained below:
  • Press ‘CTRL+Z’ which will suspend the current foreground job.
  • Execute bg to make that command to execute in background.
For example, if you’ve forgot to execute a job in a background, you don’t need to kill the current job and start a new background job. Instead, suspend the current job and put it in the background as shown below.
# yourcommand -xyz

# [CTRL-Z]
[2]+  Stopped                 yourcommand -xyz

# bg

3. View all the background jobs using jobs command

You can list out the background jobs with the command jobs. Sample output of jobs command is
# jobs
[1]   Running                 bash download-file.sh &
[2]-  Running                 evolution &
[3]+  Done                    nautilus .

4. Taking a job from the background to the foreground using fg command

You can bring a background job to the foreground using fg command. When executed without arguments, it will take the most recent background job to the foreground.
# fg
If you have multiple background ground jobs, and would want to bring a certain job to the foreground, execute jobs command which will show the job id and command.
In the following example, fg %1 will bring the job#1 (i.e download-file.sh) to the foreground.
# jobs
[1]   Running                 bash download-file.sh &
[2]-  Running                 evolution &
[3]+  Done                    nautilus .

# fg %1

5. Kill a specific background job using kill %

If you want to kill a specific background job use, kill %job-number. For example, to kill the job 2 use
# kill %2

Komentar

Postingan populer dari blog ini

Menginstal Web Server,PHP,Mysql dan phpMyAdmin di IGOS Nusantara

BERIKUT ADALAH COPAS DARI : http://www.miftakhulfuad.net/2014/05/menginstal-web-serverphpmysql-dan.html Menginstal Web Server,PHP,Mysql dan phpMyAdmin di IGOS Nusantara 05.32    jaringan, Linux    1 comment Menginstal Web Server,PHP,MySQL dan PHPMyadmin  di IGOS Nusantara Disini saya akan menulis mengenai bagaimana cara menginstal sebuah web server sampai dapat siap dipakai, selain web server kita juga akan  menginstal PHP , Mysql ( Database ), PHPMyadmin Lakukan update paket dengan     mengetikan    yum update   (apabila belum di update) 1. Langkah pertama adalah menginstal Web server : a. Memasang Apache Masuk sebagai root dulu  ketikan #   su # yum   –y  install httpd  b. edit berkas   /etc/httpd/conf.d/welcome.conf #nano /etc/httpd/conf.d/welcome.conf Lama:  Baru: c.Jalankan Apache # se...

Linux Ubuntu 12.04 Precise Pangolin

Kemaren minggu sehabis sholat subuh ane otak atik laptop butut ane satu-satunya. Kenapa ane sebut butut, karena baterainya udah ngedrop dan setiap kali ane mo make to laptop mesti nyambung pake adaptor to laptop ke steker lisrik. Dan ini adalah laptop ane yang ane beli dulunya buat ade ane kuliah, tapi karena ade ane keberatan bawa laptop gede, ane juga beli axioo, dulu kalo gak salah harganya 2,1 juta, sekarang dia pake yang axioo, nah yang tinggal satu-satunya nie laptop ane. Penasaran dengan Ubuntu Precise Pangolin dan nafsu banget serta kebelet.. ane ludes aja windows7. Ngapain ngajak orang ninggalin bajakan kalo yang ngajak aja masih make. Ada sih keinginan buat beli windows7, tapi duitnya kepake terus.. lagian kenapa mesti windows7 lah wong cuma buat FBan.,. xixixi. ini Screenshoot Ubuntu di Laptopku (Acer Aspire 4535):  gambar ini diambil menggunakan aplikasi Screenshot bawaan.

IGOS Nusantara 2.1 (Server)

Berikut adalah hasil copas dari situs aslinya :   www.codepolitan.com Bromo, Distro IGOS Nusantara 2.0 untuk Kebutuhan Server Bagi seorang sysadmin, server adalah makanan sehari-hari. Didalamnya terdapat macam-macam distro server yang digunakan seperti CentOS, Debian, Ubuntu, FreeBSD dan masih banyak lagi. Namun tidak hanya itu saja, negeri kita juga punya distro server sendiri, sebut saja IGOS Nusantara (IGN). IGOS Nusantara Server sudah mencapai versi 2.0, masih cukup muda memang. Namun jangan salah, distro server ini dikembangkan secara konsisten oleh pengembang. Setelah dua tahun bekerja, akhirnya IGOS Nusantara 2.0 Server rilis pada tanggal 27 februari 2015. Sedangkan kode rilis dinamai dengan Bromo. Tujuan pengembangan IGOS Nusantara memang difokuskan untuk melayani kebutuhan enterprise sehingga mempunyai jadwal rilis yang lumayan lama. Salah satu keuntungannya, pengembang bisa fokus pada fitur keamanan yang lebih baik. Selain itu, teknologi yang dikembangkan jug...