Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to GNU/Linux See, Stallman? I said GNU. Are you happy now?

Similar presentations


Presentation on theme: "Intro to GNU/Linux See, Stallman? I said GNU. Are you happy now?"— Presentation transcript:

1 Intro to GNU/Linux See, Stallman? I said GNU. Are you happy now?

2 What is Linux? Free and Open Source Operating System Thousands of developers worldwide Kernel developed by Linus Torvaldes in 1991 – Look up his rants! Much of the remainder is GNU, developed by Richard Stallman & Co.

3 Who Uses Linux? Source: http://www.netmarketshare.com/

4 Source: https://secure1.securityspace.com/s_survey/data/201211/index.html

5 Other Uses Android is Linux-based 95% of supercomputers run Linux Mac OS is also Unix-based

6 Why Use Linux Many tools available Very easy to develop for Experience for working on servers High performance computing relies on Linux Free! – As in no monetary cost as well as FSF’s philosophy $You can feel like a hacker with green text on black terminals

7 Flavors Many different versions, called ‘flavors’ or ‘distros’ Some popular ones: – Ubuntu and derivatives (Xubuntu, Kubuntu) – Red Hat Enterprise Linux – Mint – Arch – Gentoo

8 Connect to a Linux Server Log in to ceclnx01 now – Windows Run putty Enter ceclnx01.cec.miamioh.edu Enter Miami password – Mac OS X Open terminal Run command ssh @ceclnx01.cec.miamioh.edu Enter Miami password when prompted – Linux Shut up, you’re already on Linux If you want, follow Mac OS X instructions to connect to lnx01

9 Basics Everything on Linux is a directory or file – Run the command “ls” (list) to see this – Navigate directories with “cd ” (change directory) – See where you are currently with “pwd” (print working directory) – Go up a directory with “cd..”

10 Root (admin) Root can change the actual file system Run a command as root by prefixing command with ‘sudo’ Only users with root permissions can run a command as root You do not have root permissions on lnx01 We will do some things with root next time on your own virtual machines

11 ls command Lists files and directories in current working directory Some files still hidden – Files/directories that start with ‘.’ are hidden – Use ‘–a’ (all) argument to show these Show additional details with ‘-l’ (long) argument – Example output: -rw-rw-r-- 1 rogerskw libuuid 1.1K Sep 26 09:05 Practical1.java Make ‘human readable’ with ‘–h’ argument Combine argument to get all features ‘-hal’

12 man command Brings up the manual Try man ls Shows all arguments for the command Can be difficult to understand – Install bropages on your own system for easier to read manuals

13 chmod command Change permissions for a file or directory See current permissions for file with ls –l – Ex: -rwxrw-r-- – User: Read/write/execute – Your Group: read/write – Others: read

14 Other Helpful Commands wget – downloads a file – Ex: wget ‘https://raw.github.com/rogerskw/py3cleverbot/mast er/cleverbot.py’ cat – print contents of a file – Ex: cat input.txt echo – prints the input – Ex: echo ‘hello world’ grep – search file for pattern (regular expression) – Ex: grep ‘hello’ input.txt

15 IO Redirection Use ‘>’ to redirect the output of a command to a file – Ex: ls –hal > filelist.txt – This overwrites contents of filelist.txt Use ‘>>’ to append output of a command to the end of a file – Ex: ls –hal > filelist.txt – This will put it at the end of filelist.txt

16 Piping Redirect output as the input to a new command with ‘|’ – Ex: ls –hal | grep ‘java’ – Combine with IO redirect: Ex: ls –hal | grep ‘java’ > javafiles.txt

17 vi Extremely powerful and customizable text editor Takes a lot of getting used to Several ‘modes’. The basic ones: – Command (ESC) – Edit (i) – Visual (v) To quit: – enter command mode – Type ‘:wq’

18 Java Development Write a basic Java program in vi (hello world suffices) Exit vi Compile java with command ‘javac’ – Ex: javac HelloWorld.java – Compile all java files in current directory with ‘javac *.java’ * is a wildcard Run with command ‘java’ – Ex: java HelloWorld


Download ppt "Intro to GNU/Linux See, Stallman? I said GNU. Are you happy now?"

Similar presentations


Ads by Google