bg,fg: background and foreground!
nano and you hit Ctrl-z thinking it will undo what you just did... but no, suddenly you slip through a crack in the matrix and learn all all about "bg,fg: background and foreground" -- multi-tasking in linux.
Ctrl Z - go to background. fg -- go back to nano in foreground
You may be wondering what the heck I am talking about there?
You can temporarily jump out of
nano, run a command, see something... and then jump back in.
If, while in the background, you run a new instance of nano (or some other program) and then use
Ctrl Z to go to the background... how do you jump back to the original nano?
When you exit with
Ctrl Z you see text like:
Use "fg" to return to nano. + Stopped sudo nano default
That "1" is the job you will jump back to with
To see all backgrounded jobs, use the
For example, here I've got two
nano instances stopped...
- Stopped sudo nano default + Stopped nano default.backup
To jump to the one I prefer I can use '
fg 1' or '
Magical stuff, and easy to remember for some reason. It became natural pretty quick. I guess because I press Ctrl Z so often anyway.