Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
The point is the contents are different, all my folders have a file called 'blah.txt' containing outdated information.
do you mean '*.txt'
Originally Posted by 313
I want to insert a new, completely different 'blah.txt' into every folder with current info.
Also, it's important for various reasons that the files be independent of each folder, not symbolic.
Sorry, from your initial wording I got the impression you wanted to replace all aubergine.txt files with a new aubergine.txt file
Originally Posted by 313
Even a way to bulk remove the old and copy the new file would do the trick.
for File in /music/*/*/*.txt;do
echo cp -v /path/to/NewTxtFiles/$(basename $File) $File
Will just print the commands
If they look right,
copy'n'paste them ( if only a few )
remove the echo
add | sh to the end
e.g. use UpArrow get get last command from history, and just add |sh<enter>
The question is, how do you produce this new info? If they are new contents to replace the old contents, where do you get them? If they are files of same name but new contents that would replace (by copying or moving and overwrite, and not creating new) the old ones, where would they come from? Is it necessary to replce the old files with new files or do you intend to just update the information in the old files? Lastly would the new update files would really be of the same name from the old files or would they be new? Please decide about that.
Btw sorry my previous code was meant to rename the files only.