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'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple).
My own computer doesn't have this, how can I configure it? I'm using Xubunto, if more details are needed let me know -- I'm not much of a Linux user (I don't know what's relevant here).
I have a folderA that contains folderB that contains a lot of files. I would like to get rid of folderB, but not its contents. I want those contents to be inside of folderA. How can I accomplish this on the commandline?
Because I have to stare at my command prompt all the time on my computer, it should look at least half-decent, so I am trying to get it colored. The expected outcome is as seen on this site. I have the colors I want set in my .Xdefaults file, but they of course do not color my prompt.
Currently the terminal prompt looks like this:[karlis@karlis-desktop current_folder]$How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets?I checked the preferences for the default Gnome-Terminal and Terminator - there are no settings for this. It is pretty hard to use terminal when working in directories with long names.
I have looked almost everywhere for how to change my default shell prompt. When I open my bash shell, the prompt is [fedora-dev@Fedora-Dev Documents]$. I would like it to open at fedora-dev@Fedora-Dev]$.
Can someone tell me where to change this at. I have looked in .bashrc, etc/profile, and environmental variables.
I need to create a shell script called 'custinfo' to prompt a customer to enter and display back the following: name, age, address, phone number, and product.
I would like to run some existing scripts and send it to a text file:
Note: 'script' is an exist shell script Note: '/opt/2011jun15/my.db' auto generates everyday with only changes to the directory 2011jun15 base on the current date
currently i will need to run the script manually and make changes to the path below, change directory name 2011jun15 daily and text file new2011jun15.txt ./script -f /opt/2011jun15/my.db > new2011jun15.txt
Am i able to write a shell script to prompt me for a change of path for only '2011jun15' and 'new2011jun15.txt'?
It will be great if i can automate the whole process?
I am stuck at a issue in shell scripting. I had tried all the possible ways, yet unable to reach a solutions. I am working on a application, which runs on C shell. For this I had created a installation script, which installs my application in the system, it is working fine. Now, the problematic part is that I had set an alias in ".cshrc" file, which invokes my application when any user types it. But for an alias to take effect, I need to re-login into the system, because I have to read ".cshrc" file again, in order to take effect of my alias. However I can use "source ~/.cshrc" file after my installation, so that my aliasing works without logging back again. But Requirement is that, just after installing the application, alias should be available to user, without logging back again and without issuing any extra command.
I had tried one other way is that, I had created a symbolic link in ~/bin directory, which points to my application to be run, but even that require, to issue rehash command in order to modify internal command hash table. So, my overall problem is that changing alias in subshell should be reflected to parent shell,without running any other command (all commands should be run in installation script only). Or, in other way how to rehash parent shell from subshell. The ultimate requirement is that,the command that will run my application, should be available just after executing the installation script, either by aliasing or by rehashing, or by any other means.
....My only grip is that when you open the zip file, the parent directories are there too.
So within the zip file I have to navigate through "/root/Desktop/administration" just to get to the directory called backup.
Is there a way for me to zip the directory backup, and not include the parent directories? I want to be able to open the zip file and see only the backup directory listed.
I used to be able to open any folder in Nautilus and from there navigate to the parent folder. There was this arrow pointing up that had this function but I don't have the option any more.
Im pretty new to linux and Ive hit a wall. I have a folder 'forum'. I need all files and subfolders but I dont want them in forum. I have tried it with the gui, but it wont let me paste them. How do I move all the folder data without moving the folder itself via terminal?
I am facing a problem in Windows due to a virus called Newfolder.exe which creats files with the same name as it's parent directory and an extension .exe and this happens for every directory in the entire hierarchy in the infected pen drive. The antivirus detects them, but is sucking slow. So I thought this is a good opportunity to use the concepts of the all mighty shell script to remove those as they follow the same pattern. Say my complete path is
Code:
/home/pkd/fol1/
The virus would have created an file with complete paths
Quote:
/home/pkd/fol1.exe
If fol1 has two more directories fol11 and fol12 Then there would be two more .exe(virus created) in the following path
I do have an Ubuntu Headless server which is running Samba on it. My mp3 file collection resides on that server on is being share.
So far, no problems connecting to that drive and writing from my Windows box on that share. But if I use my main laptop, which runs Ubuntu Lucid and download an mp3 song from Amazon, the moment I move that to the share, I got permissions problems from the Windows machine. This is clearly a permission issue with group and others; the song is being created on the share without read and write permissions to others or the samba group I created.
My question is. How can I make this process simple or automatic, when moving songs to the share? I don't want to go there everytime and run ...
Code:
Which was basically how I reset or fixed the problem.
I've read about umask, but not sure if that applies here or not, because I'm not creating the file but moving it.
I have a parent folder, with a lot of sub folders. basically, i'd like to bring all the contents from the sub folders into the parent folder, and subsequently delete the sub folders. is there one command for this? or do i need to cp -r over and over again, and then manually delete?
I'm starting bash shell script and I'm looping without any solution.
I'm trying to find some files under a folder hierarchy and in case of errors moving these files to a destination folder under the same hierarchy recreating this hierarchy if not exists.
Finding all ._* files under /src and moving them to /dest recreating folder1 or the others which contains ._* files but without moving files which does not correspond to the pattern.
Code:
I tried find command and I'am getting all needed files
Code:
But I don't know how to use the output to get the parent folder of files which are found to
1- create folder with mkdir -p /dest/folder1 or /dest/folder1/folder4
2- move found files from /src/... to /dest/... with rm command
I'm working on a find command as this trying to do all in the same line but ... little lost
I keep getting a segfault in compiz. I've tried everything! This is from a fresh install without and accelerated drivers (I have ATI)
Quote:
Code:
**Switching to Compiz window management** /usr/local/bin/compiz-indicator:99: GtkWarning: Can't set a parent on widget which has a parent menu.append(kill) /usr/local/bin/compiz-indicator:100: GtkWarning: Can't set a parent on widget which has a parent menu.append(start)
Yesterday after downloading a file I tried to find it on the desktop where downloaded files are saved. It does not appear in nautilus but when I look for it from command line it appears to be there. I simply do 'ls' for this and that means its not hidden.Googled it for an hour to find a suitable answer but most of the posts focus on removing the in front of file name which is not the case here.
My folder have some files and I want to show the number of files on folder at "Total file on folder: " Ex: Monday folder have six files and it will show "Total file on folder : 6" when I run a script. This is my code :
#!/bin/sh if [ -d /home/kenzo/Monday/ ] && { echo "Monday" ls -l /home/kenzo/Monday/
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:
can i use one samba share with a folder showing the contents of another directory.shortcuts don't work on non ubuntu systems and it won't resolve links to files no on the share