using sed with find command

replace lines of files in current dir that starts with abc string by xyz

find . -type f -exec sed s/^abc/xyz/g {} +
Advertisements

extract tar files without folder structure

list of tar content

tar -tf files.tar.bz2 
usr/bin/ls
usr/bin/cat

decompress only files removing full path

tar -xjf files.tar.bz2 --strip-components 2 -C /tmp

decompress tar files removing 1 level directory

tar -xjf files.tar.bz2 --strip-components 1 -C /tmp