Download presentation
Presentation is loading. Please wait.
1
Using Linux Kaya Oğuz http://homes.ieu.edu.tr/~koguz kaya.oguz@ieu.edu.tr Room: 310
2
GUI vs CLI If you have done your homework, you have used Linux with a GUI (GNOME, KDE, etc) CLI = Command Line Interface Shell: Bash, Sh, Csh, Zsh, etc... Interface between the user and the OS
3
A Typical Linux System
4
Users in Linux Superuser (root) Normal user (kaya) A normal user account is used for daily usage of the system. Superuser account is reserved for system administration Every user belongs to one or more groups Linux is very strict about permissions Every file belongs to a user
5
Becoming 'root' From time to time you may need to become the superuser; for installing applications, setting system settings etc. The commands: su and sudo When you are root, BE VERY CAREFUL! The system considers you know what you are doing and does not ask you 'if you are sure' – it just executes the command!
6
sudo!
7
Files -rw-r--r-- 1 kaya kaya 17K 2009-06-24 13:50 kayaoguz.pdf -rw-r--r-- 1 kaya kaya 374 2009-06-24 13:55 kayaoguz.tex drwxr-xr-x 4 kaya kaya 1016 2009-07-06 10:31 Masaüstü $ chmod 655 dosyaAdi $ chmod 777 dosyaAdi2 $ chmod -R 546 dizinVeIcindekiler
8
I Know CHMOD!
9
Hello Bash!
10
Shell is... An interpreter. It can execute commands. A programming language. It has control structures, loops, variables and NO pointers :) You may try: for i in $(ls); do echo item: $i done
11
Basic OS Commands Now, let's connect to Zeytin and see them in action! root@zeytin:~# uptime 10:56:41 up 56 days, 36 min, 1 user, load average: 0.23, 0.05, 0.02
12
Learning More Manuals – the man command gives you more information about a command. Try: man ls man cp Reading the manuals, you can learn about the parameters and other features of the commands.
13
Redirecting You can redirect the output of a command to a file. For example: ls -l > filesList.txt The '>' directs the output to the file. Here are more keywords for you: stdout, stderr, stdin std=standard
14
Pipe Pipes let you use the output of a program as the input of another one! Here are a few samples: ls -l | less tcpdump | grep google ps aux | grep java | less Pipes and redirecting will be needed when using tcpdump and analyzing its outputs.
15
Lab Sessions During lab sessions you will be asked to connect to a network and login to 'Truva' just like I have connected to 'Zeytin' ifconfig To set the connection, you need to use the ifconfig command which requires root administration rights. Typing only ifconfig gives you information about the current interfaces of the system. You will probably see: lo (loopback), eth0 and wlan0 (or eth1, or something similar)
16
ifconfig Setting an interface: # ifconfig eth0 192.168.0.13 netmask 255.255.255.0 To enable / disable an interface # ifconfig eth0 up # ifconfig eth0 down
17
route The route command shows or manipulates the IP routing table. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with ifconfig (from 'man route') You'll need it when using Truva to access internet in the lab route add default gw 192.168.1.50
18
S S H SSH allows you to connect to a remote host. You will use SSH to connect to Truva in the labs. Once connected, you can use the Linux commands on the remote machine. Here is the command: ssh 192.168.1.50 -l username
19
Config Files Remember the folder /etc ? /etc/hosts holds a list of machines. You can add machines. Here's the hosts file on my machine: 192.168.1.50 truva 192.168.1.57 hitit I don't need to write 192.168.1.50 anymore. I can simply write truva.
20
Config Files /etc/resolv.conf is the file which holds the DNS servers. DNS = Domain Name Server DNS converts domain name to ip. Here is my resolv.conf file: nameserver 10.0.2.5
21
More Linux Commands Text editors: vi, vim, pico, nano Changing your password: passwd Print Working Directory: pwd Who are you?: whoami Who is logged in now?: who How long has it been?: uptime System information: uname Listing the tasks, processes: top, ps Stop the processes!: kill, killall
22
More! How much space?: du, df, free File contents: less Print on screen: echo Path of a command: which Rename command: alias Compressing: tar Links: ln Compiling: gcc, g++, javac
23
Homework Spend some time on the command line; try using command line applications instead of GUI Create a working directory for IS302, where all your work will be saved Experiment with your network settings from the command line Try the commands that look interesting to you in this presentation, skim over their manuals. And report back what you have done...
24
Thanks! Kaya Oğuz Room: 310 and you are always welcome! kaya.oguz@ieu.edu.tr http://homes.ieu.edu.tr/~koguz
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.