Linux server usage skills

The foreground process runs in the background:

ctrl+z
bg  将一个在后台暂停的命令,变成在后台继续执行。如果后台中有多个命令,可以用bg %jobnumber将选中的命令调出
jobs
disown -h %1

ctrl+z
[1]+ Stopped /usr/local/bin/python view_record_manage.py save 1
[root@dispatch_19 movie_score_builder]#bg
[1]+ /usr/local/bin/python view_record_manage.py save 1 &
[root@dispatch_19 movie_score_builder]#jobs
[1]+ Running /usr/local/bin/python view_record_manage.py save 1 &
[root@dispatch_19 movie_score_builder]#disown -h %1

The program runs directly in the background:

nohup python preprocess.py > pre.out 2>&1 &

The -u parameter will force its standard output to be printed directly to the screen without buffering, just like standard error

nohup python -u abc.py > nohup.log 2>&1 &
  1. pre.out redirects the output to a file called pre.out
  2. 2>&1 redirects standard error (2) to standard output (&1), and standard output (&1) is redirected to the pre.out file
  3. & Means running in the background
jobs -l 查看运行的后台进程
ctrl+z 将前台任务转后台并冻结:
bg 将后台冻结的任务再次运行起来;
fg 将后台任务重新转前台执行;

Download the folder from the Linux server to the local:

Use scp command:

scp [email protected]:/home/work/source.txt /home/work/
  1. Copy the source.txt file on the 192.168.0.10 machine to the local /home/work directory

  2. scp copy folder, add -r parameter : scp -r

Guess you like

Origin blog.csdn.net/qq_43779658/article/details/106150530