Friday, December 20, 2013

Re: [LINUX_Newbies] How to control traffic in Linux?

 

On 20/12/13 18:13, highskywhy@yahoo.de wrote:
>
>
> How to control traffic in Linux?
>
> Is it possible to start all software in a terminal like that_
>
>
> firefox 30% cpu max.
>
> thunderbird 10% cpu max.
>
> chrome max 20 cpu.
>
>
> And how can I start a software like
>
> firefox is very important give all cpu to firefox
>
> zip is very unimportant and should work very slow
> how can I start zip and zip should use only a small part of the cpu
>
> regards
> sophie

Yes, the command you want is called nice.
most programs start with a 'priority' of 10 (on a scale of -19 to 20)
the lower the number the higher the priority so to run a sequence of
programs with decreasing priority you would type (or alter the desktop
shortcuts to read)

nohup nice -n 1 firefox &
nohup nice -n 2 chrome &
nohup nice -n 3 thunderbird &

Now the downside of doing this is the actual OS will slow down, so
things like disk access and network comms are affected. not to mention
the responsiveness of the desktop!

Two other things the command prints out the pid of the started process
and also writes the output (error messages mostly) to nohup.out. If
starting multiple programs create a log directory in your home
(/home/user/log) and add two redirections to the commands for gui programs.

nohup nice -n 5 myprog >~/log/myprog.nohup >>~/log/myprog.error &
You could also send these to /tmp -- each run will overwrite the
previous file. If you don't want them the other trick is to direct them
to /dev/null (e.g. >/dev/null ) Anything written there simply disappears.

Explaining this
nohup -- run the following but do not close if this command window closes.
nice -n 5 myprog run myprog with priority 5
>~/log/file.log Send stdout stream to file /home/name/log/file.log
>>~/log/error send stderror stream to file
& Run in background --prints job no in brackets [1] you can then type
'fg 1' to bring that job into foreground!

Hope this helps
Trev.

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
To unsubscribe from this list, please email LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.
.

__,_._,___

No comments:

Post a Comment