Month: February 2007
Linux
Read More
Replace all instances of one word with another in a file
sed -i ‘s/ord1/ord2/g’ filnavn
Linux
Read More
Convert DOS Carriage Return file to Unix Line feed file
tr ‘\r’ ‘\n’ < sourcefile_dos.txt > resultfile_unix.txt An alternative is to use the program hd2u which is a DOS < –> Unix convertor dos2unix -U 2006-12.md5 Converts from DOS to Unix, doing a Unix to DOS use the -D switch.
Linux
Read More
Copy several files to a new filename
for f in *.dist; do cp $f `basename $f .dist`; done