sed -n “20,40p” filename will display lines from 20 to 40 in the file.
Monthly Archives: May 2013
copy while preserving timestamps
Sometimes, it is useful to copy files while preserving its timestamps. cp -a source dest scp -p source dest To cp without replacement, we can use rsync -au source/ dest/
replace a string in files, reload files in emacs, change files names in batch,
1) To replace a string oldstring to newstring in some files, do sed -i ‘s/oldstring/newstring/g’ files 2) to reload files in email, just do ctrl c + ctrl v 3) to rename files in batch, do rename ‘s/oldstring/newstring/’ files