Linux command line global search and replace
location: linuxexchange.com - date: July 15, 2014
I'm trying to search and replace a string in all files matched by grep on a linux machine. I've got some pieces of what I want to do, but I'm unsure how best to string them all together.
grep -n 'foo' * will give me output in the form:
For each file returned by grep, I'd like replace "foo" with "bar" and write the result back to the file. Is there a good way to do that? Maybe a fancy pipeline?
How to get display width of a string from Linux command line?
location: linuxexchange.com - date: August 18, 2014
I am working on an AWK script that processes a text file line by line, formats them and stuffs them into an SVG file text field. The SVG takes care of text wrapping automatically, but I want to predict where each line will wrap. (I need some characters to repeat and extend close to the end of the line). I know the exact font, font size, and width of the text field.
Is there a standard utility in Linux or easily available in Ubuntu that will give a width in pixels or inches given a string, font, and font size?
get-width 'Nimbus Sans L' 18 "test string"
returns "x pixels"
sort logfile by timestamp on linux command line
location: linuxexchange.com - date: September 8, 2011
I have a logfile with entries like:
freeswitch.log:2011-09-08 12:21:07.282236 [ERR] ftdm_queue.c:136 Failed to enqueue obj 0x7f2cda3525c0 in queue 0x7f2ce8005990, no more room! windex == rindex == 58!
freeswitch.log:2011-08-08 13:21:07.514261 [ERR] ftdm_queue.c:136 Failed to enqueue obj 0x7f2cda354460 in queue 0x7f2ce8005990, no more room! windex == rindex == 58!
freeswitch.log:2011-06-04 16:21:08.998227 [ERR] ftdm_queue.c:136 Failed to enqueue obj 0x7f2cda356300 in queue 0x7f2ce8005990, no more room! windex == rindex == 58!
freeswitch.log:2011-09-08 12:21:10.374238 [ERR] ftdm_queue.c:136 Failed to enqueue obj 0x7f2cda3581a0 in queue 0x7f2ce8005990, no more room! windex == rindex == 58!
How can I sort the file with linux command line tools by the timestamp in each row decending?
LXer: Learn the Linux command line
location: linuxquestions.com - date: July 25, 2007
Published at LXer:
Eight must-know Linux commands that will turn any Linux novice into an apparent command line guru. Go on. Impress your friends and family.
how to compile a big project in linux command line?
location: ubuntuforums.com - date: June 10, 2010
I've got the "OpenCryptoKi" project source from "sourceforge.net" at here:
But I don't know how should I compile and build it by "GCC" or "Make"?!
I have ubuntu 9.04 and I've set the linux runlevel at 3, but I'm not so familiar with compiling such project at
commandline environment of linux!
Please help me how to compile this?!!
I'm so hurry!!
[SOLVED] Linux command line SQL client
location: linuxquestions.com - date: August 3, 2015
I was just wondering if there is any tool or a way to display tables in Linux console so that they are not messed up like this:
MariaDB [test]> select * from tabeleczka;
| lp | name | surname | age | jklvgjkdrlxhgxkldgh
| 1 | bozydarnik | jkojglsjgsdjg | stopiecdziesiat | fjaklsegjsklghsdkjg
i would like to achieve something that actually looks like a table. Is it possible?
Linux command line : edit hacked index files
location: linuxexchange.com - date: August 19, 2014
I'm unfortunately once more dealing with a hacked site on a Linux Plesk server. While the issue is fixed with FTP access changed (it got down to the famous Filezilla FTP codes hack on a PC) I'd appreciate to know how to edit files as it may take over an hour to restore the site to the most recent backup we have, and I'd be glad to have it back online faster.
it now starts like
As that chain contains a variable, could you help me find a sure-fire method to edit all the changed Index files (about 80 found) ?
I have used a SED re
Gnokii working in Linux command line but not in PHP system command
location: linuxexchange.com - date: January 13, 2012
Gnokii working in Linux command line in RHEL5 but not through PHP system command. What to check?
PDF compare on linux command line
location: linuxexchange.com - date: June 27, 2011
I'm looking for a Linux command line tool to compare two PDF files and save the diffs to a PDF outfile. The tool should create diff-pdf's in a batch-process. The pdf files are construction plans, so pure text-compare doesn't work,
<tool> file1.pdf file2.pdf -o diff-out.pdf
Most of the tools I found convert the pdf's to images and compare them, but only with a GUI.
Any other solution is also welcome.
ubuntu linux: command line “rm R /media” safe to do?
- date: March 10, 2013
I'm trying to clear out an old ubuntu installation on a different partition (sda5).
I'm currently running ubuntu from sda1 partition.
Is it safe to do the following (just checking):
:/media/sda5# rm -R /media
I'm only asking because:
:/media/sda5# ls -R /media
obviously shows a lot of files referenced in there...
PS: Is there anything that needs saving from that partition??? (I've got the old /home directory on a different partition.) I've heard about some /home encryption files being stored within /var (doesn't apply to me anyway). Are the mysql data there by default? Any other issues?
The question was really about: if I delete the contents of sda5 with rm -R, do the symbolic links to media/ also lead to deleting content on those linked partitions (in the same way as ls -R does give me the files even on the other partition)? I don't think so, but would like to be assured. I.e. the question is not how to delete directories o
Page: 1 2 3 4 5 6 7 8 9 10