Software :: Echo Or Search Through Terminal Output?
Jun 16, 2011
if i will sound stupid but i can't find a command that would echo output of some command. Let's say that i want to echo the third line of ls -a. I know of the tail command but this command starts from behind.
Using a default terminal and bash, there is no functionality to search the standard output of commands.
One can gain such functionality using other tools, like emacs shell or screen, but I am wondering why such a useful feature is missing, I do remember a simple C-F used to work in terminals.
Is there a way to make the Gnome terminal app support output search? or is there a better terminal app that support searching output natively?
command will just execute and exit with a status of "0" -"Every command returns an exit status (sometimes referred to as a return status ). A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually may be interpreted as an error code. Well-behaved UNIX commands, programs, and utilities return a 0 exit code upon successful completion, though there are some exceptions."[URL]With the command . . .
Code:
# dosfsck -v /dev/sdb
it could be very helpful (and decide my next move) to see the exit code as 0, 1, or 2 . the man page suggests the command exit code will specify if the message I get - "Cluster size is zero" (I think it is a "1")is a recoverable or fixable error by the utility. or is non-recoverable - a pretty nifty feature if I understand this right. [URL] is there anything like this script COMMAND_LAST used in the following link. [URL] that can be entered in the terminal window after - or at end of - my dosfsck command or any command. just to see if it has a 0, 1, or 2 status ?
I would like to search for a term within a batch of text files and copy the files containing that term to a folder.
I've read the man pages for Grep, Ack-grep and looked through nautilus, dolphin, midnight commander as well as tried beagle, tracker and google desktop (and looked throught these forums).
I can do this function easily with xp's wagging dog in the Windows search, but would like to find a way in Linux.
I want to search for 1 file (say test.txt) on first server and all the output of this search to be greped as per my requirement and then transfered on the second server at the same location where they were on first server.
E.g. output of search of file (test.txt) >> output.txt /tmp/test.txt /home/cpan/test.txt /opt/cpanel/test.txt
Now I want to grep this output to only related to cpanel, for f in 'cat output.txt' echo $f | grep "cpanel" if [ $? -eq 0 ] then do scp. But I am bit confused here, as in how to use scp command here. scp $f root@second_server:/$f ?
i want to used the output of search to copy in another destination examlpe. fine /home/* mtime -1 i want to used the output of the find command to copy an another destination
hello I tried to find a good subject but it was the best of mine, anyway I'll explain it here. some time I do some thing like installing a new application in Linux terminal of my office PC but it take a long time and I have to go home during its installation or configuration process that it is not good to cancel it.My current solution is abandoning the process until next day. I wanted to know is there any way to redirect an input and out put of a terminal to another one, if it works I can continue my abandoned process by ssh to my Linux office PC and redirect that terminal to my new remote sshed terminal from my home.
I want to pipe the output of a command into grep as the search TERM, rather than the text to be searched, like this for example
Code:
cat /var/log/auth.log | grep date "&b &d"
so that I only see the lines in auth.log for the current day...but obviously that line doesn't work.... is there a way to do this with grep, or even another command?
This is what I get when following the instructions to fix grub. I type in "grub-install /dev/sda" and that's the error I get.I'm trying to put Ubuntu or Mint on a Dell Mini 9 with 16gb ssd, but no matter what I do I cannot achieve this goal
if you do the command conky in terminal, it starts conky ofcourse, but it also shows output to that terminal so you can't do any other commands to that terminal, Is their an option like you can do with the '&' sign in other cases? If you do the '&' sign with conky it still gives output, also the conky -d command gives output...
I would like to capture all output spewed to a terminal session including processes that are terminated that were invoked from a script running in a terminal window. this is beyond capturing just stderr and stdout . for example
{ ./script } 2> stderr.cap 1>stdout.cap
if script is terminated (including because of memory violations) I get spewed output to the terminal I would like to capture that spewing to a file automatically or to a bit bucket /dev/null Is there another filehandle which can be redirected to do this? If so how or is there another way???
In synaptic package manager when I expand "Details" tab (at the time when some software is installed or removed), I can see a terminal. I want to capture the output of terminal into a file. I tried to highlight and right click. But there is no context menu(copy, cut)
I'd like to write a script that invokes a gnome-terminal session which slowly reads out text like the phosphor screensaver (could be anything, a log file, ascii art, song lyrics, whatev) and then closes. I can invoke a terminal using [gnome-terminal -e 'cat /var/log/dmesg'] but the output flies pass by too quickly.any way to slow it down? I know it seems like an odd request but if anyone has a suggestion I'd love to hear it.
I sometimes stick my neck out and provide somewhat detailed, and often risky, "Mr-fix-it" remedies for boot problems. Now, I know it's possible to amend each command with "whatever_command > whatever.txt" in which case it'll place the command output in a file in /home.
But if you're directing someone to run a lot of commands as I did here is it possible to save the output of all commands to a .txt file without amending each command?
Or is it already saved somewhere that I'm not yet aware of? I wouldn't be surprised if the latter were true, I just haven't yet found it
if we type a command such as "locate somefilename" in the terminal we will get all the paths to the file name as output. If i want to copy only one line from that output how do i do that without using mouse?i need terminal short cut to copy one line
I have a server client prog in which server is my 'agent' and client is 'manager'. Following is the code for both agent and manager. I want my agent to send what manager is requesting. But it is not working the way I want. The parameters which manager is requesting, agent has to send to manager but in this program result for those parameters is shown on agent's own terminal window. Where as I want them on manager's window. Secondly, there result is not correct, means it is giving ' 0 K ram and 0 no of process....
I am trying to display a text using crontab. My settings :
*/2 * * * * /bin/echo "hello"
This setting sends a mail to the user, instead of displaying on the screen. Now tried changing the setting to:
*/2 * * * * /bin/echo "hello" > /dev/tty1
Now I can see the text on the screen, but this setting comes with a catch. What would happen if the user changes the terminal. for instance if he gets into tty2, he wont have write access on tty1. So the user gets a mail saying "permission denied". Is there any way that I can force the user to use a particular terminal or can a cron job be set in a way such that the user would get the text irrespective of the terminal he logs in.
running current with 2.6.33.1-smp kernel i cant seem to get the slib slackbuild to run. it just quits without ever building the tgz. i hope i can attach the terminal output of the compile.
I'm new to Fedora and the Red Hat way of doing things, having been a Ubuntu/Mint user for the last 5-6 years. I've been using Fedora for my daily computer now for the last 3-4 months - a change that has definitely been for the better! However, earlier this morning I went to install a .rpm, and yum output via terminal the following error:
Code: [leeky@darkstar ~]$ sudo yum install opera [sudo] password for leeky: Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit Adding en_US to language list Loading mirror speeds from cached hostfile * fedora: mirror.netrino.co.uk * rpmfusion-free: mirror01.th.ifl.net * rpmfusion-free-updates: mirror01.th.ifl.net * rpmfusion-nonfree: mirror01.th.ifl.net * rpmfusion-nonfree-updates: mirror01.th.ifl.net * updates: mirror.netrino.co.uk Error: database disk image is malformed [leeky@darkstar ~]$
This is the first time I have received this error. I've now tried the following methods of resolving this problem with no luck:
1. Code: yum clean all 2. Code: yum clean metadata yum clean dbcache yum makecache 3. Physically removing the /var/libs/yum folder, and creating a new "yum" folder, and then step two above to rebuild it. Either way the problem then still returns in terminal.
Is there a way to get colored output when using tab completion in a terminal? My colors are fine everywhere else so I know that I've enabled a color terminal successfully. Using bash in Ubuntu (10.10).