General :: Sorting Files In A Directory?

Jan 6, 2010

I have some files in a directory like

file1.txt
file10.txt
file2.txt

[code]...

View 5 Replies


ADVERTISEMENT

General :: Include Special Characters When Sorting Files By Name (Fedora 12 I386)?

Feb 15, 2010

I am dragging my files over to a new Fedora 12 installation and I just noticed that special characters are not taken into account when sorting files by name (I want '_js' to come before 'images').Is there a way to make the sorting process behave like Windows, where files starting with a special character are listed first?

View 5 Replies View Related

General :: Merging And Sorting Multiple Files With "sort"?

Jun 3, 2010

I have a bunch of text logfiles in the following format:

ID (17 characters)
Timestamp (14 characters YYYYmmddHHMMSS e.g. "20060210100040" -> 2006/02/10 10:00:40)
Random data (? characters)
end of line

The files are already sorted by timestamp.I need to get 1 log file with all the logs from multiple logs files, sorted by timestamp. Note that the log files are really huge, around 3-4G each (and there are dozens of them) I tried the following command:

sort -s -m -t '|' -k1n,1n +17 -o data_sort.txt *.TXT

Here is how I ended up with this command:

-s : don't bother with tie results
-m : merge all logs files
-t '|' : there is no | in my logs, so the whole line should be field 1

[code]....

Actually... it fails miserably. The output file data_sort.txt is just the concatenation of all files, not sorted at all.

View 4 Replies View Related

Ubuntu :: Automatically Sorting Files?

Mar 25, 2010

I download files onto my networked file server which is running Ubuntu 9.10.By default, all files are moved into the Downloads folder, I'd like to use a script or program to automatically send them into one of 5 shared folders based on what the file is.For example: archived files would be software by default, .avi or mpeg Videos, and .flac or .ogg would be Music.

View 1 Replies View Related

Ubuntu :: Sorting Files Based On Filename?

Nov 2, 2010

I'm currently trying to organize a media server so that things will be in some kind of logical order rather than the current setup of dumping everything of a certain content type into a single folder. However, the size and diversity of content within these disorganized folders precludes me doing things manually. Does anyone know of a program or script that could sort the files into folders based on part of a filename

View 7 Replies View Related

Fedora :: Automatically Renaming Files While Sorting By Date?

Apr 17, 2010

I often record music from the webradio with Streamtuner.How can I rename the mp3 files recorded in a way that numbers are added to the beginning of the filename representing the order in which the titles were played on the webradio station?I am looking for an automated solution like a renaming tool since there are usually hundreds of files in a directory. I used autorename / ARen for windows back in the day when I was still on XP. What I could do with the tool was:a) Sort the files by date of creationb) add an increasing number at the beginning of the filename based on the position in the sorted list.

View 3 Replies View Related

Ubuntu :: Logical Volume Sorting Individual Files?

Jun 5, 2011

So I just had a quick question on logical volumes and such with ubuntu. I've been looking into setting up a storage array of 4 2tb hard drives for media storage in my house but have ran into a wall with with sort of array i should use, whether it be setting up a full raid system (raid 5 or 10 most likely) or using LVM for stripping. The one thing with LVM however, is that there is no parity or redundancy built into it in case 1 hard drive fails. I was wondering if it was possible to create something similar to that of LVM stripping, but instead the logical volume is sorted into whole individual files, not stripping them across the array. That way, if one drive fails, sure, i lose the contents of the one drive, but the rest of the content isn't lost and I have no loss of space because there is no inherent parity.

View 1 Replies View Related

General :: Perform A Long Directory Listing Of All Files In The /bin Directory That Have Exactly Three Characters In Their Name?

Jan 18, 2010

How do you perform a long directory listing of all files in the /bin directory that have exactly three characters in their name?

View 1 Replies View Related

General :: Files Created In A Directory Owned By Directory Group?

Jan 29, 2010

Is there a way, on Linux, to cause all new files created in a directory to be owned by the directory's group instead of the creating user's group?

View 2 Replies View Related

