Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strings(1) [ultrix man page]

strings(1)						      General Commands Manual							strings(1)

Name
       strings - print ASCII strings in program

Syntax
       strings [-|a] [-o] [-number] file...

Description
       The command looks for ascii strings in a binary file.  A string is any sequence of 4 or more printing characters ending with a newline or a
       null.

       The command is useful for identifying random object files and many other things.

Options
       - or -a	 Looks through the entire object file for ASCII strings.  Default is to look only in the initialized data space.

       -number	 Sets the minimum string length to specified number of characters and default is 4.

       -o	 Precedes each string with its file offset (octal).

See Also
       od(1)

																	strings(1)

Check Out this Related Man Page

strings(1)							   User Commands							strings(1)

NAME
strings - find printable strings in an object or binary file SYNOPSIS
strings [-a | -] [-t format | -o] [-n number | -number] [file...] DESCRIPTION
The strings utility looks for ASCII strings in a binary file. A string is any sequence of 4 or more printing characters ending with a new- line or a null character. strings is useful for identifying random object files and many other things. OPTIONS
The following options are supported: -a | - Look everywhere in the file for strings. If this flag is omitted, strings only looks in the initialized data space of object files. -n number | -number Use a number as the minimum string length rather than the default, which is 4. -o Equivalent to -t d option. -t format Write each string preceded by its byte offset from the start of the file. The format is dependent on the single character used as the format option-argument: d The offset will be written in decimal. o The offset will be written in octal. x The offset will be written in hexadecimal. OPERANDS
The following operand is supported: file A path name of a regular file to be used as input. If no file operand is specified, the strings utility will read from the stan- dard input. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of strings: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWtoo | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
od(1), attributes(5), environ(5), standards(5) NOTES
The algorithm for identifying strings is extremely primitive. For backwards compatibility, the options -a and - are interchangeable. SunOS 5.10 20 Dec 1996 strings(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing two strings

Hi How do i compare two strings in shell script. Below is an example but I am not getting the desired output, plz help if then echo success fi I am not getting the desired output if I do this. plz help (24 Replies)
Discussion started by: ragha81
24 Replies

2. Programming

Returning Strings from C program to Unix shell script

Hi, I'm having a requirement where I need to call a C program from a shell script and return the value from the C program to shell script. I refered a thread in this forum. But using that command in the code, it is throwing an error clear_text_password=$(get_password) Error: bash:... (24 Replies)
Discussion started by: venkatesh_sasi
24 Replies

3. Shell Programming and Scripting

assign colon delimited strings to variables

Man it has been too long since I have had to do this type of stuff... OK I have a file with lines in it looking like this: bob:johnson:email@email.com (most lines) john:F.:doe:email2@email.com (but some are like this) I need to loop through and assign vars to the values: var Fname =... (29 Replies)
Discussion started by: NewSolarisAdmin
29 Replies

4. Shell Programming and Scripting

Grepping for Exact Strings

ok, apparently this is a very difficult question to answer based on my searches on google that came up fruitless. what i want to do is grep through a file for words that match a specified string. but the thing is, i keep getting all words in the file that have the string in them. say for... (27 Replies)
Discussion started by: SkySmart
27 Replies

5. Shell Programming and Scripting

How to Compare 2 Strings ?

Hello , I want to Compare with 2 strings and get if they are True or not please would like some help on this #!bin/ksh echo "Enter Name 1" read Name1 echo "Enter Name 2" read Name2 echo "------------------------" echo "First Name: $Name1" echo "Second Name: $Name2" echo... (25 Replies)
Discussion started by: shatztal
25 Replies

6. Shell Programming and Scripting

Picking matching strings

I have a list of file names. However in some instances I might have a "-" at the beginning of the filename or an "=". For example I might have something like this set Lst = "file1 file2 file3 -file4 file5=" I want to pick up the ones having "-" at the beginning or "=" and store them in... (22 Replies)
Discussion started by: kristinu
22 Replies

7. Shell Programming and Scripting

Join 2 separate strings into one with alternate tokens.

Hi, I have two strings eg: string1=abc|def|hij string2=12|13|14 I want a new string with string3="abc:12 def:13 hij:14" I am using shell scripting. Is there any method to do this? I tried using cut command but this wont advance the respective strings. Can anybody help in this... (31 Replies)
Discussion started by: sikku
31 Replies

8. Shell Programming and Scripting

Using arrays in bash using strings to bash built-in true

I have the following code and for some reason when I call the program using /home/tcdata/tatsh/trunk/hstmy/bin/bash/raytrac.bash --cmod=jcdint.cmod I get hasArgument = hasArgument = true Somehow the array element is returning even though I have not chosen the option. ... (41 Replies)
Discussion started by: kristinu
41 Replies

9. Shell Programming and Scripting

Sorting alphanumeric strings without a pattern

Good evening to all!! I'm facing this problem: I saved in a txt a list of files name (one txt for every folder): hello0.jpg hello1.jpg hello10.jpg hello11.jpg hello12.jpg hello13.jpg hello14.jpg hello15.jpg hello16.jpg hello17.jpg hello18.jpg hello19.jpg hello2.jpg hello20.jpg... (32 Replies)
Discussion started by: silver18
32 Replies

10. UNIX for Dummies Questions & Answers

retrieving data between two strings

I have input file like AAA AAA CCC CCC CCC EEE EEE EEE EEE FFF FFF GGG GGG i was trying to retrieve data between two strings using sed. sed -n /CCC/,/FFF/p input_file Am getting output like CCC CCC CCC (22 Replies)
Discussion started by: NareshN
22 Replies

11. Shell Programming and Scripting

Finding Strings between 2 characters in a file

Hi All, Assuming i have got a file test.dat which has contains as follows: Unix = abc def fgt jug 111 2222 3333 Linux = gggg pppp qqq C# = ccc ffff llll I would like to traverse through the file, get the 1st occurance of "=" and then need to get the sting... (22 Replies)
Discussion started by: rtagarra
22 Replies

12. Shell Programming and Scripting

Replace a multi-line strings or numbers

Hi I have no experience in Unix so any help would be appreciated I have the flowing text 235543 123 45654 199 225 578 45654 199 225 I need to find this sequence from A file 45654 199 225 (22 Replies)
Discussion started by: khaled79
22 Replies

13. Shell Programming and Scripting

Script to match strings that sometimes are splitted in 2 lines

Hello to all, I have an hexdump -C format as below: 31 54 47 55 48 4c 52 31 5f 52 31 32 31 31 32 ff 44 00 00 0E 01 32 14 56 42 17 47 48 0f ff ff ff 44 00 00 01 32 14 56 00 23 83 95 2f 42 17 47 48 00 0f ff ff 00 15 00 0a 48 00 01 5a 00 02 17 00 00 2f 00 00 30 00 00 31 00 00 ff 34 ff 44 00... (23 Replies)
Discussion started by: Ophiuchus
23 Replies

14. Programming

Merge two strings by overlapped region

Hello, I am trying to concatenate two strings by merging the overlapped region. E.g. Seq1=ACGTGCCC Seq2=CCCCCGTGTGTGT Seq_merged=ACGTGCCCCCGTGTGTGTFunction strcat(char *dest, char *src) appends the src string to the dest string, ignoring the overlapped parts (prefix of src and suffix of dest).... (30 Replies)
Discussion started by: yifangt
30 Replies

15. Shell Programming and Scripting

Remove lines containing 2 or more duplicate strings

Within my text file i have several thousand lines of text with some lines containing duplicate strings/words. I would like to entirely remove those lines which contain the duplicate strings. Eg; One and a Two Unix.com is the Best This as a Line Line Example duplicate sentence with the word... (22 Replies)
Discussion started by: martinsmith
22 Replies