Linux command lines

Basic

  • ls --- List down the files and sub-directories within your current directory
  • cd --- Change Directory -- Change the current working directory #Hint: when you enter 'Desktop', only enter 'Des' then click 'TAB'botton, it will fill up the directory.
  • pwd --- print work directory
  • clear --- Clear everything in the window
  • ''' https://blog.csdn.net/ancientear/article/details/81054986 https://www.javatpoint.com/linux-tutorial '''

    SSH

    GIT PUSH

    Git global setup

  • git config --global user.name "Ye Tao"
  • git config --global user.email "yt222ar@student.lnu.se"
  • Create a new repository

  • git clone git@gitlab.lnu.se:1dv501/student/yt222ar/assignment-03.git
  • cd assignment-03
  • git switch -c main
  • touch README.md
  • git add README.md
  • git commit -m "add README"
  • git push -u origin main
  • Push an existing folder

  • cd existing_folder
  • git init --initial-branch=main
  • git remote add origin git@gitlab.lnu.se:1dv501/student/yt222ar/assignment-03.git
  • git add .
  • git commit -m "Initial commit"
  • git push -u origin main
  • Push an existing Git repository

  • cd existing_repo
  • git remote rename origin old-origin
  • git remote add origin git@gitlab.lnu.se:1dv501/student/yt222ar/assignment-03.git
  • git push -u origin --all
  • git push -u origin --tags
  • Other

  • cd .shh
  • chmod u+xr,go-rwx ~/.ssh --- if "Permission denied" on a directory... # -bash: cd: .ssh/: Permission denied
  • git rm XXX.XXX
  • git commit -m "xxxxxx"
  • git push
  • git push -u origin main -f
  • git status

  • Home