Monday, December 23, 2013

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

 

On 20Dec2013 23:41, trevor pearson <trev15evil@yahoo.co.uk> wrote:
> On 20/12/13 18:13, highskywhy@yahoo.de wrote:
> > How to control traffic in Linux?
> > 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
>
> nohup nice -n 15 zip command that is long >/dev/null >>/dev/null &
>
> If output/error messages are important (or you want to check them)
>
> nohup nice -n 15 zip-command-to -do >~/zip.log >~/zip.error &
>
> the 15 can be any number from 11 (slightly less important) to 20 (Only
> when there is nothing else to do) 20 will run very slowly!

Notes:

1: The default nice value is 10.
For most low priority programs you can just use "nice".
Eg:

nice unzip ....

No tedious -n required. Just ask the command to be "nice".

2: trevor is missing some redirection stuff:
The standard incantation is:

>filename 2>filename-for-errors

If those are the same file, then:

>filename 2>&1

The order matters, too. This is applied left to right.

3: Nohup, if run on a terminal, automatically redirects out put to
the file "nohup.out". If that is enough, you don't need any
redirections at all.
Eg:

nohup nice unzip ...

4: Perhaps not made clear: nice affect the _share_ of CPU your command gets.
If you system is otherwise idle, a nice program can use the whole CPU.
If the system is busy, the nice programs get a smaller share than other programs.

Simpler and easier.

Perhaps

Cheers,
--
Cameron Simpson <cs@zip.com.au>

More computing sins are committed in the name of efficiency (without
necessarily achieving it) than for any other single reason - including
blind stupidity. - W.A. Wulf

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

__,_._,___

No comments:

Post a Comment