General :: Cronjob Directory / Send An Email If Directory Contains More Than Ten Files?

Oct 13, 2010

I want to run a cronjob every 15 minutes that checks a directory for files. If the directory contains more than ten files I want it to send an email to me.

All I have is this...

*/15 * * * * ls -l | wc -l | [filename] | mail -s "This is just a test" [email address]

I would rather not write a bash script. Is there an easier way to do this? I was looking into some commands like find and grep.

View 6 Replies View Related

General :: Find Directory Older Than X And Mv Directory With Sub Files Command?

Jul 13, 2011

I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively

View 4 Replies View Related

General :: Symlink Each Of The Files In One Directory To Another Directory?

Feb 11, 2011

If I have a directory /foo with a few files in it, how do I symlink each entry in /foo into /bar/? For instance, if /foo has the files a, b and c, I want to create three symlinks:

/bar/a -> /foo/a
/bar/b -> /foo/b
/bar/c -> /foo/c

View 3 Replies View Related

Ubuntu :: Copying Files To A Directory And Skip The Files That Already Exist In The Directory?

Jun 30, 2011

How would i go about copying files to a directory, yet skip the files that already exist in the directory, and also remove the files that are in the directory. For example:

Code:

$ls /dir1
img001.jpg
img002.jpg

[code]....

Now i would like to copy from dir1 to dir2, but the contents of dir2 would be:

Code:

$ls /dir2
img003.jpg

View 7 Replies View Related

General :: Sorting A File With A Variable Name?

Jun 27, 2011

I am trying to sort a file, so I can compare it to another file later. I am storing the file name in a variable called curMo. I then call sort $curMo and it hangs for a very long time and I have to quit the process. why this is not working or how to make it work?

Here is part of my code:

#sort this file for this Location
sort -u $curMo -o $curMo.sorted

View 1 Replies View Related

General :: How To Refresh Htop After Sorting (via Shift+m)

Jun 22, 2011

I love using htop, but I have noticed that whenever I sort by a parameter (for example, Shift+m for sorting by Memory usage), the htop stats stop dynamically refreshing. Is this intended? I also notice this with top as well.

View 1 Replies View Related

General :: Sorting A First Non-numerical Column In A File?

Jul 13, 2011

I have a file like:

ER- V67
ER+ V68
ER- V69
ER+ V70

[Code]....

I am using the code:

sort -k1

but it prints it by sorting the second column.

View 8 Replies View Related

General :: Sorting In Aggregate Rather Than Tree Fashion With 'ls -Rt'?

Apr 28, 2010

The command: Code: ls -lRt Shows a recusrive listing, and sorts by modification time. But this in in tree fashion, where it first lists the contents of the current folder sorted by time, and then the contents of each child folder sorted by time. How would one accomplish this type of sort, but with an aggregate listing - all items recursively sorted together, rather than by individual folder?

View 3 Replies View Related

General :: Sorting In Vi Editor & Copying To Clipboard

May 6, 2010

(1)There should be a command to send content to clipboard instead of 36 buffers available in vi just like ':set paste' allows pasting from clipboard inside vi using ctrl+shift+v in insert mode.(Currently I select area using mouse & right click then copy )


2)Let us say I have sentence "I am young" I want to arrange the words in this line in alphabetical order so that I get 'am I young'. First I thought replacing space by in sentence.Then !#j then type sort -n where # represents number of words.Then #J to join the filteredlines.It works but now I have file with hundreds of sentence of varying length.If I make a macro how will it know the number of words?

View 9 Replies View Related

Programming :: Deleted Files In Directory With So Many Files Without Deleting Directory Itself

Nov 14, 2010

There are millions of files in many directories. Wherenver i try rm * or find or use xargs, they say 'argument list too long' and exit. How can i deleted files in a directory with so many files without deleting the directory itself.

View 3 Replies View Related

General :: Sorting Output By A Column With Numbers And Letters

May 22, 2011

I have a program that prints out lines like:

And I want to be able to pipe it to sort on that third column, by letter first, then number. But I keep coming getting files sorted like:

