I have a problem. Inside this directory, /Library/Developer/CommandLineTools/SDKs I have 5 folders (MacOSX.sdk, MacOSX10.15.sdk, MacOSX11.1.sdk, MacOSX11.3.sdk, MacOSX11.sdk)
Now I need to program on the command line from terminal, (using gcc), is it a problem if I delete these folders since they are contained within the CommandLineTool folder?
Attention, i don't want to delete the whole directory, only the 5 folders
Related
wp-dropbox is a directory in my dropbox.
Dropbox-Uploader/dropbox_uploader.sh delete /wp-dropbox
The command delete the wp-dropbox and all files in it.
How can i keep the directory --wp-dropbox,at the same time to delete all files in it?
Dropbox-Uploader/dropbox_uploader.sh delete /wp-dropbox/*
The above command can't achieve my target.
The Dropbox API doesn't offer the ability to delete all of the files in a folder without deleting the folder itself. We'll consider it a feature request.
Workarounds:
List all of the files and delete them specifically.
Delete the folder entirely, and then recreate just the folder.
I was messing with the move command in Command Prompt, and I accidentally moved a file into a folder that didn't exist. When I tried 'dir', the invalid folder was listed, but it wasn't a directory, and it didn't show up under 'tree'. If I renamed the file as a .zip, it had folders within like _rels, docProps, and word, as well as [Content_Types].xml. Each folder contained several more xml files, but none had the document I had just misplaced. Is there a way to get it back or have I lost it permanently?
Ok, so basically what happend is that you tried to zip the .docx document, and then you got all of these folders. It simply what happens when you zip a word document.
There's nothing strange, you can just make it .docx again and it will be as normal.
I have an ongoing list of 'Enquiry' folders within a directory. I'm trying to create a batch file that can sit within each of these folders that, when run, will move the folder it resides in to a 'Projects' folder.
From my attempts, and as half expected, I'm realising it's not possible to move the folder containing the batch file (or copy folder and then delete source folder containing the batch), so my second thought is to position a single 'master' batch file outside of the 'Enquiry' folders, and have a shortcut within each Enquiry folder that links to that 'external' batch file.
For this, I'd need to obtain the location path of the shortcut calling the batch, is this possible?
Or is there a better way to achieve my aim?
Just an extra note in case it helps anyone, I had to make the following changes to ensure file path with space was ok (putting %enqfolder% in quotes) and I also need to a '\' after 'projects' in the move command. Thanks again to #Klitos.
setlocal
set enqfolder=%cd%
cd ..
move "%enqfolder%" ..\projects\
Following on from the comments to your question, the reason it doesn't move the folder is that when the batch file runs, the current directory is still the enquiry folder. You need to move out of it and then move it. Also, as it turns out, you don't have to delegate to a "master" batch file either. You can just do the move in the same batch file (but the move should be the last line of the batch file; once the batch file itself moves, the command processor won't be able to read the following lines).
setlocal
set enqfolder=%cd%
cd ..
move %enqfolder% ..\projects
I am writing a shell script to move all files from one directory to other. Say I want to move all files from directory dirA to directory dirB. When the move is in progress, some user is copying some files to dirA. How do I ensure that, whatever file the shell script is trying to move, has finished copying? What would happen if we try to move a file which is still being copied?
The list of filenames is generated as soon as the move command is issued. Any changes after that will not be taken into account. So if new files are created during the move process, they won't get impacted.
You may have to run your script in a loop.
If one of the files that is part of the move command is still being modified (after being opened in its old place), the changes would
propagate to the new place when the change operation is complete and the file is closed.
How can I move files from multiple folders to another location. For example if I have 3 folders with name /test/folder1, /test/folder2, /test/folder3 and I want to move the contents of these folders into another location like /temp/folder1, /temp/folder2 /temp/folder3 using a script. I do not want to move these folders, instead I want to move the files inside these folders. Please Help
Something like
cd test
for dir in folder*; do
mv "$dir/*" "/temp/$dir"
done