You are here: Articles > UNIX > UNIX

 See more articles about "UNIX "

Convert DOS line breaks to Unix line breaks

 

This one liner will convert a file with DOS line breaks to a file with Unix line breaks

tr -d '\15\32' < dos-format-file > unix-friendly-file

 

Also see ...

Find a file by name in UNIX/Solaris/Linux
H3Using the find command, locate a file by name/H3PTo find a file such as filename.txt anywhere on the system: br / br /div class="code"find / name filename.txt printP br /Recent operating system versions do not require the print option because this is the default. To limit

Copy and paste text with vi or vim
H3The ability to duplicate text in an editor can be handy. vi and vim have several useful copy and paste commands./H3PThe command 'Y' or 'yy' copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively: br / br /div class="

Find files using a wildcard in UNIX
H3When you want to find all of the files matching a certain filename pattern, a wildcard can be used with the find command/H3PTo find all files ending with .html: br / br /div class="code"find / name \*.html printP br /The character causes the shell to ignore the following c

Search for text in vi or vim
H3vi and vim have powerful searching capabilities because they bring to bear the richness of regular expressions. /H3PTo search for the next occurence of the text 'maybe' from the current cursor position, type: br / br /div class="code"/maybe<ENTER> br /P br /Search ba

Find out which process is holding which socket open
H3You've run netstat an. You see that port TCP/65237 is listening. What program is actually running and holding that port open? Here's how to find out./H3PSometimes you notice odd ports open and listening on your machine. In this day and age, that's often a bad thing. But what do you kil