Coder Social home page Coder Social logo

linux-command-review's Introduction

linux-command-review

in progress

Note:

  • Windows user watch Video: Window
  • macOs and linux user watch Video: Linux

Supplement Reading Resources:

Week 1:

a. Basic commands

    ls / - list root directory folders
    ls -l
    ls -ld 
    etc stores system configuration
    bin - binary files 
    home - personal directory 

    / - root
    pwd
    cd 
    cd ../ 
    ~ home dir
    mkdir
    mkdir my\ file or mkdir 'my file'
    history
    Ctrl -R to search through history 
    clear

    > copy:
    cp source_file target
    cp *.png~/Desktop
    cp -r   # recursive copy

    > remove:
    rm 
    rm -r
    rm -rf

b. File and Text Manipulation:

```
  cat - view file
  less
  more
  head
  tail (last 10 lines)

  search through files:
  grep

  echo
  echo woof>> dog.txt
  cat < file.txt
  ls /dir/fake_dir 2>error
  ls -la /etc | grep bluetooth
```

Week 2:

a. Users and Groups

sudo cat /etc/sudoers # beware 
sudo su -     # substitute user, default to root if not specified
exit
cat /etc/group
cat /etc/passwd

linux password:
sudo passwd -e tinzin # expire user password
sudo useradd name
sudo userdel name

b. Permissions:

rwx - read write execute
rwxrw-r-- # rwx for root, rw for group specified, r for all other user

modifying permissions:
o-owner, g- group , o - other user
chmod u-x myfile
chmod u-x myfile
chmod ugo+r myfile 

numerical equivalent 'saves time' 
4- read
2-write
1- execute 

chmod 754 mycoolfile # 4+2+1=7 rwx permission for root, 5 for group, 4 for others
sudo chown name my_file # change owner
sudo chgrp best_group my_file # change group owner

# setUID - allow file to be run as owner of file ( s
, setGID - allow to run file as member of file group (s or 2,1) 
 stickybit - allow file to be written to by anyone but only removable by owner or root (t or 1)

sudo chmod u+s my_file
sudo chmod 4755 my_file # in numerical form use 4 for root, 2 for group  2755 or g+s 
sudo chmod 1755 my_folder/  or chmod +t ..

linux-command-review's People

Contributors

topgyalgurung avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.