Just Enough Unix - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Just Enough Unix

Description:

Directories not folders. Move about with typed commands ... Execute person can execute the file (applies only to directories and program). Types of users ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 23
Provided by: jimdab
Category:

less

Transcript and Presenter's Notes

Title: Just Enough Unix


1
Just Enough Unix
  • Just enough Unix to enable you to edit, mount and
    view your web-pages on a Unix web-server.

2
Unix Operating System
  • Generally operates from a command-line.
  • After logging on, met with command-prompt
  • miller.cs
  • In labs, you will be using X-windows on
    X-terminals.

3
Unix commands
  • All unix commands are actually programs.
  • You run a program by typing its name at the
    command prompt.
  • Generally, the output of a program goes to the
    screen and if the program requires any input, it
    gets it from the keyboard.
  • These are called
  • stdout stdin

4
File navigation and manipulation
  • Unix uses a hierarchical file structure.
  • Very similar to Windows and Macintosh.
  • Directories not folders.
  • Move about with typed commands rather than
    mouse-clicks.

5
ls
  • list
  • Displays the names of the files in the current
    directory.
  • Flags
  • -a shows all the files, including hidden ones
  • -F puts a / after directories, an after
    executables, and an _at_ after links
  • -l displays a long listing of files

6
pwd
  • print working directory
  • Displays the full path of the current directory
    you are in.

7
cd
  • change directory
  • Changes the directory to whatever you specify.
  • cd name of directory
  • Without any directory (just cd) you will be taken
    to your home directory.

8
cp
  • copy
  • Copies the contents of one file to another.
  • cp file to copy new file name

9
mv
  • move
  • Better name could be the rename command.
  • Changes the name of one file to another.
  • mv old file name new file name
  • Note that the new file name could be a
    directory, which will effectively move the file
    to the new directory keeping the original name.

10
rm
  • remove
  • Deletes the specified file or files.
  • This is destructive!
  • They are gone!
  • They cannot be retrieved!!!
  • rm file name
  • Note this does not generally work with
    directories.

11
mkdir
  • make directory
  • This creates a directory.
  • mkdir new directory name

12
rmdir
  • remove directory
  • This deletes a directory (as opposed to the rm
    command above).
  • The directory must be empty otherwise you will
    get an error.

13
Access privileges
  • All unix files have privileges associated with
    them.
  • These privileges determine who can access the
    file.
  • These privileges determine how people can access
    the file.

14
Viewing access privileges
  • Use the ls -l command.

drwx------ 2 jimd 8192 Jul 12 1226
nsmail/ -rw-r--r-- 1 jimd 945 Mar 15
1601 old.cshrc -rwxrwxrwx 1 jimd 168
Jan 13 1998 file.exe -rw-rw-rw- 1 nobody
382 Nov 18 1998 old.profile -rw------- 1 jimd
652 Jul 12 1216 old.xsession drwx------
2 jimd 8192 Jun 23 1321
thesis/ -rw-r--r-- 1 jimd 1186776 Jul 13
1507 win32tutorial.ps
15
Types of file access
  • Read person can look at the contents of the
    file.
  • Write person can change the file.
  • Execute person can execute the file (applies
    only to directories and program).

16
Types of users
  • User/owner -- the person who owns/created the
    file.
  • Group Unix allows for the creation of groups.
  • Others/world -- everyone else in the world that
    has access to that computer.

17
To change permissions
  • chmod changes the access mode of a file.
  • Two methods exist
  • symbolic
  • absolute

18
chmod - absolute
  • Absolute - you specify a numeric equivalent for a
    set of permissions.
  • You specify all permissions at once.

19
chmod - absolute
  • chmod xxx file
  • Where each x is some number from 0 - 7.
  • Each number specifies a level of privileges for a
    specific group.

20
chmod - absolute
  • e.g.,

chmod 644 index.html
User permission
World permission
Group permission
21
chmod - absolute
  • Permissions
  • Read 4
  • Write 2
  • Execute 1
  • Set permissions by adding the values of all the
    permissions you wish to set.

22
chmod - examples
  • To give yourself read write permission and no
    permission to anyone else
  • chmod 600 foobar.txt
  • To give yourself read write permission and
    everyone else read permission only
  • chmod 644 index.html
  • To give yourself full access to a directory, and
    everyone else read execute permission only
  • chmod 755 images
Write a Comment
User Comments (0)
About PowerShow.com