 music |
 | | OSdata.com |
shell programming
summary
This chapter looks at UNIX (and Linux) shell programming.
shell programming
This chapter looks at UNIX (and Linux) shell programming.
You may wonder why a chapter on shell scripting is in a programming book. And you may not even read this line because your professor probably has cut this entire chapter out of the version used in your class.
There are actually several good reasons to include a chapter on shell scripting.
The chapter can serve as background material so that a student new to UNIX (or Linux or Mac OS X) will be able to make effective use of the shell for work on programming assignements.
There are actual classes in shell scipting, especially at junior colleges and community colleges.
This chapter goes beyond the typical material in a shell scripting class and presents material related to either downloading and compiling existing software (including ports to new hardware and/or operating systems) or for preparing your own software for release via the internet.
other
22. A good system cant have a weak command language. Alan Perlis, Epigrams on Programming, ACMs SIGPLAN Notices Volume 17, No. 9, September 1982, pages 7-13
chapter contents
- cool shell tricks
- UNIX/Linux history
- choice of shells
- connecting to a shell (Telnet and SSH; terminal emulator)
- shell basics (book conventions; root or superuser; starting your shell; login and password; prompt; command example)
- login/logout (login; select system; account name; password; terminal type; logout; exit)
- passwd (setting password; local password; periodic changes; 100 most common passwords; secure passwords; superuser)
- command structure (single command; who; failed command; date; options, switches, or flags; universal time; arguments; options and arguments; operators and special characters)
- quick tour of shell commands
- man (using man for help; man sections)
- cat (creating files; example files for this book; viewing files; combining files)
- command separator (semicolon)
- less, more, pg last updated: 27 Aug 2012
- file system basics (graphics examples; directory tree; important directories; home directory; parent and child directories; absolute paths; relative paths; dots, tildes, and slashes)
- pwd
- command history
- built-in commands
- ls
- cd
- cp
- mv
- rm (recursive)
- sysadmin and root/superuser
- sudo and root
- su
- who
- major directories
- shred
- df
- du
- ps
- w
- uptime
- top
- free
- vmstat
- defaults (screencapture; Mac Flashback Trojan)
- init (init; Linux run levels)
- ifconfig (view configuration; static IP address)
- arp
- netstat (view connections; main info; routing address)
- route (view connections; routing commands)
- ping (test packets; measuring)
- nslookup
- traceroute (entire route; etiquette)
- sysstat
- at (example; removing a job; timing)
- tar
- touch (multiple files; specific time)
- find
- sed (fixing end of line; adding line numbers)
- awk (remove duplicate lines)
- screencapture (from graphic user interface; changing defaults; command line screenshots)
- installing software from source
- test bed
- grep
- ssh
- vim
- diff
- sort
- export
- xargs
- gzip
- bzip2
- unzip
- shutdown
- ftp
- crontab
- service
- kill
- mount
- chmod
- chown
- mkdir
- uname
- whereis
- whatis
- locate
- tail
- mysql
- yum
- rpm
- date
- wget
- file permissions
- nano
- troff
- Forth-like routines
free music player coding example
Coding example: I am making heavily documented and explained open source code for a method to play music for free almost any song, no subscription fees, no download costs, no advertisements, all completely legal. This is done by building a front-end to YouTube (which checks the copyright permissions for you).
View music player in action: www.musicinpublic.com/.
Create your own copy from the original source code/ (presented for learning programming).
Work on this project is very slow because I am homeless. I am available for work if someone can provide an indoor place to work in Costa Mesa, California, electricity, internet connections, a flat raised working surface (such as a table or desk), a sitting device (such as a chair or stool), and a fully functional reasonably modern used computer. Im already homeless, so you dont need to pay me (and I understand how much business people hate the minimum wage law). Just give me a chance to work.
Because I no longer have the computer and software to make PDFs, the book is available as an HTML file, which you can convert into a PDF.
Names and logos of various OSs are trademarks of their respective owners.