I'm timing how long it takes to run a command foo. I'm looking to append the results from the time command to a file, and discard the results from the foo command. I tried the following, but it didn't do what I want:
$ time ./foo > /dev/null >> output_from_time_command.txt
I sorted a large mailing list and the result is in almost sorted order, but not quite.The sort was invoked in the default manner, just "sort".See (below) a segment of the output file.(Note: the actual files have a street address following each name.I have omitted the addresses to avoid complaints about disclosing personal information on-line.) I expect all people named KATZ to be grouped together, but they aren't. This phenomenon occurs elsewhere in the output file, so it has nothing to do with surnames beginning with the character string KATZ.
so I was wondering how I could do a simple find which would order the results by most recently modified. Here is the current fine I am using. (I am doing a shell escape in php, so that is the reasoning for the variables. find '$dir' -name '$str'* -print | head -10
How could I have this order the search by most recently modified. (Note I do not want it to sort 'after' the search, but rather find the results based on what was most recently modified)
What options should I use when I'm using the sort command to sort the top 5 CPU processes (ps -eo user,pid,ppid,%cpu,%mem,fname | sort ??? | head -5) showing max to min usage?
We switched from unix to linux and we have an old report that extracted data from a database, output to an ascii file and then sorted the results in the file based on different arguments. The report now blows up when it runs,and I can only guess it is because the options for sort on linux differ slightly from unix.For example, here is one of the commands issued from within the report app that ran on the old unix box:
I will eventually rewrite the report to store the data in a local table, but I can simply adjust the options to suit the requirments of linux. Basically, I need to know if this can be a quick fix for the short term.
I scheduled a job, 'ls -a', with the at command, 3 minutes in the future. It looks like the job ran, but I cannot see the results of 'ls -a'. I accessed my mail with the 'mail' command and saw that the output of my scheduled job was message 1. I typed in '1' after the & prompt, and saw that the subject of the message was the output of my job, scheduled at the time specified with the 'at' command. I cannot see the output of the 'ls -a' command that I scheduled though. How do I see the contents of the message, and the actual output of the job.
i wonder if it is usual that the results of running commands via the command line is different from running them in a script file. my problem is that, i've to run 'modprobe -r e100' and 'modprobe e100' before suspend my machine via pmi in order to resume it properly. i wrote a script containg EXACTLY the same commands as i typed in the terminal/console but the result was not the same. the machine cannot be resumed as expected if i run the script file.
When I shutdown my server it seems to lock up. I use ssh for a headless unit and I can reboot fine, but I told it to shutdown and disconnected me and stopped logging (as far as I can tell) and then nothing. The lights stayed on and I had to press the power button. Is there a way to keep the logger running or to look someplace other then messages. I'm not great with logs.
I'm trying to send the results of a command line $du --max-depth=1 to a zenity message box.I want to create a .sh script that I can run as a Nautilus script that will open a zenity message box with a listing of sub-folders/sizes. $DU with options, will provide the results in a terminal window, but I can't seem to get it into a zenity message box. I've tried gxmessage also, but no go.
Below is an example output of what I see when I run the 'ls' command on some directories in linux (this is from a tomcat/common/lib directory). However I'm not clear on why some of the filenames are appearing inside [square brackets]
This question may be silly and super easy for linux connaisseurs, but I was just wondering, for instance, I want to use the >find command to search for a file and send the results to a text file
how to include my command results in a script? Basically what the script does is it checks the status of a service within the linux server, then sends an email when done. I want to include the results of my status check to my mail when sent.
i.e. service dhcp3-server status Status of DHCP server: dhcpd3 is running. <---this I want to include in the mail that is sent out via script.
I wanted to supply mplayer with the output of find command as arguments. The error returned showed spliced names of files whenever spaces occurred. I have subdirectories in my /home/my_user_name/Music/ directory, and in them multiple *.oga music files. The actual command that I issued was
mplayer started but then was looking for broken file names. I am thinking quoting has to do with it to preserve the filename as one string but different attempts were met with inroads:
Code: mplayer `find /home/my_user_name/Music/ -name "*.oga"` gave me the same result and Code: mplayer `"find /home/my_user_name/Music/ -name *.oga"`
I am trying to get the correct CPU usage using top. I ran collectD and I got different results.This especially happens when the CPU usage is close to 100%.Has anyone experienced having the top command report different results than other CPU usage utilities?
I've run the command "sudo apt-get update" from terminal, showing no update to do.Then I've run the update manager (System-Administration-Update Manager) and it has shown an update (adobe flash).I thought that "apt-get update" command and update manager were the same... Why do I have different results ? Is something missing in my "sources.list" file ?
Bash acts weird in 10.04 server. Whenever I try to run .sh scripts, every empty line in the script results in "command not found". Then on even simple scripts I get syntax errors, but the same exact scripts work on my 9.10 desktop installation. There's also another problem, I'm not really sure if it's bash-related. After setting the proxy using
I have a problem, I need to launch another binary from my application, but I need to get the control back once the other binary is initialized. fork/exec doesn't seem to give anything on that side using pthreads I'm able to wait until the new thread exits, but that's not what I want at the moment I'm using popen, but it doesn't seem to do the job right...
I've been using linux for a long time, and I just ran into a problem that has me stumped. Any time I mistype a command, it says "Command not found."... yea, I know that's normal. But it doesn't return me to my # prompt. I have to press Ctrl+C to get back. code...
I know I do have one issue with this computer, I have 2 blown caps on my motherboard. This was a dual boot system, but after a virus with winblows, I decided to switch it to strictly linux. (roommates... *grumble*) I think I was running fc10 before I wiped the hd & installed fc12. Fc12 does seem to be running slower, and I still haven't got my sound card working properly... but that issue is for another topic... -YungBlood Reborn
So it seems like the sorting algo. for dpkg --get-selections is different than sorting algo. of 'sort' command when it encounters "-" (hyphen). How can I sort the original file (a.txt) in such a way that it produces the output file ,b.txt, exactly the same.
I forced a fsck on the next boot by.Code: sudo touch /forcefsck.Where did the results go?/var/log/fsck/checkfs and /var/log/fsck/checkroot both read "(Nothing has been logged yet.)" Am I to assume that if there are no errors nothing is written to the log files?
I have compiled the same program and I get different results when the program is run in windows and in ubuntu, in windows I run it with Dev C++. I was wondering if someone could provide insight on this. My expected result is the one that Windows gives. However, I would really like to work in Ubuntu.