Sponsored Content
Full Discussion: Sort roman numerals
Top Forums Shell Programming and Scripting Sort roman numerals Post 302508105 by locoroco on Friday 25th of March 2011 07:45:47 PM
Old 03-25-2011
Sort roman numerals

If I use ls to print all the files of a folder, is there a way to sort using roman numerals?

I am thinking about a result like:
benjamin_I.wmv
benjamin_II.wmv
benjamin_II.wmv
benjamin_III.wmv
benjamin_IV.wmv
benjamin_V.wmv
benjamin_VI.wmv
benjamin_VII.wmv
benjamin_VIII.wmv
benjamin_IX.wmv

The roman numerals are always preceded by an underscore.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting only numerals from string.

Hi!!! i have two files "tushar20090429200000.txt" and "tushar_err20090429200000.txt" The numeric part here is date and time. So this part of file keeps changing after every hour. I want to extract the numeric part from the both file names and compare them whether they are equal or not. ... (4 Replies)
Discussion started by: tushar_tus
4 Replies

2. UNIX for Dummies Questions & Answers

Using CUT command to get only numerals from a string

I need help to get only the numerals from a string Ex : var1=Nightfox has 2 red apple(s) I need to cut only the numeral 2 and move it to a variable. var2=`$var1 | cut -c 14` the cut by character doesnt work, how to get only the numeral ? (2 Replies)
Discussion started by: happyrain
2 Replies

3. UNIX for Dummies Questions & Answers

Deleting lines starting with spaces then non-numerals

I did a search but couldn't find a thread that seemed to answer this but my apologies if it has been answered before. I have some text files and I need to remove any line that does not start with a number (0-9). In actuality every line like this starts with a 'T' (or 't') but there are a... (5 Replies)
Discussion started by: skray
5 Replies

4. Shell Programming and Scripting

How to select only those file names whose name contains only numerals.

Hi Guru's, Before writing to this forum I have searched extensively on this forum about my problem. I have to write a shell script which takes out only those file names from the given directory which contains only numbers. For example, In the given directory these files are present: ... (5 Replies)
Discussion started by: spranm
5 Replies

5. Shell Programming and Scripting

Sorting with header and mixed numerals (scientific and decimal) | awk

Assoc.txt CHR SNP BP A1 TEST NMISS OR STAT P 1 rs2980319 766985 A ADD 4154 1.024 0.1623 0.8711 1 rs2980319 766985 A AGECAT 4154 1.371 6.806 1.003e-11 1 ... (6 Replies)
Discussion started by: genehunter
6 Replies

6. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

7. Shell Programming and Scripting

Help with sort word and general numeric sort at the same time

Input file: 100%ABC2 3.44E-12 USA A2M%H02579 0E0 UK 100%ABC2 5.34E-8 UK 100%ABC2 3.25E-12 USA A2M%H02579 5E-45 UK Output file: 100%ABC2 3.44E-12 USA 100%ABC2 3.25E-12 USA 100%ABC2 5.34E-8 UK A2M%H02579 0E0 UK A2M%H02579 5E-45 UK Code try: sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies

8. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

9. Shell Programming and Scripting

[FUN] Numbers to Roman letters/num

Heyas Just a little fun script (code block) i'd like to share for fun. #/bin/bash # roman.sh # # Function # num2roman() { # NUM # Returns NUM in roman letters # input=$1 # input num output="" # Clear output string len=${#input} # Initial length to count down ... (9 Replies)
Discussion started by: sea
9 Replies
FOREMOST(8)						      System Manager's Manual						       FOREMOST(8)

