LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 08-21-2002, 10:44 PM   #16
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64

Thanks, an obvious one to some, but good for the newbs

Ever want to run multiple commands and go watch some TV while the numbers crunch (like while building a new kernel?)

The && command is your friend.

Example for kernel
make dep &&
make clean &&
make modules &&
make modules_install &&
make bzImage
And press enter, all command will execute, and after each finishes the next will start, if there were no errors from the first command ran. Now you don't have to sit there until make dep finishes to move on.
 
Old 08-22-2002, 04:28 AM   #17
dai
Member
 
Registered: May 2002
Location: Wales
Distribution: Slack 8.1, Gentoo 1.3a, Red Hat 7.3, Red Hat 7.2, Manrake 8.2
Posts: 328

Rep: Reputation: 30
Yo Grand Master of the C

Couldnt you add those lines to a Script like this

#!/bin/sh

make dep &&
make clean &&
make modules &&
make modules_install &&
make bzImage


and call it compilekern.sh

then run this script and it would do it automatcally????

Yes Im lazy
 
Old 08-22-2002, 04:32 AM   #18
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
he he he, even though my name may represent something in programming language, I really have no idea about scripting, so, if it works, then, yeah. But I have no idea. That's a good idea if it does though, and you wouldn't really need the && I believe. The script usually will wait until one thing is done to perform the next operation anyway I believe, so the && would be extra/un needed. But again, I don't know scripting, and this would only help with the kernel, where the && can be used anywhere you have to run more than 1 command after another.

Good idea though, thanks!
 
Old 08-22-2002, 05:12 AM   #19
dai
Member
 
Registered: May 2002
Location: Wales
Distribution: Slack 8.1, Gentoo 1.3a, Red Hat 7.3, Red Hat 7.2, Manrake 8.2
Posts: 328

Rep: Reputation: 30
well anybody know if this would work send a stamped self addressed envelop to blue peter... ummm or even just reply here please
 
Old 08-22-2002, 08:04 AM   #20
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
I don't understand that one dai? SASE to Blue Peter? I am not following? Would this be a "UK" thing? Thanks for any clarification.
 
Old 08-22-2002, 08:25 AM   #21
dai
Member
 
Registered: May 2002
Location: Wales
Distribution: Slack 8.1, Gentoo 1.3a, Red Hat 7.3, Red Hat 7.2, Manrake 8.2
Posts: 328

Rep: Reputation: 30
Sorry MasterC Yes it would Blue Peter is a Long running Kids Show that all children in the UK grow up watching.
 
Old 08-22-2002, 07:16 PM   #22
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 57
[drools]
And some Uni students still watched whilst Katie Hill was presenting.
[/drools]
 
Old 08-23-2002, 08:54 AM   #23
dai
Member
 
Registered: May 2002
Location: Wales
Distribution: Slack 8.1, Gentoo 1.3a, Red Hat 7.3, Red Hat 7.2, Manrake 8.2
Posts: 328

Rep: Reputation: 30
Ohh yes especially with her infamous leopard skin mini skirts..........

mmmmmm sweet...............
 
Old 08-23-2002, 08:54 AM   #24
dai
Member
 
Registered: May 2002
Location: Wales
Distribution: Slack 8.1, Gentoo 1.3a, Red Hat 7.3, Red Hat 7.2, Manrake 8.2
Posts: 328

Rep: Reputation: 30
Katie Hill was the best ever presenter of Blue Peter
 
Old 08-23-2002, 06:25 PM   #25
esteeven
Senior Member
 
Registered: Oct 2001
Location: Bristol UK
Distribution: Arch Ubuntu Slackware
Posts: 1,028

Rep: Reputation: 42
...has nobody even heard of Valerie Singleton? Who is this Katie Hill?
 
Old 08-23-2002, 08:09 PM   #26
Goatdemon
Member
 
Registered: May 2002
Location: The good 'ol USofA
Distribution: ArchLinux - Slackware 8.1
Posts: 398

Rep: Reputation: 30
anyone watch bananas in pajamas? or... anyone from hongkong, what's going on with that millenium tower. the discovery channel said that hongkong was planning to build one on a lake somewhere to house their citizens.

and masterc a very good tip indeed.
 
Old 08-24-2002, 12:12 AM   #27
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
he he he, thanks I learned that one from my first attempt at LFS.
 
Old 08-24-2002, 09:47 AM   #28
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 10,625

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
Please keep the threads in Website Questions & Suggestions on topic. I am moving this to General so the thread can continue. Thanks.

--jeremy
 
Old 08-26-2002, 08:36 PM   #29
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 57
Katie Hill? Check out the Dave Grantham ladies site (non-porno). Or here.
 
Old 08-26-2002, 10:24 PM   #30
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Original Poster
Rep: Reputation: 55
Ok guys and gals, back to the topic

- RENICE CPU HOGS

have you ever wanted to automatically force a process that uses up most of the CPU.

renice 20 `ps -augxww | sort -rn +3 -4 | head -1 | awk '{print $2}'`

Note: Check your 'ps' command. Your arguments may differ.

- NICE NOT SO NICE

Nice is nice, but it isn't so nice sometimes on foreground jobs. The reason, if the system gets really busy your terminal session could hang waiting to get more CPU time.
It is possible that killing the job becomes impossible on a very system, since the CPU may never give the process enough CPU time to recognize the kill signal waiting.
Using nice on an interactive program, like vi, could also be a bad idea.

So play nice, with nice.

- STAT FOR THE INODE

The stat command is available on newer flavors of Unix and linux to provide inode information about a file.

% stat /etc/hosts

File: "/etc/hosts"
Size: 1348 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Device: 3,2 Inode: 294992 Links: 1
Access: Tue Aug 21 15:06:19
2001(00000.00:00:00)
Modify: Wed Aug 30 09:19:35 2000(00356.05:46:44)
Change: Wed Aug 30 09:19:35 2000(00356.05:46:44)

It also provides other useful information about files.

- CUT FROM STANDARD COMMANDS

To properly cut the output of unix standard commands; such as ls, ps; and properly handle them without all the extra spaces, use this:

% ls -lt| tr -s " " | cut -f6-10
% ls -lt| tr -s " " | < --do what ever-- >

tr -s " " ==> here tr in effect removes all the extra formatting extra spaces introduced by unix shell, for display, and translates in to format easy to work with.

If we dont use this tr, then the -c option of cut will be unreliable because of varying size field lengths in the output and also -f option will be unreliable because of extra formatting delimiters.

ls -lt | tr -s " "
ps -ef | tr -s " "

gives us proper output to properly extract data or columns.

This tip generously supported by: snlmurthy@yahoo.com

All tips provided here is a courtesy of http://www.ugu.com Unix Guru Universe

Regards,
Boris.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wargame Hints? the_p0et Linux - Security 3 10-20-2003 12:04 AM
hints and tips bigjohn LQ Suggestions & Feedback 0 08-04-2003 02:48 PM
Slackware CUPS hints mi6 Slackware 3 06-05-2003 09:56 PM
Hints - process myquestion Programming 2 04-15-2002 08:26 PM
gcad hints ? jamaso Linux - General 0 03-02-2002 09:27 AM


All times are GMT -5. The time now is 11:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration