CI1131 ICT Lecture Introduction to Operating Systems (2): the GNU/Linux BASH shell
Working in BASH <ul><li>Command line – faster than GUI </li></ul><ul><ul><ul><li>autocompletion; shortcuts with 'alias' </...
BASH basics <ul><li>Some basic BASH navigational commands. </li></ul><ul><ul><li>navigate to /usr/share/wallpapers </li></...
BASH basics <ul><li>Learning some basic BASH commands (2) </li></ul><ul><ul><li>list all files in this directory that begi...
What's in the root directory?
BASH basics <ul><li>Learning some basic BASH commands (3) </li></ul><ul><ul><li>create a new directory called ‘Test1’ on y...
BASH basics <ul><li>Learning some basic BASH commands (4) </li></ul><ul><ul><li>display the contents of your file </li></u...
Example: apropos
Example: show processes [1]
Example: show processes [2]
Example: new file with echo
Example: directory listing
Example: permissions
BASH basics <ul><li>What BASH built-ins are enabled? </li></ul><ul><li>enable -a </li></ul><ul><li>What are your environme...
Bash: find out more with  man
Some BASH references <ul><li>The Linux Terminal - a Beginners’ Bash </li></ul><ul><li>http://linux.org.mt/article/terminal...
Upcoming SlideShare
Loading in...5
×

Operating Systems 2

1,268

Published on

Tutorial slides for Kingston University ITtoolbox students

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,268
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Operating Systems 2

  1. 1. CI1131 ICT Lecture Introduction to Operating Systems (2): the GNU/Linux BASH shell
  2. 2. Working in BASH <ul><li>Command line – faster than GUI </li></ul><ul><ul><ul><li>autocompletion; shortcuts with 'alias' </li></ul></ul></ul><ul><li>Some basic navigational commands: </li></ul><ul><ul><ul><li>pwd, ls [-lag], cd, pushd, popd, dirs, history, whoami, ... </li></ul></ul></ul><ul><li>Some basic file management commands: </li></ul><ul><ul><ul><li>cp, mv, rm, mkdir, rmdir, chown, chmod, ... </li></ul></ul></ul><ul><li>Creating and reading files with basic shell commands </li></ul><ul><ul><ul><li>echo, cat, more, ... </li></ul></ul></ul><ul><li>Editing files with VIM, Emacs, Kate, ... </li></ul>
  3. 3. BASH basics <ul><li>Some basic BASH navigational commands. </li></ul><ul><ul><li>navigate to /usr/share/wallpapers </li></ul></ul><ul><li>cd /usr/share/wallpapers </li></ul><ul><ul><li>and display your current directory </li></ul></ul><ul><li>pwd </li></ul><ul><ul><li>list all files in this directory </li></ul></ul><ul><li>ls -a </li></ul><ul><ul><li>display a ‘long’ listing of all files in this directory </li></ul></ul><ul><li>ls -la </li></ul>
  4. 4. BASH basics <ul><li>Learning some basic BASH commands (2) </li></ul><ul><ul><li>list all files in this directory that begin with letters ‘a’, ‘b’, ‘c’, or ‘d’ </li></ul></ul><ul><li>ls [a-d]* </li></ul><ul><ul><li>list all files in this directory that begin with letters ‘a’, ‘e’, ‘s’, or ‘t’ </li></ul></ul><ul><li>ls [aest]* </li></ul><ul><ul><li>give a ‘long’ listing of all files in your home directory (without navigating there!) </li></ul></ul><ul><li>ls -la ~ </li></ul>
  5. 5. What's in the root directory?
  6. 6. BASH basics <ul><li>Learning some basic BASH commands (3) </li></ul><ul><ul><li>create a new directory called ‘Test1’ on your desktop </li></ul></ul><ul><li>mkdir Test1 </li></ul><ul><ul><li>use echo to create a simple text file in ‘Test1’ </li></ul></ul><ul><li>echo a string of words > Test1/myFile.txt </li></ul><ul><ul><li>use cat >> to add further lines to your text file (use ctrl-D to finish) </li></ul></ul><ul><li>cd Test1 </li></ul><ul><li>cat >> myFile.txt </li></ul><ul><li>more lines of text </li></ul><ul><li>.... </li></ul><ul><li>(ctrl-D) </li></ul>
  7. 7. BASH basics <ul><li>Learning some basic BASH commands (4) </li></ul><ul><ul><li>display the contents of your file </li></ul></ul><ul><li>cat myFile.txt </li></ul><ul><ul><li>create a second new directory on your desktop called ‘Test2’ and move your text file from Test1 to Test2 </li></ul></ul><ul><li>cd .. </li></ul><ul><li>mkdir Test2 </li></ul><ul><li>mv Test1/myFile.txt Test2/ </li></ul><ul><ul><li>delete the directory Test1 </li></ul></ul><ul><li>rmdir Test1 </li></ul>
  8. 8. Example: apropos
  9. 9. Example: show processes [1]
  10. 10. Example: show processes [2]
  11. 11. Example: new file with echo
  12. 12. Example: directory listing
  13. 13. Example: permissions
  14. 14. BASH basics <ul><li>What BASH built-ins are enabled? </li></ul><ul><li>enable -a </li></ul><ul><li>What are your environment variables? </li></ul><ul><li>set </li></ul><ul><li>What aliases are already pre-defined for you? </li></ul><ul><li>alias </li></ul><ul><li>13 th March 1643 fell on which week day? </li></ul><ul><li>cal 3 1643 </li></ul>
  15. 15. Bash: find out more with man
  16. 16. Some BASH references <ul><li>The Linux Terminal - a Beginners’ Bash </li></ul><ul><li>http://linux.org.mt/article/terminal </li></ul><ul><li>Bash Guide for Beginners </li></ul><ul><li>http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ </li></ul><ul><li>Linux Shell Scripting Tutorial </li></ul><ul><li>http://www.freeos.com/guides/lsst/ </li></ul><ul><li>Bash Reference Manual </li></ul><ul><li>http://www.gnu.org/software/bash/manual/bashref.html </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×