Presentation is loading. Please wait.

Presentation is loading. Please wait.

V2012.13. 2 Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.

Similar presentations


Presentation on theme: "V2012.13. 2 Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM."— Presentation transcript:

1 V2012.13

2 2 Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 th @ 12:20PM in Main Gym –JVS Open House: Feb 10th 1:30-3:30PM, 15181 OH RT58. »Tours, teachers, and some students will be available –Guest Speaker: Feb 12th –Hyland Field Trip: Feb 21 st (no details yet) Linux Intro (continued)

3 3 Avon High School Tech Crew New Business Intro to Linux –Basic Commands –Install Additional Software –Practice Exercises

4 4 Avon High School Tech Crew Basic Commands Commands take the following form: Switches: single letters, preceded by a hyphen, that adjust what the command does Parameters: things that the command needs to know in order to work Target: the thing (such as a file) that the command will be applied

5 5 Avon High School Tech Crew Basic Commands Let’s look at an example: $ ls -l /home/seighman Command Switch Target This command tells the command line to list, in long format, the contents of the directory “/home/seighman”. The command is “ls”; the switch “-l” tells Linux that you want the list in long format; and the target of this command is the directory “/home/seighman”. In this example, there are no parameters, so that part of the command is just skipped

6 6 Avon High School Tech Crew Basic Commands - man So, how do I know what switch to use? –manpages are your friend $ man ls LS(1) User Commands LS(1) NAME ls - list directory contents SYNOPSIS ls [OPTION]... [FILE]... DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified

7 7 Avon High School Tech Crew Basic Commands pwd ls cd mkdir rmdir

8 8 Avon High School Tech Crew Basic Commands 2 file touch cp rm mv rename

9 9 Avon High School Tech Crew Basic Commands 2 - file ‘file’ $ file linuxcommands.pdf linuxcommands.pdf: PDF document, version 1.5 The file utility determines the file type. Linux does not use extensions to determine the file type.

10 10 Avon High School Tech Crew Basic Commands 2 - file ‘touch’ $ touch test.txt One easy way to create a file is with touch

11 11 Avon High School Tech Crew Basic Commands 2 - cp ‘cp’ $ cp test.txt /home/seighman/Documents To copy a file, use cp with a source and a target argument If the target is a directory, then the source files are copied to that target directory.

12 12 Avon High School Tech Crew Basic Commands 2 - cp Some ‘cp’ examples: $ cp -r The -r option forces recursive copying of all files in all subdirectories $ cp -i Prevents cp from overwriting existing files, use -i (interactive) $ cp -p Preserve permissions and time stamps from source files

13 13 Avon High School Tech Crew Basic Commands 2 - rm ‘rm’ $ rm test.txt Use rm to remove a file There’s no notion of a ‘waste basket’ When you use rm to remove a file, the file is gone Be careful when removing files!

14 14 Avon High School Tech Crew Basic Commands 2 - rm Some ‘rm’ examples: $ rm –i text.txt To prevent yourself from accidentally removing a file, you can use -i. $ rm –rf test When you are logged on as root, be very careful with rm -rf (the f means force and the r means recursive)

15 15 Avon High School Tech Crew Basic Commands 2 - mv ‘mv’ $ mv test.txt text1.txt Use mv to rename a file or to move the file to another directory

16 16 Avon High School Tech Crew Basic Commands 2 - mv Some ‘mv’ examples: $ mv To prevent yourself from accidentally removing a file, you can use -i. $ mv When you are logged on as root, be very careful with rm -rf (the f means force and the r means recursive)

17 17 Avon High School Tech Crew Basic Commands 2 - rename ‘rename’ The rename command can also be used but it has a more complex syntax to enable renaming of many files at once

18 18 Avon High School Tech Crew Basic Commands 2 - rename Some ‘rename’ examples: $ rename 's/txt/doc/' *.txt Switches all occurrences of txt to doc for all file names ending in.txt.

19 19 Avon High School Tech Crew Super User The “sudo” command introduces the “superuser” or “root user” The term “root” is the name for the main administrator in a “Unix-like” system, such as Linux There are many commands that only the root user can run Depending on the version of Linux you are using, you will either have to log on as the root user or prefix your command with “sudo”. The default Debian distribution of Linux, for instance, has no root password set. So you will have to use the “sudo” command

20 20 Avon High School Tech Crew Super User By using “sudo”, you’re saying, “Do the following command as the root user” When you do this, you will be asked for your password and, if you have the system permissions of a root user (commonly called “being in the admin group”), then the command will be run If you don’t have root permissions, you will get an error message WARNING: be very careful executing commands as root (sudo), you can easily render your system unuseable!

21 21 Avon High School Tech Crew Installing Software Installing software on Linux is a broad subject because each version of Linux has its own way of doing things Most are variations on apt-get (Advanced Packaging Tool), used by Debian, Ubuntu, and related distributions) yum (Yellowdog Update Manager), used by Fedora and related distributions The basic syntax is: $ sudo apt-get install $ sudo yum install

22 22 Avon High School Tech Crew Using apt-get to Manage Software To install a software package: $ sudo apt-get install To update the local package database: $ sudo apt-get update To install all available newer versions of packages: $ sudo apt-get upgrade To remove a package: $ sudo apt-get remove

23 23 Avon High School Tech Crew Ubuntu Setup Install Ubuntu Tweak –Open a ‘terminal’ –Enter the following commands: $ sudo add-apt-repository ppa:tualatrix/ppa $ sudo apt-get update $ sudo apt-get install ubuntu-tweak –You may need to logout and login again

24 24 Avon High School Tech Crew Practice Exercises Work through the exercises here: http://ahstechcrew.org/docs/BasicCommandsPractice2.pdf

25 25 Avon High School Tech Crew Basic Commands 3 tail head Cat more less


Download ppt "V2012.13. 2 Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM."

Similar presentations


Ads by Google