(field separations all start at same place, so columns are not jagged like above.)

I have read the sort man pages, and have tried -n for the numbers, and -k for the position to start sorting, among other things. I also tried inputting a second position to start sorting, which sort should supposedly refer to if the two entries are identical at the first place being compared, but it seems to just ignore the second one. I just can't get it to sort the numbers properly...

For now I am manually opening the file in emacs and changing them around, needless to say, very time consuming.

View 13 Replies View Related

General :: Can't Copy Files From Directory With "&" Symbol In Directory Name

Mar 18, 2010

I am using my media server as my podcast collector. I am in the process of learning the ins and outs of NFS so i can mount a NFS directory and transfer my podcasts from server to player. For now i am using scp to transfer podcasts from server to desktop then to player. The problem is the path to the directory of one of the podcasts is /home/user/gpodder-downloads/The BILL&TIMMY Show Podcast.

whenever i try and run my scp command it fails because it thinks that TIMMY is a script i want to run in the background. I have tried to back-slash escape the character, i've tried single quoting and double quoting the character and i still get the same problem. as it sits now i have to move all podcasts to another directory and then transfer them to my desktop...but i would like to transfer the podcasts without un-necessary steps.

View 8 Replies View Related

General :: Display String In Row / Column - Time Sorting Operation?

Aug 13, 2010

1. Given a string, row no. and col. no., I want to display it in the screen appropriately. how to do this?
2. How can I find the cpu processing time taken in carrying out the sorting task (any sorting program)?

View 4 Replies View Related

General :: Copy Files From Directory Of One User To Directory Of Another User?

Apr 15, 2011

Is it possible to copy files from directory of one user to directory of another user in linux?

View 7 Replies View Related

General :: How Long Are Files Kept In /var/tmp/, And How To Use The Directory

Jul 26, 2010

I'm always hesitant to use /var/tmp/, because I never quite know exactly how long the files are kept there for, or even what the directory is used for. What determines when a file gets removed from /var/tmp/, and how is the directory intended to be used?

View 2 Replies View Related

General :: Delete Files In A Directory - RM?

Jun 17, 2010

I have a USB drive that I boot using SysLinux. I think select one of several options to complete a task. I do not have access to edit those Kernels. I need to add a option from the Syslinux menu where I can delete all the files from a specific directory.

View 3 Replies View Related

General :: Deleting All Files From Directory Except For Two

Nov 25, 2010

I'm writing a Perl script which performs linux commands.I have a directory with a load of files.

Code:exec_cmd('rm $(ls * | grep -v file1)');
This command will delete all except for file1. How can I modify this to delete all files except for file1 & file2?

View 2 Replies View Related

General :: Copy Files From Directory ?

Dec 22, 2009

I have four directories and i want to copy only the files in the directory to a single directory, how can i do it with the cp command.

The directories names are dir1, dir2, dir3 and dir4 and i want only the files from these directories to a single directory called mainDir.

View 3 Replies View Related

General :: How Many Files Are In Lab07 Directory?

Jun 18, 2010

So I am taking an half online/ half go to school class. I am working on an assignment that is due tonight by midnight. I am kind of confused on this question and am waiting on an email from my instructor but only have 2.5 hrs left til it's done. Here is the question.Use file globbing to copy all the files in the /labs/data directory that end with a .out to the lab07 directory. How many files are in the lab07 directory?when I ls -l into this directory. I don't see any files with that extension. Is there an easier way that I am missing such as. cp /labs/data *.out > lab07 ??? Someone help?

View 6 Replies View Related

General :: Tar Command For Directory With Files

Feb 24, 2011

Using tar command. All I need the usage, and basic explanation. Let's assume I have a directory with files that I need to tar, how do I go about it.

View 14 Replies View Related

General :: Move Files To Another Directory Using A Cron Job?

Sep 29, 2009

I have a php script in cron directory that generates 5 textfiles, after the files are generated, I want to create a script that will move the 5 text fiels to anoher folder name "web".

View 2 Replies View Related







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