1645 shaares
This tutorial is written to help people understand some of the basics of shell script programming (aka shell scripting), and hopefully to introduce some of the possibilities of simple but powerful programming available under the Bourne shell. As such, it has been written as a basis for one-on-one or group tutorials and exercises, and as a reference for subsequent use.find bugs in your shell scripts
This essay shows a summary of how to handle filenames correctly for the impatient.
tips and tricks for working with splits in vim.
news.eternal-september.org is a private project providing free access to text-only Usenet News.
img.sh
prose.sh
pastes.sh
Juggling Lab is an application for creating and animating juggling patterns. Its main goals are to help people learn juggling patterns, and to assist in inventing new ones.
a modern and intuitive terminal-based text editor
ed cheatsheet
ed is a line editor for the Unix operating system. It was one of the first
end-user programs hosted on the system and has been standard in Unix-based
systems ever since. ed was originally written in PDP-11/20 assembler by Ken
Thompson in 1971.
Navigating
- Line number: go to that line and print it.
- pn - Print current line and line number.
- 3kxe - mark line 3 as "xe".
- 'xep - print the line marked as xe.
Editing
- a - start editing after the current line.
- i - start editing before the current line.
- c - replace the current line.
- end the editing with only a period on a line (.).
- 1d - delete line 1.
- 1,2j - join line one and two.
Printing
- 1,$p - print entire buffer.
- ,p - also prints the entire buffer.
- 2,3p - print lines 2 and 3.
- .,4p - print from the current line (.) to line 4.
- -1,+1p - print 1 line above and 1 line below the current line.
Buffer operations
- 2t4 - Copy line 2 to after line 4.
- 2t$ - Copy line 2 to the end of the file.
- 3m6 - Move line 3 to after line 6.
- 2,4m$ - Move lines 2 to 4 to the end of the file.
Searching / replace
- /like - Move to the next line after the current one matching regular
expression /like. - ?Like - Search backwards.
- 1s/re/jo - Substitute only the first occurence of re with jo on line 1.
- 1s/re/jo/g - Substitute all occurences of re with jo on line 1.
- 1,$s/re/jo/g - Substitute all occurences of re with jo in the whole buffer.
Regular expresions
- g/re/p - print all the lines matching regular expression /re/.
- v/re/p - print all the lines NOT matching regular expression /re/.
- g/re/m$ - move all the lines matching regular expression /re/ to the end of
the file.
Reading and writing
- w file.txt - Save the current buffer as filename file.txt.
- w - Save the current buffer if the file is already saved.
- w1,4 - Save lines 1 to 4 to the current buffer.
- W - append to a file (not replace).
- r /etc/hosts - Insert the contents of /etc/hosts after the current line.
- r !ps -e - Insert the output of the command "ps -e" after the current line.
- e file.txt - Open the file file.txt and replace the current buffer.
Experimental implementation of a kvmclock-derived clocksource for Linux guests under OpenBSD's hypervisor