Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- How to blend adsense inside your post?
- Formatting my post
- Notepad++ - Add C++ compiler
- Install PHPMailer 5.2.4 and use smtp gmail
- phpexcel toggle expand and hide column in EXCEL and summary
- Wayback Machine - see archived versions of web pages across time
- Set up a child account and set screen time limit in Windows 8
- Install PHP ibm_db2 extension in Linux (redHat)
- Linux, automatically backup MySQL database daily
Monday, June 9, 2014
Run Linux command asking input or password in background
When we run a Linux command in background such as
scp test.sql jiansen@example.com:/home/jiansen &
or ignore the hangup signal
nohup scp test.sql jiansen@example.com:/home/jiansen &
We can not input password.
To make an input for background job, First we use
scp test.sql jiansen@example.com:/home/jiansen
input password, then type Ctrl +Z to suspend the job
then type
bg
to put it in background.
To list all process
ps aux
To list process containing scp and find process id
ps aux |grep scp
To kill a process
kill processid
To force to kill, this is strong:
kill -9 processid
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment