Top Banner
This slides for every one who want to learn Linux This slides for every one who want to learn Linux in our in our Arab World Arab World and the and the whole World whole World .. .. Thanks Thanks for every one who for every one who sharing sharing us his experience us his experience and and help us help us to learn linux to learn linux .. .. :) :)
42

Linux Basic Commands

May 25, 2015

Download

Education

Hanan Nmr

Learn Linux Basic commands
By: Students from Jordan University
Nadine Shorbaji
Hanan Nimer
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Linux Basic Commands

This slides for every one who want to learn LinuxThis slides for every one who want to learn Linuxin our in our Arab WorldArab World and the and the whole Worldwhole World.. ..

ThanksThanks for every one who for every one who sharingsharing us his experience us his experience and and help ushelp us to learn linux to learn linux ....

:):)

Page 2: Linux Basic Commands
Page 3: Linux Basic Commands
Page 4: Linux Basic Commands
Page 5: Linux Basic Commands

man hierman hier

1. Open terminal:

2. Type:

Page 6: Linux Basic Commands

How Linux is Organized??!How Linux is Organized??!

Page 7: Linux Basic Commands
Page 8: Linux Basic Commands

Cli : Command Line interface..Cli : Command Line interface..

Page 9: Linux Basic Commands

1. Open terminal:

2. Type:

  cat  /etc/shellscat  /etc/shells

Page 10: Linux Basic Commands

  *What is MyShell:*What is MyShell:      $ echo  $SHELL $ echo  $SHELL 

* Change Shell:* Change Shell:  $ chsh  $ chsh  

Page 11: Linux Basic Commands

$ command   ­options   parameter $ command   ­options   parameter 

Page 12: Linux Basic Commands

whoamiwhoamihostnamehostname

user @ computer­name:~ $ user @ computer­name:~ $ 

userusercomputer­namecomputer­name

Page 13: Linux Basic Commands

pwdpwd

    user @ computer­name:~ $ user @ computer­name:~ $ 

User Home FolderUser Home Folder

/home/user1/home/user1

Page 14: Linux Basic Commands

Magic command

Sudo : Super User Do

sudo susudo su

sudo -isudo -i

Page 15: Linux Basic Commands
Page 16: Linux Basic Commands

Switch user : su

su user-namesu user-name

passwdpasswd

Change user passwordChange user password

Page 17: Linux Basic Commands

Users logs

-Who logged in:$ Who or w

-Last Sessions:$ last

Page 18: Linux Basic Commands

Change Directory: cd

cd . cd .

cd ~cd ~

cd /cd /

cd Desktop/cd Desktop/

cd cd

cd .. cd ..

Page 19: Linux Basic Commands

List Files: ls

ls ls

ls -als -a

man ls man ls Get Get manualmanual

ls directoryls directory

ls -l file||dirls -l file||dir

Page 20: Linux Basic Commands

Create Directory : mkdir

mkdir UBUNTU mkdir UBUNTU

Remove Directory : rmdir

rmdir UBUNTU rmdir UBUNTU

Page 21: Linux Basic Commands

Create File

touch <file1> <file2> <....> touch <file1> <file2> <....>

cat > file-name cat > file-name

cat >> file-name cat >> file-name

newnew

updateupdate

Page 22: Linux Basic Commands

Remove File

rm path/file-name rm path/file-name

Read File

cat path/file-name cat path/file-name

You can also do stuff like rm b* with theasterisk. For removing a collections of filesstarted with litter b.

Page 23: Linux Basic Commands

Reading Files

head -# file-name head -# file-name

tail -# file-name tail -# file-name

less path/file-name less path/file-name

more path/file-name more path/file-name

gedit path/file-name gedit path/file-name

Page 24: Linux Basic Commands

Text Search : grep

g/re/p (global / regular expression / print).g/re/p (global / regular expression / print).

grep -i pattern file-name grep -i pattern file-name

grep -v pattern file-name grep -v pattern file-name

grep -w pattern file-name grep -w pattern file-name

ignore case

as 1 word

all except patt

*.txt

/directory

Page 25: Linux Basic Commands

● whereis ls : Display information about the location of a command

• which ls : Display which version of acommand will execute .

• pwd: print working directory

Continued....

Page 26: Linux Basic Commands

Try...

• Try man –f ls whatis ls

• Try man –k ls apropos ls

Page 27: Linux Basic Commands

Reboot

sudo rebootsudo reboot

Page 28: Linux Basic Commands

ShutDown

sudo shutdown -r NOWsudo shutdown -r NOW

sudo shutdown timesudo shutdown time

sudo shutdown -c timesudo shutdown -c time

Page 29: Linux Basic Commands

Copy Paste : cp

cp -r dir/* new-directorycp -r dir/* new-directory

cp <file1> <file2> <dest>cp <file1> <file2> <dest>

Page 30: Linux Basic Commands

Move + Rename : mv

mv path/file new-path/new-namemv path/file new-path/new-name

mv -r dir/* new-directorymv -r dir/* new-directory

Page 31: Linux Basic Commands

User @ computer-name

User @ computer-name

Terminal

Page 32: Linux Basic Commands

Terminal

User @ computer-name

User @ computer-name

Page 33: Linux Basic Commands

User@computer-name:~

Terminal

Page 34: Linux Basic Commands

Terminal

User@computer-name

User@computer-name

Page 35: Linux Basic Commands

Search Tool

find <dest> -name file-namefind <dest> -name file-name

Page 36: Linux Basic Commands

Linux files DB

Lets update linux files data base :

sudo updatedbsudo updatedb

locate file-namelocate file-name

Page 37: Linux Basic Commands

Package Management

System >> Administration >> Synaptic Package Manager.

sudo apt-get install <pckg>sudo apt-get install <pckg>

Page 38: Linux Basic Commands

Process management

ps auxps aux

System >> Administration >> System Monitor.

kill p-idkill p-id

pkill p-namepkill p-name

killall p-idkillall p-id

kill -9 p-idkill -9 p-id

xkillxkill

Process termination:

toptop

Page 39: Linux Basic Commands

Launcher

Lets create my buttons...

gksudo firefoxgksudo firefox

Page 40: Linux Basic Commands

Compression..

* Create .tar.gz compressed file:1. Create .tar file: $ tar -cvf new_name.tar folder_or_file2.Create .gz file: $ gzip new_name.tar

* Extract from .tar.gz compressed file:1. Create .tar file: $ gunzip new_name.tar.gz2.Create .gz file: $ tar -xvf new_name.tar

Page 41: Linux Basic Commands

Linux Variables

$ echo $PATH$ echo $USER$ echo $SHELL

Page 42: Linux Basic Commands