How to save the shell's contents as a file?
After I run the command, locate gaim,
the information in shell is very long, I only can see the last part of the information. How to save the information in shell as a file? In that case I can see the complete information. Thank you. |
You could use:
locate gaim > /tmp/locate_gaim.out But it is probably easier to pipe the info into less: locate gaim | less If you are looking for the execuatable file try: whereis gaim |
Thank you.
All the three method of looking for files are useful to me. All are my need. |
You can also pipe long screen prints through grep to run a search.
cat /home/longfile | grep nemo This would print out the longfile, but not to the screen, to grep, which then searches longfile for the word nemo. Everytime it finds it, it prints out only that line. To use it in your example, if you knew the file gaim was in a bin directory, of which there are several on your system, then you could use... locate gaim | grep bin If there is a dir named "gaim", and you run a simple "locate gaim", it will list every file and sub-dir and file in the gaim dir. With the grep, it will only list files that also have "bin" in them. If I "locate apache" on my server, it lists 65 lines. If I "locate apache | grep bin", then it only lists 2. |
All times are GMT -5. The time now is 11:56 AM. |