Using the sed -i (inline), you can replace the beginning of the first line of a file without redirecting the output to a temporary location.
If you can install rpl it's simpler to use and faster than combinations of find, grep and sed. See man rpl for various options. time on above operation: real 0m0.862s, user 0m0.548s, sys 0m0.180s using find + sed: real 0m3.546s, user 0m1.752s, sys 0m1.580s Show Sample Output
Syntax: $ prepend content to add [filename] Uses ed, so no temp files created.
The original command is great, but I often want to prepend to every line. Show Sample Output
This does the following: 1 - Search recursively for files whose names match REGEX_A 2 - From this list exclude files whose names match REGEX_B 3 - Open this as a group in textmate (in the sidebar) And now you can use Command+Shift+F to use textmate own find and replace on this particular group of files. For advanced regex in the first expression you can use -regextype posix-egrep like this: mate - `find * -type f -regextype posix-egrep -regex 'REGEX_A' | grep -v -E 'REGEX_B'` Warning: this is not ment to open files or folders with space os special characters in the filename. If anyone knows a solution to that, tell me so I can fix the line.
---- this line ends here but must be concatenated with this one "this line ends here" and should NOT be concatenated with this one
Prepend text to a file. It doen't need temporary files, ed or sed.
Replaces a string matching a pattern in one or several files found recursively in a particular folder.
Recursively replace a string in files with lines matching string. Lines with the string "group name" will have the first > character replaced while other > characters on other lines will be ignored. Show Sample Output
Changed out the for loop for an xargs. It's a tad shorter, and a tad cleaner.
recursive find and replace. important stuff are grep -Z and zargs -0 which add zero byte after file name so sed can work even with file names with spaces.
Regular expression search pattern to remove the Datetime and Name when you paste from skype chat into your text editor From this Gist: https://gist.github.com/webstandardcss/3967760857d6be470dda
The "map" may be different depending on the .wmv file.
run `ffprobe` to see which is the video-track in the .wmv file
usually this is "0.0".
Stream #0.0: Video:...
Stream #0.1: Audio: ..
and "1.0" corresponds to the 2nd input file - your new audio.
You may want to add "-acodec wmav2" and "-ar 128k" options for 128kbit/s
Windows Media Audio 2 or whatever audio-codec/quality your want. `ffmpeg
-codecs | grep "EA"` gives you a list of available codecs for Encoding
Audio.
Try using '-sameq' instead of '-vcodec copy' (re-encode the video with
same quality rather than a bit-exact copy - this often solves muxing
issues but will cause a small loss of either video quality or increased
bandwidth).
and also try a different output format eg. 'new_video.avi' or '..mov' instead of 'new_video.wmv'.
you may need both, this should work:
ffmpeg -i vid.wmv -i aud.wav -sameq -map 0.0 -map 1.0 output.avi
This version works on OS X (if you have installed `rename`)
IMPORTANT: You need Windows PowerShell to run this command - in your Windows Command Prompt, type
powershell
Create a log file of your Motorola Surfboard SB6141 downstream signal strengths.
Uses the built-in curl to request signal strength data from your SB6141 cable modem.
HTML page 192.168.100.1/cmSignalData.htm has the signal strength numbers for the 8 downstreams.
Some HTML/DOM processing parses out the 8 values from the above page.
The eight extracted signal strengths are then logged to a file.
A small while-loop watches the clock & repeats the process every 10 seconds.
Show Sample Output
It tries to identify the file types in a directory and adds or replaces them with their appropriate extensions. Please, update the "file" tool before use it (last version: 5.37): https://github.com/file/file
Find and replace specific characters in a single line in multiple files with sed. Show Sample Output
In case the line you want to join start with a char different than ", you may use \n.*"\n as regex.
This is a more concise answer to http://blog.commandlinekungfu.com/2011/09/episode-158-old-switcheroo.html in my opinion.
Replaces tabs in output with spaces. Uses perl since sed seems to work differently across platforms.
A much shorter version of this command.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: