1 / 21

Just Enough Unix

Just Enough Unix. Just enough Unix. . Unix Operating System. Generally operates from a command-line. After logging on, you are met with command a prompt: miller: weise: You are located in what is called your home directory. Unix commands. All unix commands are actually programs.

barney
Download Presentation

Just Enough Unix

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Just Enough Unix Just enough Unix.

  2. Unix Operating System • Generally operates from a command-line. • After logging on, you are met with command a prompt: • miller: • weise: • You are located in what is called your home directory.

  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 -l: displays a long listing of files

  6. Viewing files • Use the ls command. miller: ls afile aprogram.cc more anotherfile atextfile.txt muchmore

  7. Viewing all files • Use the ls -a command. • The name of the current directory is . • The name of the parent directory is .. miller: ls -a . afile anotherfile atextfile.txt more .. .ahiddenfile aprogram.cc .hiddenfile2 muchmore

  8. Types of UNIX files • File [-] — a standard file. • Directory [d] — a directory or (folder).

  9. Types of file access • Read [r] — person can read the file. • Write [w] — person can write or delete the file. • Execute [x] — person can execute the file (applies only to directories and programs).

  10. Access privileges • All UNIX files have privileges associated with them. • These privileges determine who can access the file. • These privileges determine how they can accessed.

  11. Types of users • User/owner [O] — the person who created the file. • Group [G] — Unix allows for the creation of groups. • Others/world [W] — everyone else in the world that has access to that computer.

  12. Viewing File Details • Use the ls -l command. miller: ls -l O G W Owner Group Size Date/time -rw-r----- 1 sorenson cs201ta 63 Sep 16 22:02 afile -rw------- 1 sorenson cs201ta 22 Sep 16 22:03 anotherfile -rw-r--r-- 1 sorenson cs201ta 183 Sep 16 22:03 aprogram.cc -rw-r----- 1 sorenson cs201ta 219 Sep 16 22:04 atextfile.txt drwxr-xr-x 2 sorenson cs201ta 512 Sep 16 22:02 more drwxr-x--- 2 sorenson cs201ta 512 Sep 16 22:02 muchmore

  13. Viewing All File Details • Use the ls -al command. miller: ls -al O G W Owner Group Size Date/time drwx------ 4 sorenson cs201ta 512 Sep 16 22:06 . drwxrwxr-x 28 root cs201ta 512 Sep 16 22:01 .. -rw-r----- 1 sorenson cs201ta 63 Sep 16 22:02 afile -rw-r----- 1 sorenson cs201ta 107 Sep 16 22:06 .ahiddenfile -rw------- 1 sorenson cs201ta 22 Sep 16 22:03 anotherfile -rw-r--r-- 1 sorenson cs201ta 183 Sep 16 22:03 aprogram.cc -rw-r----- 1 sorenson cs201ta 219 Sep 16 22:04 atextfile.txt -rw-r--r-- 1 sorenson cs201ta 152 Sep 16 22:06 .hiddenfile2 drwxr-xr-x 2 sorenson cs201ta 512 Sep 16 22:02 more drwxr-x--- 2 sorenson cs201ta 512 Sep 16 22:02 muchmore

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

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

  16. cp copy Copies the contents of one file to another. cp [file to copy] [new file name]

  17. 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.

  18. 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.

  19. mkdir make directory This creates a directory. mkdir [new directory name]

  20. 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.

  21. more view file This shows you the contents of a text file. If the file is an executable (program) file it will be unreadable. miller: more anotherfile This is just a file.

More Related