As The last ship sailed towards the distant horizon I sat there watching on a rock My mind slowly drifting away Forming into my... Dreamtale
Linux Note
2018-01-13 / 2 min read

Documents permission

1. Permission

-rwxrwx---

  • first character:
    • 'd': directory
    • '-': regular file
    • 'l': link file
    • 'b': random access device
    • 'c': keyboard & mouse ...devices
  • 2~4 digits stand for owner permission
  • 5~7 digits stand for group permission
  • 8~10 digits stand for others permission

2. Number-type permission

  • r: 4
  • w:2
  • x:1

owner = rwx = 4+2+1 = 7
group = rwx = 4+2+1 = 7
others= --- = 0+0+0 = 0

chmod 770 file.log

3. Symbol-type permission

user -> u
group -> g
others -> o
all -> a

  • '+' : add
  • '-' : remove
  • '=' : set

chmod a+w .bashrc
chmod u=rwx,go=rx .bashrc
chmod a-x .bashrc

Filesystem Hierarchy Standard

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Commands

cd -

mkdir -p test1/test2/test3

mkdir -m 711 test2

My bash_profile

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'


export CLICOLOR=1
export LSCOLORS=gxfxaxdxcxegedabagacad

export CLICOLOR=1export PS1='\[\033[01;34m\][\t] \u\[\033[01;32m\] \w\$\[\033[00m\] '