linux wildcard usage in cp and mv

Let’s talk about how wildcards work for a minute. cp *.txt foo doesn’t actually invoke cp with an argument *.txt, if any files matching that glob exist. Instead, it runs something like this: cp a.txt b.txt c.txt foo Similarly, something like mv *.txt *.old …can’t possibly know what to do, because when it’s invoked, what … Read more

Spring mvc Ambiguous mapping found. Cannot map controller bean method

You should write @Controller(“/review”) public class ReviewController { and @Controller(“/book”) public class BookController { because in your code you have the two methods without an explicit/unique path for mapping(eg. if we have a call /edit/1 , this is impossible clearly to determine a controller’s method from your editBook BookController or ReviewController editReview)

How can I rewrite history so that all files, except the ones I already moved, are in a subdirectory?

To rewrite the history with the files moved: If you want the project’s history to look as though all files have always been in the directory foo/bar, then you need to do a little surgery. Use git filter-branch with the “tree filter” to rewrite the commits so that anywhere foo/bar doesn’t exist, it is created … Read more

How to use ‘mv’ command to move files except those in a specific directory?

Lets’s assume the dir structure is like, |parent |–child1 |–child2 |–grandChild1 |–grandChild2 |–grandChild3 |–grandChild4 |–grandChild5 |–grandChild6 And we need to move files so that it would appear like, |parent |–child1 | |–grandChild1 | |–grandChild2 | |–grandChild3 | |–grandChild4 | |–grandChild5 | |–grandChild6 |–child2 In this case, you need to exclude two directories child1 and child2, … Read more