The missing course

The Missing Semester of Your CS Education

class one

About Ubuntu

  1. press super to search on this computer
  2. press super and tap tab to switch between tasks
  3. press super and up/down/left/right arrow to move the current window
  4. press super and pgup/pgdn to nevigate between windows

About Shell

  1. echo is a program
  2. echo $PATH will tell you all of the paths the computer will look for when execute the echo program
  3. which echo tells you which program it will run if you were to run echo
  4. absolute path
  5. pwd : present workinng directory
  6. . means the current directory
  7. .. means the parent directory
  8. cd ~ means cd /home/vincent (tilde)
  9. cd - will nevigate to the previous directory - is called dash
  10. ls –help
  11. ls -l gives you more information
  12. mv [OPTIONS] SOURCE… DESTINATION
    When multiple files or directories are given as a SOURCE, the DESTINATION must be a directory. In this case, the SOURCE files are moved to the target directory.
    If you specify a single file as SOURCE, and the DESTINATION target is an existing directory, then the file is moved to the specified directory.
    If you specify a single file as SOURCE, and a single file as DESTINATION target then you’re renaming the file .
    When the SOURCE is a directory and DESTINATION doesn’t exist, SOURCE will be renamed to DESTINATION. Otherwise if DESTINATION exist, it be moved inside the DESTINATION directory
  13. cp [OPTIONS] SOURCE… DESTINATION
    When the SOURCE and DESTINATION arguments are both files, the cp command copies the first file to the second one. If the file doesn’t exist, the command creates it.
    When the SOURCE has multiple files or directories as arguments, the DESTINATION argument must be a directory. In this situation, the SOURCE files and directories are moved to the DESTINATION directory.
    When the SOURCE and DESTINATION arguments are both directories, the cp command copies the first directory into the second one.
  14. rm remove a file
  15. rmdir remove a directory when it’s empty
  16. mkdir make a directory
  17. man ls gives you the manual of ls
  18. use echo command > filename to rewire the output to a file (this will overwrite everything in the file)
  19. cat filename gives you the content of the file
  20. use echo command >> filename to append things in the file
  21. tail -n1 output the last line
  22. ls -l / | tail -n1 (“|” is called pipe, the left will become the input of the right)
  23. sudo : do the following things as the super user
  24. sudo su : run the floowing command as the super user (type exit to exit)
  25. echo 100 > sudo tee brightness (tee means write things into the file and displat it )
    while sudo echo 100 > brightness will not work (because brightness didn’t get the sudo access)
  26. xdg-open filename : open a file using the proper program
  27. sh filename/string executes commands read from a command line string, the standard input, or a specified file.
  28. chmod see https://www.computerhope.com/unix/uchmod.htm

class two

  1. To assign variables in bash, use the syntax foo=bar (no space in between)
  2. echo $foo : print out the value of variable foo
  3. in double quote(“”),the $ sign will be excuted(print out the value), while single quote(‘’) present literal strings

Powered by Hexo

Copyright © 2013 - 2023 骸骨长廊 All Rights Reserved.

UV : | PV :