goshenite.files.wordpress.com … · web viewthen, enter pa$$word. example: c.open terminal and...
Post on 06-Feb-2018
237 Views
Preview:
TRANSCRIPT
Coding In Linux
Masuk ke root linux(openSuse)
Masuk ke root linux.
(Ni adalah root dir)dip5a@linux-lne0:~> whoami
dip5a
dip5a@linux-lne0:~> su
(Kembali kepada dir home ada simbol (~))Password:
linux-lne0:/home/dip5a # su dip5a
balik ke home user.
linux-lne0:/home/dip5a # su dip5a
dip5a@linux-lne0:~>
buat mkdir
dip5a@linux-lne0:~> mkdir Aman
(Buat mkdir dan senarai dir yg di cipta)
ls
dip5a@linux-lne0:~> ls
Aman Desktop Download Pictures public_html Videos
bin Documents Music Public Templates
masuk ke Aman dir
dip5a@linux-lne0:~> cd Aman
buat dir kat dalam aman
dip5a@linux-lne0:~/Aman> mkdir oren
dip5a@linux-lne0:~/Aman> ls
oren
buat dir sekali gus
dip5a@linux-lne0:~> mkdir Aman/puo
dip5a@linux-lne0:~> cd Aman
dip5a@linux-lne0:~/Aman> ls
oren puo
padam dir guna rmdir
dip5a@linux-lne0:~/Aman> rmdir puo
dip5a@linux-lne0:~/Aman> ls
oren
kembali ke dir dip5a
dip5a@linux-lne0:~/Aman> cd..
dip5a@linux-lne0:~>
padam dir aman dan dir oren sekali gus
dip5a@linux-lne0:~> rm -r Aman
dip5a@linux-lne0:~> ls
bin Documents Music Public Templates
Desktop Download Pictures public_html Videos
Buat fail
dip5a@linux-lne0:~> touch f1
dip5a@linux-lne0:~> ls
bin Documents f1 Pictures public_html Videos
Desktop Download Music Public Templates
Buat fail dan tulis data fail
dip5a@linux-lne0:~> cat > f2
nama saya aman. (Symbol ni tekan : Ctrl+C)
^C
dip5a@linux-lne0:~> ls
bin Documents f1 Music Public Templates
Desktop Download f2 Pictures public_html Videos
(Fail tercipta)
Papar data dalam fail f2
dip5a@linux-lne0:~> cat f2
nama saya aman.
Edit fail semula f2
dip5a@linux-lne0:~> cat >> f2
nama saya aman.
saya pelajar puo.
^C
dip5a@linux-lne0:~> cat f2
nama saya aman.
nama saya aman.
saya pelajar puo.
guna vi
tekan i INSERT (masukkan data dalam fail)
Nak save fail vi
(W nak save.f3 nama fail.)
Gunakan : Esc+Shift+:
Masukkan huruf :W f3 nak save.
Dan tekan : Enter.
Fail ber jaya disimpan.
Keluar dari vi
Gunakan : Esc + Shift +:
Masukkan huruf :q nak save.
(Tercipta fail : f3)Kembali ke :
dip5a@linux-lne0:~> vi
dip5a@linux-lne0:~> ls
bin Documents f1 f3 Pictures public_html Videos
Desktop Download f2 Music Public Templates
dip5a@linux-lne0:~>
cipta fail
(Cipta satu fail baru.)dip5a@linux-lne0:~> cat >f4
^C
dip5a@linux-lne0:~> ls
bin Documents f1 f3 Music Public Templates
Desktop Download f2 f4 Pictures public_html Videos
(Fail tercipta.)
Padam fail
dip5a@linux-lne0:~> rm f4
dip5a@linux-lne0:~> ls
bin Documents f1 f3 Pictures public_html Videos
Desktop Download f2 Music Public Templates
Fail f4 telah di padam.
Untuk lihat semua fail
Di desktop klik pada :
Buat compress fail gzip
dip5a@linux-lne0:~> ls
bin Documents f1 Music Public Templates
Desktop Download f2 Pictures public_html Videos
dip5a@linux-lne0:~> tar czvf Aman.gz f1 f2
Buat compress fail bzip
dip5a@linux-lne0:~> tar cjvf Aman.bz2 f1 f2
Buat compress fail bzip
dip5a@linux-lne0:~> tar cf Aman.tar f1 f2
Nak Extract compress fail
dip5a@linux-lne0:~> tar xvf Aman.tar
masuk Ke Root Untuk Tambah User
dip5a@linux-lne0:~> su
Password:
linux-lne0:/home/dip5a # useradd -m aman
linux-lne0:/home/dip5a # passwd aman
linux-lne0:/home/dip5a # useradd -m oren
linux-lne0:/home/dip5a # passwd oren
DI Root Untuk buat group
linux-lne0:/home/dip5a # groupadd dip
linux-lne0:/home/dip5a # groupadd dip5a
DI Root Untuk buat primary group
linux-lne0:/home/dip5a # usermod g dip5a aman
DI Root Untuk buat secondary group
linux-lne0:/home/dip5a # usermod G dip aman
Untuk Change Permission
Fail
dip5a@linux-lne0:~> chmod 744 f1
user
linux-lne0:/home/dip5a # chmod 704 aman
group
linux-lne0:/home/dip5a # chmod 704 dip5a
Buat compress Di Ubuntu 11.10
dip5a@ubuntu:/$ sudo apt-get install zip
Reading pakage lists Done
Building dependency tree
Reading state information Done
Zip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 107 not upgraded.
dip5a@ubuntu:/$ zip Aman.zip f1 f2
adding: f1 (stored 0%)
adding: f3 (stored 0%)
dip5a@ubuntu:/$ ls
bin Documents f1 f3 Music Public Templates
Desktop Download Aman.zip Pictures public_html Videos
Task 3
a.Installing Samba. Open terminal and execute sudo apt-get install samba .
b.To create password as PA$$woRd, open terminal and execute sudo smbpasswd -a nina command. Then, enter PA$$woRd. Example:
c.Open terminal and execute mkdir Desktop/SHARED to create a directory name SHAREDin desktop. To share the files using samba, add some command line at smb.conf file in directory /etc/samba/. To do this, Open terminal and execute the command sudo pico /etc/samba/smb.conf . Then insert the following words in bottom page of smb.conf :
[SHARED]
comment = Share directory /nina/Desktop/SHARED
path = /nina/Desktop/SHARED
guest ok = Yes
locking = No
Example:
d.To restart Samba, execute sudo restart smbd.
Example:
e.To check syntax errors, execute sudo testparm .
Example:
If presses enter, it will show;
1
top related