Friday, June 1, 2018

How to prepend text to all files in a directory

find  ./ -type f | xargs sed -i '1i wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh \
chmod +x Anaconda3-5.1.0-Linux-x86_64.sh \
./Anaconda3-5.1.0-Linux-x86_64.sh -b  \
source ~/.bashrc' $1



find ./ -type f   #Give all the files
xargs  # run thefollowing command
$1 #will be the file path

No comments:

Post a Comment