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 ....
:):)
*What is MyShell:*What is MyShell: $ echo $SHELL $ echo $SHELL
* Change Shell:* Change Shell: $ chsh $ chsh
whoamiwhoamihostnamehostname
user @ computername:~ $ user @ computername:~ $
userusercomputernamecomputername
pwdpwd
user @ computername:~ $ user @ computername:~ $
User Home FolderUser Home Folder
/home/user1/home/user1
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
Create Directory : mkdir
mkdir UBUNTU mkdir UBUNTU
Remove Directory : rmdir
rmdir UBUNTU rmdir UBUNTU
Create File
touch <file1> <file2> <....> touch <file1> <file2> <....>
cat > file-name cat > file-name
cat >> file-name cat >> file-name
newnew
updateupdate
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.
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
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
● whereis ls : Display information about the location of a command
• which ls : Display which version of acommand will execute .
• pwd: print working directory
Continued....
ShutDown
sudo shutdown -r NOWsudo shutdown -r NOW
sudo shutdown timesudo shutdown time
sudo shutdown -c timesudo shutdown -c time
Copy Paste : cp
cp -r dir/* new-directorycp -r dir/* new-directory
cp <file1> <file2> <dest>cp <file1> <file2> <dest>
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
Linux files DB
Lets update linux files data base :
sudo updatedbsudo updatedb
locate file-namelocate file-name
Package Management
System >> Administration >> Synaptic Package Manager.
sudo apt-get install <pckg>sudo apt-get install <pckg>
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
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