subdirectory

In Unix, how do you remove everything in the current directory and below it?

耗尽温柔 提交于 2019-12-03 01:47:08
问题 I know this will delete everything in a subdirectory and below it: rm -rf <subdir-name> But how do you delete everything in the current directory as well as every subdirectory below it and the contents of all of those subdirectories? 回答1: Practice safe computing. Simply go up one level in the hierarchy and don't use a wildcard expression: cd ..; rm -rf -- <dir-to-remove> The two dashes -- tell rm that <dir-to-remove> is not a command-line option, even when it begins with a dash. 回答2: Will

Git repository within Git repository [duplicate]

放肆的年华 提交于 2019-12-03 00:59:40
This question already has answers here : How do I work with a git repository within another repository? (4 answers) I have a main git repository A and we are using sources out of another git repository B in a subdirectory of our main project. Now it would be good to have the B repository checked out within the A repository in this used subdirectory. If someone else then clones the repository of course he should get our main repository A and within that automatically the B repository. Let me visualize the directory structure: + main_repository - the root directory of the main Repository + src -

Recursive make in subdirectories

限于喜欢 提交于 2019-12-03 00:25:08
How can I order make command in the Makefile to execute recursively in all subdirectories make commands (defined in the Makefile in the subdirectories)? Eldar Abusalimov Read Recursive Use of Make chapter of GNU Make manual. Learn Peter Miller's Recursive Make Considered Harmful article. ... PROFIT!!! P.S. A code snippet from my answer to a different yet related question could be used as a rough approximation. @eldar-abusalimov, the first link you posted assumes the makefile knows what are the subfolders. This is not always true, and I guess thats what @tyranitar would like to know. In that

make wildcard subdirectory targets

China☆狼群 提交于 2019-12-02 22:39:54
I have a "lib" directory in my applications main directory, which contains an arbitrary number of subdirectories, each having its own Makefile. I would like to have a single Makefile in the main directory, that calls each subdirectory's Makefile. I know this is possible if I manually list the subdirs, but I would like to have it done automatically. I was thinking of something like the following, but it obviously does not work. Note that I also have clean, test, etc. targets, so % is probably not a good idea at all. LIBS=lib/* all: $(LIBS) %: (cd $@; $(MAKE)) Any help is appreciated! The

Android Studio - How to make modules inside a subdirectory?

霸气de小男生 提交于 2019-12-02 22:35:05
Suppose that I had 3 modules: mod1, mod2 and mod3. In normal case, the file system hierarchy should be: [android_root_dir] build.gradle # list this file just to make it clear. ----mod1 ----mod2 ----mod3 But what I want is: [android_root_dir] build.gradle # list this file just to make it clear. ----modules ----mod1 ----mod2 ----mod3 how to do it in Android Studio 1.1.0? PS: I find this article but it does not seem to work, or it works for earlier versions of AS, not 1.1.0: How can I move a module inside a subdirectory? You can do it: root build.gradle settings.gradle modules mod1 build.gradle

How to find a library with cmake?

[亡魂溺海] 提交于 2019-12-02 20:58:20
To link an executable with a library that resides in a standard location, one can do the following in a CmakeLists.txt file: create_executable(generate_mesh generate_mesh.cpp) target_link_libraries(generate_mesh OpenMeshCore) This would work if the library, that is being linked against, was placed in /usr/local/lib/libOpenMeshCore.dylib However, in this case the library resides under /usr/local/lib/OpenMesh/libOpenMeshCore.dylib How can I specify that target_link_libraries should really link against a library placed in a sibdirectory? I wonder there is some useful option to target_link

Recursive Search Through Subfolders BACK to Root Directory

和自甴很熟 提交于 2019-12-02 18:28:01
问题 I have a function that works to search through the subfolders of a given directory and finds the file name I need. However, it only goes through one set of subfolders, finding the first one and then going through to the end of the subfolders. However, it then just stops. I have looked through various threads and tried different options but no joy. I need it to then loop back to the root directory (say, sPath=C:\Windows) and look at the next subfolder, go through that whole directory, come

Accessing text file within subfolder

我是研究僧i 提交于 2019-12-02 18:20:38
问题 File Structure I have a folder, called test_folder , which has several subfolders (named different fruit names, as you'll see in my code below) within it. In each subfolder, there is always a metadump.xml file where I am extracting information from. Current Stance I have been able to achieve this on an individual basis, where I specify the subfolder path. import re in_file = open("C:/.../Downloads/test_folder/apple/metadump.xml") contents = in_file.read() in_file.close() title = re.search('

Configure git to track only one file extension

血红的双手。 提交于 2019-12-02 17:12:44
I have one directory tree with many kind of different files. There are 300 directories on the parent directory. Each directory could have other sub directories. I only want to track *.cocci on all sub directories. Here is my .gitignore: * !*.cocci But it do not work, as the files on sub directories are not tracked. How can I tell git that I only want to track *.cocci on all sub directories? simont Read this question . You want: # Blacklist everything * # Whitelist all directories !*/ # Whitelist the file you're interested in. !*.cocci Note, this'll track only *.cocci files. Yours doesn't work

In Unix, how do you remove everything in the current directory and below it?

社会主义新天地 提交于 2019-12-02 15:45:21
I know this will delete everything in a subdirectory and below it: rm -rf <subdir-name> But how do you delete everything in the current directory as well as every subdirectory below it and the contents of all of those subdirectories? tvanfosson Practice safe computing. Simply go up one level in the hierarchy and don't use a wildcard expression: cd ..; rm -rf -- <dir-to-remove> The two dashes -- tell rm that <dir-to-remove> is not a command-line option, even when it begins with a dash. Will delete all files/directories below the current one. find -mindepth 1 -delete If you want to do the same