Without changing, ownership of folder give read-write permission Linux

If you want to give read and write permission to a folder in Linux os (fedora, centos, ubuntu then use the following command:

#setfacl -R -m u:YOUR_USERNAME:rwx FOLDER_NAME

This command will be helpful for other Linux users to change files and folders.

how to install vim on linux

If you are using linux so you are very much familiar with vim editor. Here I will show how install vim editor on linux box using command line.

Some time when you are doing new setup of server like for linux distribution.  There is lot is coming cloud hosting and centos and fedora. My most favorite is fedora.

install vim on linux

how to install vim on linux
how to install vim on linux

If your OS does not have vim then use following command.


[root@siwan]# yum install vim-X11 vim-common vim-enhanced vim-minimal
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: hpc.arc.georgetown.edu
 * base: mirrors.netdna.com
 * extras: mirrors.greenmountainaccess.net
 * updates: mirror.cogentco.com
Setting up Install Process
Package 2:vim-X11-7.0.109-6.el5.i386 already installed and latest version
Package 2:vim-common-7.0.109-6.el5.i386 already installed and latest version
Package 2:vim-minimal-7.0.109-6.el5.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.i386 2:7.0.109-6.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================
 Package                                             Arch                                        Version                                                 Repository                                   Size
===========================================================================================================================================================================================================
Installing:
 vim-enhanced                                        i386                                        2:7.0.109-6.el5                                         base                                        1.2 M

Transaction Summary
===========================================================================================================================================================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
vim-enhanced-7.0.109-6.el5.i386.rpm                                                                                                                                                 | 1.2 MB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing     : vim-enhanced                                                                                                                                                                        1/1

Installed:
 vim-enhanced.i386 2:7.0.109-6.el5

Complete!

Following are the common commands for doing editing with vim editor.

#vim somefile

some keys

i – for insert the text

escape – going to back

:18 – for going to line no 18

:w –  write and save the file

:q! –  quit the file, without saving

:wq! –  saving and closing the file

shift +g – going to bottom of file

page up – page up

page down –  page down

How to execute linux commands using php

Many times we need to run the linux commands using PHP language. We are going to give you code to, execute linux commands using php. This is my favorite question about PHP when I take an interview of new PHP developer.

execute linux commands using php
execute linux commands using php

In this article I will show you how to execute the linux command using PHP language syntax or script.

You can execute linux commands within a php script – all you have to do is put the command line in backticks (”) ,exec() , and shell_exec().

$command = exec('linux command');
echo $command;
echo shell_exec('ll');