• Like
Operating Systems 2
Upcoming SlideShare
Loading in...5
×
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,232
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
13
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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