NAME
foremost - Recover files using their headers, footers, and data structures SYNOPSIS
foremost [-h] [-V] [-d] [-vqwQT] [-b <blocksize>] [-o <dir>] [-t <type>] [-s <num>] [-i <file>] BUILTIN FORMATS
Recover files from a disk image based on file types specified by the user using the -t switch. jpg Support for the JFIF and Exif formats including implementations used in modern digital cameras. gif png bmp Support for windows bmp format. avi exe Support for Windows PE binaries, will extract DLL and EXE files along with their compile times. mpg Support for most MPEG files (must begin with 0x000001BA) wav riff This will extract AVI and RIFF since they use the same file format (RIFF). note faster than running each separately. wmv Note may also extract wma files as they have similar format. mov pdf ole This will grab any file using the OLE file structure. This includes PowerPoint, Word, Excel, Access, and StarWriter doc Note it is more efficient to run OLE as you get more bang for your buck. If you wish to ignore all other ole files then use this. zip Note is will extract .jar files as well because they use a similar format. Open Office docs are just zip'd XML files so they are extracted as well. These include SXW, SXC, SXI, and SX? for undetermined OpenOffice files. Office 2007 files are also XML based (PPTX,DOCX,XLSX) rar htm cpp C source code detection, note this is primitive and may generate documents other than C code. all Run all pre-defined extraction methods. [Default if no -t is specified] DESCRIPTION
Recover files from a disk image based on headers and footers specified by the user. -h Show a help screen and exit. -V Show copyright information and exit. -d Turn on indirect block detection, this works well for Unix file systems. -T Time stamp the output directory so you don't have to delete the output dir when running multiple times. -v Enables verbose mode. This causes more information regarding the current state of the program to be displayed on the screen, and is highly recommended. -q Enables quick mode. In quick mode, only the start of each sector is searched for matching headers. That is, the header is searched only up to the length of the longest header. The rest of the sector, usually about 500 bytes, is ignored. This mode makes foremost run considerably faster, but it may cause you to miss files that are embedded in other files. For example, using quick mode you will not be able to find JPEG images embedded in Microsoft Word documents. Quick mode should not be used when examining NTFS file systems. Because NTFS will store small files inside the Master File Table, these files will be missed during quick mode. -Q Enables Quiet mode. Most error messages will be suppressed. -w Enables write audit only mode. No files will be extracted. -a Enables write all headers, perform no error detection in terms of corrupted files. -b number Allows you to specify the block size used in foremost. This is relevant for file naming and quick searches. The default is 512. ie. foremost -b 1024 image.dd -k number Allows you to specify the chunk size used in foremost. This can improve speed if you have enough RAM to fit the image in. It reduces the checking that occurs between chunks of the buffer. For example if you had > 500MB of RAM. ie. foremost -k 500 image.dd -i file The file is used as the input file. If no input file is specified or the input file cannot be read then stdin is used. -o directory Recovered files are written to the directory directory. -c file Sets the configuration file to use. If none is specified, the file "foremost.conf" from the current directory is used, if that doesn't exist then "/etc/foremost.conf" is used. The format for the configuration file is described in the default configuration file included with this program. See the CONFIGURATION FILE section below for more information. -s number Skips number blocks in the input file before beginning the search for headers. ie. foremost -s 512 -t jpeg -i /dev/hda1 CONFIGURATION FILE The configuration file is used to control what types of files foremost searches for. A sample configuration file, foremost.conf, is included with this distribution. For each file type, the configuration file describes the file's extension, whether the header and footer are case sensitive, the maximum file size, and the header and footer for the file. The footer field is optional, but header, size, case sensitivity, and extension are not! Any line that begins with a pound sign is considered a comment and ignored. Thus, to skip a file type just put a pound sign at the beginning of that line Headers and footers are decoded before use. To specify a value in hexadecimal use x[0-f][0-f], and for octal use [1-9][1-9][1-9]. Spaces can be represented by s. Example: "x4F123IsCCI" decodes to "OSI CCI". To match any single character (aka a wildcard) use a ?. If you need to search for the ? character, you will need to change the wild- card line *and* every occurrence of the old wildcard character in the configuration file. Do not forget those hex and octal values! ? is equal to x3f and 63. There is a sample set of headers in the README file. EXAMPLES
Search for jpeg format skipping the first 100 blocks foremost -s 100 -t jpg -i image.dd Only generate an audit file, and print to the screen (verbose mode) foremost -av image.dd Search all defined types foremost -t all -i image.dd Search for gif and pdf's foremost -t gif,pdf -i image.dd Search for office documents and jpeg files in a Unix file system in verbose mode. foremost -vd -t ole,jpeg -i image.dd Run the default case foremost image.dd AUTHORS
Original Code written by Special Agent Kris Kendall and Special Agent Jesse Kornblum of the United States Air Force Office of Special Investigations. Modification by Nick Mikus a Research Associate at the Naval Postgraduate School Center for Information Systems Security Studies and Research. The modification of Foremost was part of a masters thesis at NPS. BUGS
When compiling foremost on systems with versions of glibc 2.1.x or older, you will get some (harmless) compiler warnings regarding the implicit declaration of fseeko and ftello. You can safely ignore these warnings. REPORTING BUGS
Because Foremost could be used to obtain evidence for criminal prosecutions, we take all bug reports very seriously. Any bug that jeopar- dizes the forensic integrity of this program could have serious consequenses. When submitting a bug report, please include a description of the problem, how you found it, and your contact information. Send bug reports to: namikus AT users d0t sf d0t net COPYRIGHT
This program is a work of the US Government. In accordance with 17 USC 105, copyright protection is not available for any work of the US Government. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
There is more information in the README file. Foremost was originally designed to imitate the functionality of CarvThis, a DOS program written by the Defense Computer Forensics Lab in in 1999. v1.5 - May 2009 FOREMOST(8)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy