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)
- shred
- mkdir
- alias
- pipes
- scripts
- sysadmin and root/superuser
- sudo and root
- su
- who
- advanced file systems
- major directories
- Network File System (NFS)
- tail
- wc
- chmod
- chown
- shell levels and subshells
- substitutions
- command substitutions
- arithmetic substitutions
- flow control
- management tools
- df
- du
- processes
- ps
- kill
- nice
- w
- date
- uname
- uptime
- top
- lsof
- free
- vmstat
- polkit
- defaults (screencapture; Mac Flashback Trojan)
- init (init; Linux run levels)
- sendmail
- 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)
- ftp and sftp
- cURL
- sysstat
- at (example; removing a job; timing)
- back ups
- tar
- touch (multiple files; specific time)
- find
- text processing
- basename
- sed (fixing end of line; adding line numbers)
- awk (remove duplicate lines)
- screencapture (from graphic user interface; changing defaults; command line screenshots)
- signals
- LAMP
- mysql
- PHP
- Perl
- Tcl
- Java
- installing software from source
- test bed
- grep
- ssh
- vim
- diff
- sort
- export
- xargs
- gzip
- bzip2
- unzip
- shutdown
- crontab
- service
- mount
- whereis
- whatis
- locate
- yum
- rpm
- wget
- file permissions
- nano
- troff
- command summaries
- Forth-like routines
comments, suggestions, corrections, criticisms
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).
This section is under the category of owning cirticism.
In response to a posting about my article collecting social media, Moderator +Andrew Smith (Technology addict, Web Developer, API guru, futsal and football wannabe, and all round nice guy!, Swordfox Design, arrowtown, new zealand) of the Google+ community Web Developers, Web Designers, Web Coding claims Quite frankly this is self promotion, and your site is not of great quality. I can see how +Joost SchuurÊ would think this of not high enough a standard.
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.