Basic C L I

22
Basic CLI Session 2 Session 2 By: Bahaa S. Salama (bahaa2008)

Transcript of Basic C L I

Page 1: Basic  C L I

Basic CLI Session 2Session 2

By: Bahaa S. Salama (bahaa2008)

Page 2: Basic  C L I

Why brother ?

Powerful

Easier to get help (Not descriptive)

Performance (Take less resources)

“ A child you use a computer by looking at the pictures. When he grow up, he learn to read and write.”

William Shotts, Jr

Page 3: Basic  C L I

Shell and Terminal

Shell is a command-line interpretersh,ash,bash,csh,ksh,zsh,busybox

Terminal or terminal emulators is a emulator to real shell (console)xterm, konsole, gnome-terminal

Page 4: Basic  C L I

Managing Files

List Files ls

Create file touch

Copy file cp

Move file mv

Delete file rm

Display file cat - less - more

Page 5: Basic  C L I

ls

-l long listing

-d directories

-h human readable sizes

-a all files

-w wide listing

Page 6: Basic  C L I

Managing Directories

List directories ls

Make directory mkdir

Change to directory cd

Copy directory cp

Move directory mv

Remove directory rmdir

Current directory pwd

Page 7: Basic  C L I

Interesting commands

Date and Time date

Calender cal

Manuals man

Information info

Page 8: Basic  C L I

Interesting CLI Tricks

Playing music and video

Chatting and Web

Displaying Images

Tweeting from CLI

And the list is still going ^_^

Page 9: Basic  C L I

How to get help

Man pages

Info pages

Google

Forums

IRC

Community

Do u want more ?

Page 10: Basic  C L I

Break

Page 11: Basic  C L I

Working Multiple Files

Using the wild cards

* for multiple characters

? for single character

Using regex

To be covered later

Page 12: Basic  C L I

Searching for Files

Using find

-name

-size

-type

-user

Page 13: Basic  C L I

Redirection and Piping

put to file >

get from file <

append to file >>

pipe |

Note: more about redirecting of output in the bash sessions

Page 14: Basic  C L I

Symbolic Links

What is links ?

Types of links

Soft links

Hard links

How to make a link ?

Page 15: Basic  C L I

Linux Directories

/bin

/sbin

/home

/etc

/media

/tmp

/boot

/dev

/root

/usr/bin

/usr/sbin

/var/log

/var/cache

/lib

/opt

Page 16: Basic  C L I

Know more about your pc

CPU cat /proc/cpuinf

Memory cat /proc/meminfo

PCI Cards lspci

USB Devices lsusb

Network interfaces ifconfig

Free memory free -m

Monitor Working processes top

Page 17: Basic  C L I

Break

Page 18: Basic  C L I

Permissions

Why Permissions ?

User,Group,Other

Read,Write,Execute

Permissions symbolically

r read u user

w write g group

x execute o other

Page 19: Basic  C L I

Permissions - cont.

Permissions numerically

7 rwx 3 -wx

6 rw- 2 -w-

5 r-x 1 --x

4 r-- 0 ---

Change user chown

Change group chgrp

Change permissions chmod

Page 20: Basic  C L I

References

Wikipedia

http://linuxzoo.net

http://grussell.org/ns/lectures.html

http://www.linuxawy.org/node/46

http://www.linuxawy.org/node/51

Page 21: Basic  C L I

Questions

Page 22: Basic  C L I

Thanks