C++集中营笔记(1)第一节课和第二节课

第一节课linux的使用

1.Linux 常用命令

[chen@bogon ~]$ cd ~
[chen@bogon ~]$ cd /home
[chen@bogon home]$ mkdir cpp-test
mkdir: cannot create directory ‘cpp-test’: Permission denied
[chen@bogon home]$ sudo mkdir cpp-test

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for chen: 
chen is not in the sudoers file.  This incident will be reported.
[chen@bogon home]$ mkdir cpp_test
mkdir: cannot create directory ‘cpp_test’: Permission denied
[chen@bogon home]$ su -
Password: 
Last login: Wed Jul  5 01:37:54 PDT 2023 on pts/0
[root@bogon ~]# visudo
[root@bogon ~]# su username
su: user username does not exist
[root@bogon ~]# su chen
[chen@bogon root]$ sudo mkdir cpp_test
[sudo] password for chen: 
chen is not in the sudoers file.  This incident will be reported.
[chen@bogon root]$ cd ~
You have new mail in /var/spool/mail/root
[chen@bogon ~]$ cd /home
[chen@bogon home]$ mkdir cpp-test
mkdir: cannot create directory ‘cpp-test’: Permission denied
[chen@bogon home]$ sudo mkdir cpp-test
[sudo] password for chen: 
chen is not in the sudoers file.  This incident will be reported.
[chen@bogon home]$ su
Password: 
[root@bogon home]# vim /etc/sudoers
[root@bogon home]# sudo mkdir cpp_test
[root@bogon home]# touch test-1.txt
[root@bogon home]# vim test-1.txt 
[root@bogon home]# cat test-1.txt 
hallo world!
[root@bogon home]# ls
chen  cpp_test  test-1.txt
[root@bogon home]# pwd
/home
[root@bogon home]# cp test-1.txt test-2.txt 
[root@bogon home]# cat test-2.txt 
hallo world!
[root@bogon home]# rm test-2.txt 
rm: remove regular file ‘test-2.txt’? y
[root@bogon home]# 

本研究牲竟然遇到小小问题

这里出现的bug是chen is not in the sudoers file.  This incident will be reported.

遇到这里不要慌Linux下is not in the sudoers file解决方法_this incident will be reported-CSDN博客

这里的细节就是 吧自己的用户名字记得加上 自己的名字

给大家看看那个文档吧

这里还有一个小细节 就是因为readonly正常保存是有问题的

必须得加!

那按esc之后再输出

:wq!

就行

说明这个教程是有问题的

老师后来是进入的home下的user用户名的文件夹下的操作的

这样就没有权限的问题了

第一节课就结束啦

哈哈 我就是大腿🦵

第二节课 配置git

编程语言发展的三个阶段

机器 操作的二进制 汇编 高级编程语言

c和c++的区别

多了封装

面向对象 抽象出 对象

面向过程 自上而下

派生和继承 (多态 )  这个好难的

空杯心态当作是复习了

不过感觉有点水呀 也不知道老师在讲什么 焦虑

不过要 配置好 自己的 git 我因为没有装好 之前好像是配置好了的

不过没关系不急 之后慢慢来配置就行

1.配置交作业的git

 

# ubuntu2204 @ ubuntu2204-VirtualBox in ~ [11:29:08] 

$ git --version 

git version 2.34.1



# ubuntu2204 @ ubuntu2204-VirtualBox in ~ [11:30:57] 

$ git config --list 



# ubuntu2204 @ ubuntu2204-VirtualBox in ~ [11:31:33] 

$ git config --global user.name "chen"



# ubuntu2204 @ ubuntu2204-VirtualBox in ~ [11:32:15] 

$ git config --global user.email "2459201111@xiaomi.com"



# ubuntu2204 @ ubuntu2204-VirtualBox in ~ [11:32:53] 

$ git config --list                                     



# ubuntu2204 @ ubuntu2204-VirtualBox in ~ [11:33:03] 

$ 

2.初始化仓库

#1.初始化仓库
git init
git add file
git commit -m "initial project version"

#2. 克隆仓库
git clone
+地址

#3.记录更新到仓库
git status
git add file 
git diff
git diff --cached
git commit -m
git commit --amend (加修改的部分)会生成中间文件
cat .gitignore

#4.查看提交历史
git log
git log --stat  做一个统计

#5撤销修改
git checkout    并非撤销 切换到不同分支 某个节点 (任何节点随机切换)
git reset COMMIT  可以返回

#6.远程仓库操作
git remote
git fetch
git pull 
git push

git支持很多种协议


  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东东要拼命

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值