Ubuntu files, folders and permissions

Directories
pwd Current Directory
cd .. Up One Folder
cd /etc
cd ../ Root home

List information about the FILEs

ls [options] [path/to/directory]
[options]: Used to fine-tune the default behaviour of the ls command.
[path/to/directory]: This is where you specify the path to a directory in which you want to list files.

ls -lh
List file name, size, permissions and date of creation.
ls -a
Display all files including hidden files.
ls -R Display files and directories recursively.

Create directory , move and copy files
mkdir dirname make directory
mv “folder 1″ folder_1” move folder
rm -r foldername remove all
rm folder_* remove folder
rmdir folder remove folder
mcopy source destination copy files

Permissions

Ubuntu follows the permission model inherited from Unix, where we can control three tasks for files or directories: read (r), write (w), and execute (x).

The read permission allows the file or directory to be opened for read access, while the write permission allows it to be opened for write or edit access.

The execute permission allows a file to be executed as a program or a directory to be traversed.

Command to check permission
ls -l list permissions
ls -l file.txt view file permission

When using the numeric method, the syntax of the chmod command follows a specific format:”
chmod [OPTIONS] NUMBER FILE… The syntax of the chmod command when using the numeric method

Each read, write, and execute permissions have the following number value:

r (read) = 4
w (write) = 2
x (execute) = 1
no permissions = 0

To give read, write and execute permission to the file’s owner, read and execute permissions to the file’s group and only read permissions to all other users you would do the following:

Owner: rwx=4+2+1=7
Group: r-x=4+0+1=5
Others: r-x=4+0+0=4
We come up to the number 754, which represents wanted permissions.
chmod 754 dir_name run this command to setup permissions
chmod _R 754 dir_name Run the command to setup recursively permissions

Create symbolic links
ln -s /usr/share/phpmyadmin /var/www/html/www.com/
It will create link under /var/www/html/www.com/

WinSCP Setup
WinSCP to login with “sudo su -“
In the WinSCP login options window:
1. Click Advanced options
2. Go to Environment –> SCP/Shell (on left)
3. Select Shell: “sudo su -“