Scrigroup - Documente si articole

     

HomeDocumenteUploadResurseAlte limbi doc
AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows
WordXml

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

tr linux command

linux



+ Font mai mare | - Font mai mic



tr

tr [options] [string1 [string2]]



Translate characters -- copy standard input to standard output, substituting characters from string1 to string2 or deleting characters in string1.

Options

-c, --complement

Complement characters in string1 with respect to ASCII 001-377.

-d, --delete

Delete characters in string1 from output.

-s, --squeeze-repeats

Squeeze out repeated output characters in string2.

-t, --truncate-set1

Truncate string1 to the length of string2 before translating.

--help

Print help message and then exit.

--version

Print the version number and then exit.

Special characters

Include brackets ([]) where shown.

a

^G (bell)

b

^H (backspace)

f

^L (form feed)

n

^J (newline)

r

^M (carriage return)

t

^I (tab)

v

^K (vertical tab)

nnn

Character with octal value nnn.

Literal backslash.

char1 char2

All characters in the range char1 through char2. If char1 does not sort before char2, produce an error.

char1 char2

Same as char1-char2 if both strings use this.

char

In string2, expand char to the length of string1.

char number

Expand char to number occurrences. [x*4] expands to xxxx, for instance.

class

Expand to all characters in class, where class can be:

alnum

Letters and digits

alpha

Letters

blank

Whitespace

cntrl

Control characters

digit

Digits

graph

Printable characters except space

lower

Lowercase letters

print

Printable characters

punct

Punctuation

space

Whitespace (horizontal or vertical)

upper

Uppercase letters

xdigit

Hexadecimal digits

char

The class of characters in which char belongs.

Examples

Change uppercase to lowercase in a file:

cat file | tr '[A-Z]' '[a-z]'

Turn spaces into newlines (ASCII code 012):

tr ' ' '012' < file

Strip blank lines from file and save in new.file (or use 011 to change successive tabs into one tab):

cat file | tr -s '' '012' > new.file

Delete colons from file; save result in new.file:

tr -d : < file > new.file


Politica de confidentialitate | Termeni si conditii de utilizare



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 588
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved