Skip to main content

Posts

Linux Commands - Part 2

ls   - T his command is use to list files and folders.      ls                        {list current directory}    ls /media           {list /media files and folders in   directory media }    ls -l                     {list permission}    ls -a                   {list all, including hidden files, etc} c p - T his command is use to copy files and folders     cp   test /home/melick { copy test file to /home/melick folder}      cp   /root/s.txt   .          {copy s.txt to current directory (.)}      cp -r /root   /home/melick         {copy entire root folder to melick}                   mv - T his is used t move and rename files and folders     mv   test /home/melick         { move test file to /home/melick folder}    mv   /root/s.txt   .      { move s.txt file in /root to current folder (.)}    mv test1 test2             {rename test1 file to test2}            rm - This is used t delete files and folders    rm /home/Melick/tes t       {delete the test file...

Linux Commands - Part 1

chmod -  this is the command hat we use to change the permission.  ex:- chmod 777  test {change the permission to 777 the file test in the current directory} chmod 777 /home/melick/test {change the permission to 777 the file test in the /home/melick directory} chmod   g-r test {remove read permission in the group} chmod   g+r test {add read permission in the group} chmod   o-r test {remove read permission in the other} chmod   o+r test {add read permission in the other} chmod   u-r test {remove read permission in the user/owner} chmod   u+r test {add read permission in the user/owner} chmod   u=r test {read permission only to the user/owner} chmod   u=w test {write permission only to the user/owner} chown -  this command is use to change the owner of the file. chown root test     { if we want to change ownership to the file to the root } -rw-r--r-- 1 root melick 0 2008-12-21 21:11 test chown Melick:Sachika test {change 'test' files...

Linux Permissions

In linux, file, folder, etc can accesse by three types of user groups. Owner Group Other and each user group has three types of permissions. read,write, and execute. As an example, (if user has read permision we denote it by using 1 and if not by 0 in binary ) Owner Group Other rwx    rw-      r--  111     110     100  7         6          4 we can use " ls -l " command to view files,folders,links with permissions. drwxr-xr-x 2 melick melick 4096 2008-11-23 00:32 Music this is the sample. so we look each and every element further. drwxr-xr-x first charactor "d" is for type of the file. there are three types. d = directory (folder) l = link (symbolic link, shortcut) - = file c = charactor device (ex:- /dev/ttys0) {try:- ls -l /dev/ttys0} b = block device (ex:- /dev/sda1)     {try:- ls -l /dev/sda1} now we consider the permission set in the above folder. rwxr-xrx- = rwx   r-x        r-x   owner  group   other   111       101       101   7           5      ...

About Linux Users

All linx users, their passwords and other details are stored in a one file. It is " passwd " file which is in the "etc" folder. { /etc/passwd }             If we want to view password file {hm... there are several ways, but for the moment we will use "cat" command}.we will talk about "cat" command later. So in your command prompt {shell,terminal} run below command.  cat /etc/passwd This command will give you a file with several rows. One row is for one user. Let have a look on one row.  melick:x:1000:1000:melickrajee:/home/melick:/bin/bash  So let see what this line says. Following illustrate the format of the one line              username:password:Gid:Uid:Fullname:home folder:shell  So now we compare those two for further details.  melick       :x               :1000 :1000  :melickrajee  :/home/melick :/bin/bash  username :password :Gid    :Uid     :Fullname     :home folder  :shell melick - Username x(password) - x is not the pass...

WorkShop Polonnaruwa

Conducted workshop with the team CompSoc in Polonnaruwa Teaching Center . In here I conducted speaches on Database management systems , Web designning technologies and System Development Life Cycle.