Linux command
fg 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Bring last job to
fg
Bring specific job
fg %[1]
Resume by job
fg %[vim]
说明
fg resumes a suspended or background job in the foreground. It's a shell builtin used with job control to manage processes started from the shell. Jobs are typically suspended with Ctrl+Z or started in background with &. fg brings them back to interactive foreground execution. Without arguments, it resumes the most recent job. fg works with the shell's job table, which tracks child processes for job control.
参数
- %N
- Job number N.
- %STRING
- Job whose command starts with string.
- %% or %+
- Current job.
- %-
- Previous job.
FAQ
What is the fg command used for?
fg resumes a suspended or background job in the foreground. It's a shell builtin used with job control to manage processes started from the shell. Jobs are typically suspended with Ctrl+Z or started in background with &. fg brings them back to interactive foreground execution. Without arguments, it resumes the most recent job. fg works with the shell's job table, which tracks child processes for job control.
How do I run a basic fg example?
Run `fg` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does %N do in fg?
Job number N.