Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.