General :: Bash Script To Categorize Folders On Similar Names?

Oct 10, 2010

Any script to categorize folders with similar name into one directory. For example: There are 4 directories named LinuxFedora, LinuxUbuntu, WindowsXP and Windows7. The script should be able to create two folder named Linux and Windows wheree respective directories are moved.

Next example: If there are many folder as below:
DevLys 010
DevLys 010

[code]...

View 1 Replies


ADVERTISEMENT

General :: Copy The Contents Of A Txt File To Other Txt Files (with Similar Names) By Cp Command?

Jul 2, 2010

Code:
cp -r aa123.h aa*.h
results in
Code:
cp: target `aa456.h' is not a directory

Yes I read man page cp (1p). There is something written there about it, I couldn't understand though.

View 7 Replies View Related

General :: Syncing Two 90 Percent Similar Folders?

Nov 21, 2010

I have a project folder that I pass back and forth between my desktop and laptop via Samba. Both are running Debian. The folder is large. I would like to be able to change a few files in the folder on my desktop and then "update" the folder on my laptop without having to pass the entire folder back over the network.

View 3 Replies View Related

Fedora :: Copy Files With Prompt For Similar File Names?

Nov 17, 2009

has anyone used some software tool for copying a file from one location to another (I mean local files - for example from one folder to another), which prompts if you already have this file, or a similar one...I'm going to use it for my file archive ... mostly for my MP3For example, I might have the folder /home/user/MP3/Heavy Metal/Old/Downloaded/Metallicabut have forgotten that I already have Metallica in this folder and now I want to copy my new music collection to my archive folder which contains for example this folder:MP3/Rock/MetAllicA-Full-DiscographyI need copy files software which will tell me:"You already have folder with similar name to 'MetAllicA-Full-Discography' called 'Metallica', do you want to skip this folder, or copy it to location 'MP3/Heavy Metal/Old/Downloaded/'?"This way I will reduce the file redundancy in my file archive, or at least will keep similar items close to each other ..

View 5 Replies View Related

Ubuntu :: Only Search For Similar Case Sensitive File Names?

Jan 22, 2010

Anybody know of a way to search only for similar case sensitive files? By which I mean doing a wildcard search across a drive & the only results are like: Abc.txt abc.txt VID_001.avi Vid_001.AVI .. etc.

I've already tried searching the forums & google but the closest I've found is regarding files with increasing numbers (music_001.mp3, music_002.mp3, etc), which doesn't quite fit with my issue, as they would be seen as different files on a case insensitive OS.

View 2 Replies View Related

General :: Recursively Rename Files/folders To Make Their Names Windows-friendly?

Jan 29, 2011

I have a bunch of files on a Ubuntu box, which have various characters in their filenames that Windows doesn't accept (mostly ":" and "*", but possibly others).What's the simplest way to get these all renamed and moved to a Windows machine? It's OK to replace these characters with something like "[colon]" and "[asterisk]".

View 1 Replies View Related

General :: Concatenate Variable Names In Bash?

Apr 7, 2011

In my script, and I would like to concatenate 2 variables names, to give me the true variable.I've 3 variables X1, X2 and X3, and I invoked them inside a for loop.

Code:
#!/bin/bash
X1=HELLO

[code]....

View 4 Replies View Related

General :: Configure The Way Bash Completes Directory Names?

Sep 7, 2011

I'd like to instruct bash to use a special method to perform completion on certain directory names. For example, bash would call a program of mine to perform completion if a path starts with "$$", and perform completion normally otherwise. Is this at all possible? How would you implement it? The goal is to allow autojump to complete paths for all commands when the user starts them with a certain prefix. So for example when copying a file from a far directory, you could type: cp $$patern + <Tab>

and autojump would complete cp /home/user/CompliCatedDireCTOry/long/path/bla/bla and you would just have to add where you want to put the file. Of course I can use ott's comment to add it to a few specific commands

View 3 Replies View Related

General :: File Names And Tilde--not For Home Directory--in Bash?

Jun 6, 2011

I understand the tilde (~) at the end of a file displayed in bash is a backup file in the Linux file system. Is there a way to keep these hidden when listing the contents of a directory?

View 2 Replies View Related

Ubuntu :: Folders That Is Similar To Windows C Drive?

May 10, 2011

I am not sure what to google on this noob question.In windows, i have c: drive and can create folders where i can place my files or install software to.So in ubuntu, where should have my own files placed to? say software like tomcat and liferay or custom folder.

View 4 Replies View Related

General :: Want "xcopy /a" Behavior From Bash Or Similar?

Jul 1, 2011

As I recall in the days of DOS and routine use of command.com,the xcopy command had an option -- I think it was "/a".When xcopy processed a file, it would alter the state of the archive attribute such that multiple runs of the same command would catch whatever was missed by the previous run. A common use was to fill diskettes and similar small storage media.xcopy a group of files === rats, media fullxcopy catches more files === repeat ad libxcopy eventually catches the last remaining files

View 7 Replies View Related

General :: Bash: Find Folders With Less Than X Files?

Sep 18, 2010

How would I go about finding all the folders in a directory than contain less than x number of .flac files?

View 2 Replies View Related

General :: How To List Folders Using Bash Commands

Sep 14, 2011

Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )

View 3 Replies View Related

General :: Bash - Create Folders According To Date In System?

May 26, 2011

Is there any other short/easier and smarter way to do the following in Linux? code...

I need to use crontab to create folders every day and every month inside /home/abcd/dammi, /home/abcd/harrami, /home/wxyz/dammi and /home/wxyz/harrami. Can anyone help me with this?

View 2 Replies View Related

General :: Tab-Completion In Bash Indexing System Folders?

Nov 15, 2010

tab-completion indexes system folders (like /usr/bin, /usr/local/bin)! so say i'm in a folder that has two files, 'text' and 'myprog', i type in an 'm' then tab, and i get hundreds of results including 'mysql', 'mysqlconfig', and others as im sure you can imagine. is there a way to set it to default or something else that will only make it index the current folder?

i tried changing my PATH variable so i could execute programs in the current directory without './' - what i added to PATH was ':.' at the end (apparently this is not the way to do it... :S). i tried resetting PATH various times ('unset PATH', 'PATH=$whatever...') but this has not fixed the problem. using 'unset PATH', of course, removes everything from PATH, which meant that functions (like 'ls') in /usr/bin and /usr/local/bin can't be found. obviously i want those to be found, but i would rather not tab through them!

View 2 Replies View Related

Ubuntu :: Bash: Compare 2 Wav's Files If Similar

Dec 20, 2010

I would like to compare them, in terms of amplitude, length, tempo, ... Which program could basically analyse them giving an sufficient output data

View 2 Replies View Related

Debian :: Copying - Folders Or Files With Names That Contains Nordic Letters

Feb 7, 2010

I'm about to move a lot of folders from an older computer (sarge/etch) over to a newer with Lenny. But I get problems when I reach folders or files with names that contains nordic letters like øå. I'm using an external drive to move the folders. What is the easiest and best way to do this.

View 1 Replies View Related

Ubuntu :: Unpack And Move Downloads To Folders Based On Their Names

Apr 3, 2011

When I used windows as my media server I had a program called SCRU (Scene release unpacker - [URL] that could unpack and move my downloads to folders based on their names. Is there something like that for linux?

View 1 Replies View Related

General :: Make A Bash Script That Automatically Delete The Home Folders?

Feb 15, 2011

I am administrating a lab in a university and every semester we need to delete all the home folders of the accounts for the next semester. I would like to make a bash script that does this automatically and having trouble with it. Note that I am writing my very first bash script. What I need to do is make a script to delete the following:

Delete everything in /home/$exp$num/$dir
when "exp" could be either "rt", "ic" or "sp".
"num" could run from 1(single digit) to 45 and dir is "profile" and "work".

This is what I tried to write:

Code:

#!/bin/sh
cd /home
for exp in "rt ic sp"
do

[code]....

What seems to be the problem is the reading of "$exp$num" as a joint expression.

View 4 Replies View Related

Ubuntu Multimedia :: Rhythmbox Making A Mess Of Folders And File Names

Jan 8, 2010

I've been enjoying using Rhythmbox to rip a stack of CDs. Initially I had problems getting it to recognise Lame but following uninstalling and reinstalling it, it seemed to be working well. That is, until I looked in my Music folder.

It turns out files have been placed in individual folders, named "number - title.udio" (e.g.: "11 - She Can Do What She Wants.udio". The mp3 file itself is named identically throughout - it's the string for the gstreamer settings, i.e. "x-raw-int,rate=44100,channels=2 ! lame name=enc preset=1002 ! xingmux ! id3v2muxmp3".

The settings within Rhythmbox's properties for folder and file naming are all set to the sensible default. This is a pain. In the short term I'm going to try EasyTAG to sort it out, but ultimately I need to sort this or find alternative software.

View 3 Replies View Related

Programming :: Script That Change The Names Of Files And Folders Into Small Letter?

Oct 2, 2009

i want to make a script that change the names of files and folders into small letter because they are all in capital and more than 1000 fileit is impossible to do that with my hand

View 14 Replies View Related

General :: Printing From Bash Shell / Concatenate Files Into One File With File Names Included?

May 11, 2011

I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.

Should I be looking to concatenate the files into one file with the file names included, and then print them?

something like: -printfunction -printername < file*

View 7 Replies View Related

General :: BASH Script To Move Files/folders To Either The .Trash File Or To Another Direcotry?

Dec 2, 2010

I am looking for a script/advice or guidance on how to write a script so that when I use the 'del' command it removes/sends the files/folders to a I specify for example 'dustbin

View 13 Replies View Related

Programming :: Bash Script To Find And Remove Similar Lines From Multiple Files?

Jun 5, 2009

I want to remove duplicate or multiple similar lines from multiple files. I.e. if I have four files file1.txt file2.txt file3.txt and file4.txt and would like to find and remove similar lines from all these files keeping only one line from these similar lines. I only that uniq can be used to remove similar lines from a sorted file.

View 9 Replies View Related

Ubuntu :: Combine Multiple Folders Into One "folder" Similar To Way That Windows7 Does Libraries?

Jan 23, 2011

Is there a way to combine multiple folders into one "folder" similar to the way that Windows7 does Libraries? That way movies, for instance, would be able to be distributed on multiple drives, but appear in one place, when wanted. sort of like mounting multiple folders on on one mount point.

View 6 Replies View Related

Fedora :: Do Bash Completion Of Package Names In Yum?

Jul 12, 2011

Can fedora do bash completion of package names in yum?

View 4 Replies View Related

Programming :: Bash File Names With Spaces?

Jul 24, 2010

I have a laptop that I am in through SSH. The laptop does not have an Xwindow system so I am using the program fbi to open an image on my laptop screen from my SSH connection:

fbi -T 8 picture.jpg #this opens the image on the laptops tty8 terminal

I've found that making a for loop does not work with files that contain a space in the name. Something to due with a bug that they call a "feature" that stops the first variable at the first whitespace.

Using a "while" loop is not exactly what i require either seeing as I want to be able to view each image in the directory on screen and tag it accordingly, before it jumps off to the next image, and I'm not sure how to add a pause to a while loop.

How do I make a Bash script and loop Variables handle files like "files that contain spaces.jpg"

View 5 Replies View Related

Programming :: Getting Directory Names From A Given Path In Bash?

Apr 11, 2009

I am programming in bash and really stuck finding directory names. I have a script to find all the .php files on my / partition which will return the whole path. Is there a way to print directory hierarchy with all those values leaving out the forward slashes.

View 10 Replies View Related

Ubuntu :: Bash - Check If All The File Names Are Correct?

Sep 23, 2010

I have bash script for converting files. I have a problem. If file name is "corrupted" then mv command for that file will not work. For example file with "-" in front of the name.

Is there a way to check if in some folder (subfolder) all the files have correct file names or they don't?

If they are all correct -> OK proceed with execution of the script!

If they are not all correct -> NOT OK stop with execution of the script!

View 4 Replies View Related

Programming :: Bash - Dynamiquely Evaluating Variable Names

May 23, 2011

I'll try to be clear but I think I'm in a mess with my code right now, so it may appear here too

Here is a function. The part I want you to see is the 'eval' sentence.

This works.

It evaluates ${SourceTxt} (which is $1), takes away a part of it and uses it as an array to put data in.

That's alright.

Code:

Now, later, I NEED to count the number of elements in the array(s).

So, I try to do something like....

Which gives me the evaluated name ('#txtFields_email_customers[@]' e.g)

Or

Which gives me nothing....

I was wondering if I was reaching the limits of bash in this kind of capabilities, or if there is a.... bash-like solution. I.e. a good solution

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved