General :: Delete A Subfolder ABC From Main Project Folder?
Jul 29, 2011
I want to delete a subfolder ABC in a main Project folder Globe. It occurs in many subfolders. It is very hectic to search and issue an rm -rf ABC command. I need to make a script for that .
I have many folders with many subfolders. All I want it to get the folder name and the first subfolder. I tried using ls -R but this give me more than I want it. Let say I have:
How to move folder which have same name in subfolder Path : /root/Documents/untitled_folder/untitled_folder/abc.txt I want to move files from that folder how to do that
Output : /root/Documents/untitled_folder/abc.txt through terminal any idea ? and plz suggest a way to do in all folder present in directory recursevely how to check recursively in all folder's present in directory
I have a small bash script that compress all folders in a specific folderThe script also:- add a password to the compressed files- delete the original folder after compressionSuppose that this script is called "rar.sh".At some particular moment, there will not have any folder in the specific folder since they have all been compressed.I want something (a script?) that will check (every minute approximately) if there's new folder in the specific folder.If there's new folder, then execute script rar.shor if there's not new folder, then re-scan in the next minute.
Recently I setup a system for a non-technical user. He is only using Firefox, Pidgin and OpenOffice for about 2 hours a day. I have created a folder "/home/jim/myFiles" where he can save his document files. But Jim has accidentally deleted his myFiles folder on 2 occasions. He had intended to delete a file in that folder. Is there a way to lock the folder so that the user and create/read/write documents in that folder but not delete the folder itself?
SO after using Testdisk to recover some images, the folders recup_dir.1 & 2 have saved in my FIle System area, when ever I try to press delete noting happens. I have also tried rm -f -rrm -f -fIt still dont delete, I have also deleted my user account and made a new one, but the files are still there.
I have accidentally created a very large folder that contains probably more than a million files. I have tried to delete it using all of these methods:(1) rm -rf myfolder/(2) Using midnight commander trying to delete the folder(3) find myfolder/ -type f | while read -r; do rm -v "$REPLY"; sleep 0.2; done(4) find myfolder/ -type f -print0 | xargs -0 rm -fThe find command would give an out of memory error, and other methods would just freeze the computer. I knew a few of the file names, but even if I tried to do ls myfolder/filename0, it hangs.
Is there any function to delete a folder which has few files in it ?I tried rimdir() bit it can only delete empty folders; unlink() can not delete directory entries. any other function ?
I'm using ubuntu server 9.10 for a home build NAS. Everything is working great just have one more thing to figure out. I have Samba set up to access my files and I set up a recycle feature so anything deleted will get moved to a Recycled folder. (I learned this the hard way after hitting delete key by accident while browsing the shares in windows. Lost 100 GB of data)
Now it is for the most part working but the permissions on folders isn't getting set right. If I delete a file in a share I can go to Recycle bin folder and delete the file for good. But if I delete a folder I can not access that folder to delete or restore from the Recycle bin folder. I have to chmod the folder before I can do anything with it. Anything I can change to get folders deleted via windows to have the right permissions when it is moved to the Recycle bin folder?
I'm trying to make my first c project (a simple tic tac toe console game), and I am wondering how to make a final product (copy all source code files to a distribution folder upon compilation). Should I use a bash script or should I use a makefile to make the distribution folder? I'm not terrible familiar with either; I have a basic makefile to make an executable, and that's about all I know of make.
And if I do use a bash script, how do I copy over source code files? I tried cp ./*.c and cp ./*.h, but I think the script read it literally as moving a file named ./*.c (and ./*.h), and couldn't find it.
I currently have a command to backup a directory it will zip the directoryand place it where i have told it too, Now what i am after is a command i can run before my code, that will delete and tar.gz files before todays dateso i my ideal world it would be something like this, delete <'date +%m_%d_%y'.tar so this will delete all the files in this folder before todays date,
I have a folder in my Home folder and called "Projects". I want to change the icon of the folder Project so the icon changed in everywhere. In "Places", Open Dialogs, Save Dialogs and Normal View in Nautilus.
What I have done: Change the icon using Right-Click -> Properties -> Basic Tab -> Clicked the current icon and changed it.
But this changed it only in Nautilus. If I added this folder to "Places" it will appear with the Default icon. The same thing if I browsed to it using Open Dialogs or Save Dialogs.
I have Ubuntu Jaunty 9.04 updated to 9.10 and have downloaded Remaster from Remastersys. I followed all of the instructions, which were simple enough. However, there must be some instructions missing as the process failed. Working with Remaster through Synaptic Manager, the iso was downloaded into my "home" folder into its own Remaster folder. It was not the iso, like you get when downloading a distro from the Internet, which downloads just an iso onto the Desktop. Inside the folder were a bunch of empty files (I know, because I opened them) and an iso . At this point the Remaster instruction stop. They do not say what to do with the other files, or what they have to do with the iso of my Ubuntu layout. So, like any other iso (once I knew which one was the iso of my setup), I double clicked on it and it ran me through the process of accessing the DVD to burn it. Which I did. I tested it and it failed with some kind of message to the effect that certain files were missing or it could not read it. So, I thought, I would have to do the 'hunt and peck' method and experiment a few times like I did with the ordinary distro downloads until I get it right. But first, I would have to dump the Remaster folder in the "home" folder since it took up so much space on my hard drive. Wrong! I come to find out it is in something called "root" and that I do not have permission to do anything with it but "copy" it. Great. Just great! Now what do I do. I tried to change permissions, but was not allowed to do that either. The only thing I could think of - and dread - was the idea of having to wipe my hard drive and go through the whole reinstall procedures, which takes me days, just because Remaster has locked itself into my system - and there is no 'back door' to get out of it.
I want to limit delete of a particular folder in the user's home folder and to restrict any add/change/delete on files in that restricted directory. /home/myuser /home/myuser/_protected //no delete /home/myuser/_protected/1.txt //only read How can I do that on Ubuntu server?
how to delete a file or folder via apt-get remove but my written any rates and stops also tried rm and the file name again failed some sort of ideas otherwise I'm with Nokia n900
When I was using Ubuntu 10.10 I was able to add menus, edit and delete them from the main menu by right clicking on the menu and selecting Edit menus [URL]. After installing Ubuntu 11.04, I found that I can't add, edit or delete any menu. Any one knows how to add, edit and delete menus from the main menu?
just install kde in ubuntu couple of hours ago.i was just checking the panels and widgets.unfortunately i delete the bottom main panel. so i cant access any thing.just desktop is seen.without kde bottom panel kde is useless.its looks like this.snapshot1.pngwhat can i do. i want it to default position ?
why I cannot upload local files to subfolder in my home folder on FTP server? Say, i wanna upload files to /home/haolh/trial/occ/src/occ, but following error msg were given...
commandput "C:Proj rialoccsrcocc" "occ" error/home/haolh/trial/occ/src/occ: open for write: permission denied
After google this prob, i've tried commands as below but it still failed
is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.
I was wondering, i have a webfolder and have permissions set to 770 with group being www-data. I would like to give access to one folder to a friend so he can edit images, css, etc. I made that folder 770 with group being site_name with www-data and him being in the group. So far so good it sounds like. However when i use the full path to the directory linux says it doesnt exist.
Is there a way i can make it so he doesnt have r/w file on files inside the parent directories and still access the directory i want to give him?
I am attempting to use the zip command with the '-x' option to exclude a folder e.g. 'zip upload.zip public_html -x public_html/jquery/*'. However, parts of this folder are still being added to the archive. I made a shell script (saved as 'compress.sh' and ran as '. compress.sh') to do the archiving so I could test adding nested wildards for multiple subfolder levels.
Code:
#!/bin/bash rm -f upload.zip zip -r upload.zip public_html -x public_html/jquery
[code]....
Each new line I added here that has the nested wildcards made the archive file size a bit smaller. Adding more /*'s than this didn't affect the file size. Even after all this though, there were still a couple megabytes of files and folders from the 'jquery' directory that were added to the archive.
Here's some examples of files and folders that were created after I unzipped the archive: public_html/jquery/js/tablesorter/addons/pager/icons [folder] public_html/jquery/js/tablesorter/addons/pager/.svn/entries [file] public_html/jquery/js/tablesorter/build/.svn/text-base/js.jar.svn-base [file]
Why is it that despite all the -x lines, the files and folders like these were still being added to the archive? How can I simply recursively exclude the entire public_html/jquery folder from the archive?
i'm using Maverick 10.10 and have noticed my Documents folder that should be in the above --Places link has just vanished today. No commands have been run this week. The only update i had was yesterday with new headers and kernels for x86 64.
I have system that was cloned from another system hence the user was same in both computer. I changed the computer name - to TANU. Then I added another user - BANU. I gave admin rights to second user. Logged out the first user DON- who is now only the desktop user. Before deleting the account through users and groups - I deleted the folder DON from home folder. I restarted the comp. unable to login. I had created automatic login for both users. How to restore the folder DON while using root shell.
i locked a folder of pictures on my linux and now want to delete them, but it wont even let me open the folder or do anything with it, what do i do to unlock it then delete i
I have a Macbook 2,1 since 2007. Last week my hard drive just died, so I decided to replace it with a new one, no problems with that. The problem came when I had to install an operative system, because my DVD drive has been broken for a year and a half now. I know we can easily install MacOSX from an external usb drive, but I don't have a big enough pendrive at the moment. So I went for Ubuntu. I have managed to get an Ubuntu 10.10 live usb stick working like charm, if anyone is interested. I just downloaded the latest i386 iso and followed this advice by pxwpxw for the 32bit EFI.
The only thing I had to change in the boot.cfg was the name of the iso and -very important- changed initrd.gz for initrd.lz. The live usb works great. But I decided to do an installation on the hard drive. I installed it using the whole hard drive and didn't get any errors. But when I boot the macbook it doesn't detect anything. I guess I need an EFI bootloader or something to make it work. I've tried to follow this guide but it seems to be intended for someone who already has MacOSX and the Ubuntu installation working. I just want to install a bootloader or whatever I need from the "outside" (from the live usb I'm using). I tried to just throw reFit into the main hard drive's root folder but it doesn't work. I think that maybe creating an HFS+ partition and installing reFit in it may work, but I don't think I can create that kind of partition from the Ubuntu usb and I also need a working MacOSX to run the enable.sh. I've also read of elilo but I've seen that it hasn't been updated for 3 years