Saturday, 7 May 2016

Profile Management

A user profile is a visual display of personal data associated with a specific user, or a customized desktop environment. A profile refers therefore to the explicit digital representation of a person's identity. A user profile can also be considered as the computer representation of a user model.
/etc/profile                 -           it contains system void variables, if you do any modification in this file it will effect to the administrator and local user profiles.
~/.bash_profile         -           it contains user specific variables, if you do any modification in this file it will effect to that particular account only.
/etc/bashrc                 -           it contains system void alias variables
~/.bashrc                   -           it contains user specific alias variables
.bash_history           -           it contains all executed commands history
Commands:
# alias                        -           it will show the aliases 

[root@sankar ~]# alias
alias cp='cp -i'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
[root@sankar ~]#

# unalias <alias name>     -           it will remove mentioned alias
Note: you can always define an alias using /etc/bashrc OR .bashrc files
File Permissions:
Permission
Value
Number
Read
r
4
Write
w
2
Execute
x
1
Default permissions when you create a file or directory
File Permissions
File
644
Directory
755
File and Directory Permissions
In above image explained about file permissions
Commands to Change file/directory permissions
Symbolic permissions
u          -           user/owner
g          -           Group
o          -           Others
w         -           Write
x          -           Execute
+          -           Allow
-           -           deny
# chmod [options] <mode/permissions> <file/directory> - to change permissions file/folder
            Example: chmod 744 file1
# chmod u+rwx file or directory : in case of user only
                        # chmod ug+rwx file or directoty : in case of user and group
                        # chmod u+w,g+r,o+x directory/file
                        # chmod u+rw,g+rw directory/file
                        # chmod u-r, g-w,o-rw directory/file
                        # chmod ugo+rwx file/directory
                        # chmod ugo-rwx file/directory
# chown [options] <new owner> <file/directory> - to change ownership of file/folder
            Example: chown user2 file1
                            chown user1:group1 file2
# chgrp [options] <new group> <file/directory> - to change group of file/folder
            Example: chgrp gorup2 file2

No comments:

Post a Comment