1

I am trying to learn what I can do from linux command to processes.

The problem is, I don't have many programs to check those commands on. I can't exactly kill bash, and putting process yes in background is a death sentence.

Since I am running on a server, I can't exactly just open a program in desktop.

Is there any notepad or calculator I could open in the background, so that it shows on the list of processes and allows me to check some options? I tried to use wget but this also doesn't seem to show up in my processes, maybe the download is too fast, I don't really get the issue with it...

Thanks for your help.

2
  • 4
    sleep 60 & will do nothing for 60 seconds. – pLumo Apr 11 '18 at 13:57
  • you can also run yes & and type pkill yes to stop it. Although you won't see what you're writing, it will work. – pLumo Apr 11 '18 at 13:59
2

If you want to use yes in background, you can still do :

$ yes > /dev/null &

where > /dev/null redirects the output of the command to /dev/null.

Alternatively, you can run an infinite sleep :

$ sleep infinity &

which will run until killed

0

You could run a script or a utility from the command line with an appended ampersand in order to cause it to run in the background, like this:

./script.sh &

You could create a simple script that does nothing but sleep and run it in the background. A sample sleeping script could look like this:

#!/bin/bash
while true; sleep 1; done
1
  • 2
    You can also just directly run e.g. sleep 60 & to sleep for a minute in background. If you want to sleep infinitely, use sleep infinity &. No need to write a custom script. – Byte Commander Apr 11 '18 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.