Ludzie pragną czasami się rozstawać, żeby móc tęsknić, czekać i cieszyć się z powrotem.
Advanced and sophisticated text editor. Seems for gurus only:
"emacs is not just an editor, it is a way of living". Emacs surely seems rich or bloated, depending on your point of view. There are likely 3 versions of emacs installed on your system: (1) text-only: type emacs in a text (not X-windows) terminal (I avoid this like fire); (2) graphical-mode: type emacs in an X-windows terminal (fairly usable even for a newbie if you decide to take some time to learn it); and (3) X-windows mode: type "xemacs" in an X-windows terminal.
vi
The famous (notorius?) "vi" text editor (definitely not recommended for newbies). To exit "vi" (no changes saved) use these five characters: <ESC>:q!<Enter> I use the pico text editor and don’t ever need vi (well, unless I have to unmount the /usr subsystem and modify/edit some configuration 179
files, then vi is the only editor avialable). To be fair, modern Linux distributions use vim (="vi improved") in place of vi, and vim is somewhat better than the original vi used to be. The GUI version of vi is also available (type gvim in an X terminal).
Experts do love vi, but vi is definitely difficult unless you use it every day. Here is a non-newbie opinion on vi (http://linuxtoday.com/stories/16620.html):
"I was first introduced to vi in 1988 and I hated it. I was a freshman in college... VI seemed archaic, complicated and unforgiving... It is now 12 years later and I love vi, in fact it is almost the only editor I use. Why the change? I actually learned to use vi... Now I see vi for what it really is, a powerful, full featured, and flexible editor..."
A short introduction to basic vi commands and modes can be viewed at
http://www.thelinuxgurus.org/vitut.shtml.
For your entertainment, you may also want to try the even more ancient ed editor (just type ed on the command line).
joe
A nice and relatively newbie-friendly ascii-text editor. In my eyes, joe would come right after pico if I could remembered the WordStar or Borland-IDEs keystroke combinations.
nano
This is a brand new (March 2001) GNU replacement for pico. Works and looks like pico, but it is smaller, better, and licenced as expected for a decent Linux piece of software (i.e., GPL). Not yet included with RH7.0 or MDK7.2, but expect it soon to be.
khexedit
(in X terminal) Simple hexadecimal editor. Another hexadecimal editor is hexedit (text based, less user=friendly). Hex editors are used for editing binary (non-ASCII) files.
diff file1 file2 > patchfile
Compare contents of two files and list any differences. Save the output to the file patchfile.
sdiff file1 file2
Side-by-side comparison of two text files. Output goes to the "standard output" which normally is the screen.
patch file_to_patch patchfile
Apply the patch (a file produced by diff, which lists differences between two files) called patchfile to the file file_to_patch. If the patch was created using the previous command, I would use: patch file1 patchfile to change file1 to file2.
grep filter
Search content of text files for matching patterns. Definitely worth to learn at least the basics of this command.
A simple example. The command:
cat * | grep my_word | more
180
will search all the files in the current working directory (except files starting with a dot) and print the lines which contain the string "my_word".
A shorter form to achieve the same may be:
grep my_word * |more
The patterns are specified using a powerful and standard notation called "regular expressions".
There is also a "recursive" version of grep called rgrep. This will search all the files in the current directory and all its subdirectories for my_word and print the names of the files and the matching line:
rgrep -r my_word . | more
Regular expressions (regexpr)
Regular experessions are used for "pattern" matching in search, replace, etc. They are often used with utilities (e.g., grep, sed) and programming languages (e.g., perl).
In regular expressions, most characters just match themselves. The exceptions are the
"metacharacters" that have special meaning.
In regexpr, the special characters are: "\" (backslash), "." (dot), "*" (asterisk), "[" (bracket), "^"
(caret, special only at the beginnig of a string), "$" (dollar sign, special only at the end of a string). A character terminating a pattern string is also special for this string.