How to change the boot loader (grub)

$ If you’ve installed Windows OS alongside any Linux, assume , if it is Ubuntu..

Problem: By default Ubuntu will be the first option to boot, if you didn’t observe that boot loader options or didn’t select prompted options. Ubuntu OS will boot, which you don’t want and Windows OS should be your first priority.

Solution: # Boot the system

                     # Select Ubuntu

                     # Once Ubuntu OS up, go to terminal

                     # type  gedit /boot/grub/grub.cfg

                     # You’ll find line ‘default=0’,  which denotes first option is Ubuntu and

                     and change that option to 4 or 5, (while boot loader displays menu while                                          booting, read them from zero and count the Windows O/S, it would be                                                 probably 4 or 5) 

  1. Once you change the config file, do not forget to ‘save’ the file

#sudo update-grub

  1. Reboot the system, your selective OS will boot up first

 

Advertisements

File & Folder Permissions in Linux

In Linux, There are three types permission groups based on Users, they are
(1) Owner (Creator of file or folder)
(2) Group (Group or user permissions assigned to the file or folder)
(3) All users (Except Owner and user of the group)

Permission types are
(1) Read (r)
(2) Write (w)
(3) Execute (x)

#ls -l bashfile10.sh

<In above example, 'ls' will display list of files and folders and '-l' long format of 'bashfile10.sh'>

-rwxrwxrwx. 1 root root 0 Jul 6 09:28 bashfile10.sh

file2

If you want to change the permissions of the required file,-rwxrwxrwx

Each and every permission type is assigned to number

  • r  –> 4
  • w –> 2
  • x  –> 1

———-

Total of 7

rwx rwx rwx
4+2+1 4+2+1 4+2+1
7 7 7

 

#chmod 777 bashfile10.sh

< Above command will give full access (rwx) for each Owner / Group / Others>
r w x 4 + 2 + 1 7
r w – 4 + 2 + 0 6
r – – 4 + 0 + 0 4
– – – 0 + 0+ 0 0
  1. If you have many files inside the folder, you would like to recursively give same of type of permission to all of them, then you can use

#chmod -R  777  /home/test/

  1. Alternatively, you can use number system of permission type,
  1. chmod a-w file (All — Remove write permission)

2. chmod a+w file (All — Add write permission)

3. chmod o-x file (Other users — Remove executable permission)

4. chmod u+rw file (user / owner — Add read and write permission

5. chmod go-rwx file (group / others — Add rear, write and execute permission)

6. chmod -R o-w files ( Others – write permissions recursively for all files )

Decimal Binary
r w x 4 + 2 + 1 7 111
r w – 4 + 2 + 0 6 110
r  – x 4 + 0 + 1 5 101
r – – 4 + 0 + 0 4 100
– – – 0 + 0+ 0 0 0