Effective “Copy & Paste” for Quick CRUD Application Development

Stop updating the file names, classes or variables one by one!

Why Copy &Paste?

How did we copy & paste?

Step #1. Find out the files
Step #2. Copy the files to a new directory
Step #3. Update the file names one by one
Step #4. Jump into every file and update the class names one by one
Step #5. Jump into every file and update the variables one by one
Step #6. Use the files

Why Copy & Paste is boring?

# Data Model
# Data Service (class + interface)
# Endpoint (Controller)

How to “copy & paste” quickly?

cp admin-users/ admin-departments/ -rf
ls | grep user | awk '{print $1, $1}'| awk '{gsub(/user/, "department", $2); print $1, $2}'  | sed 's/^/mv /g'
1. Update 'user' & 'department' as whatever you need;
2. 'user' & 'department' are case sensitive;
3. Be careful of the plurals.
find ./ -type f -iname "*" -print | xargs sed -i 's/user/department/g'find ./ -type f -iname "*" -print | xargs sed -i 's/User/Department/g'

Full Stack Developer (specialised in .NET Core, Angular and ReactJS)