{"id":22787221,"url":"https://github.com/mancongios/command-line","last_synced_at":"2025-03-30T16:16:35.261Z","repository":{"id":201763845,"uuid":"74640175","full_name":"mancongiOS/command-line","owner":"mancongiOS","description":"Git常用命令行使用总结","archived":false,"fork":false,"pushed_at":"2016-11-28T14:59:55.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T17:41:46.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mancongiOS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-24T05:18:40.000Z","updated_at":"2018-11-28T14:48:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ecc6d8e-3cc5-4617-ae2e-f00e1c989ca0","html_url":"https://github.com/mancongiOS/command-line","commit_stats":null,"previous_names":["mancongios/command-line"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mancongiOS%2Fcommand-line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mancongiOS%2Fcommand-line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mancongiOS%2Fcommand-line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mancongiOS%2Fcommand-line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mancongiOS","download_url":"https://codeload.github.com/mancongiOS/command-line/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246342994,"owners_count":20761947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T00:50:51.204Z","updated_at":"2025-03-30T16:16:35.241Z","avatar_url":"https://github.com/mancongiOS.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 基本命令\n***\n#### 目录/文件的操作\n* mkdir \"目录名\"             在当前路径下创建一个文件夹  \n* mvdir \"目录1\" \"目录2\"      移动或者重命名一个目录    (如果目录2不存在,就直接修改目录1的名称为目录2)  \n* rmdir \"目录名\"             删除一个目录    \n***\n#### 转换目录\n\n* cd + \"路径\"           进入该文件目录下(也可以将文件直接拖进来)\n\n* cd ..                回到上级目录\n\n* cd .                 当前目录\n\n* cd /                 回到根目录\n\n* cd test.rtf 不可用. 不能cd到文件里.只能cd到目录.  -bash: cd: test.rtf: Not a directory\n***\n#### 拷贝/移动/删除\n* cp \"需要拷贝的文件路径\" \"目标地址路径\"     拷贝文件   例如: cp /Users/goulela/Desktop/test.rtf /Users/goulela/Desktop/文件夹2\n\n* mv \"需要移动的文件路径\" \"目标地址路径\"     移动文件        例如: * mv 文件夹2 /Users/goulela/Desktop/创建文件夹/文件夹\n\n* rm \"路径\"            删除文件           参数－rf 表示递归和强制，千万要小心使用，如果执行了 rm -rf / 你的系统就全没了\n***\n#### 创建并编辑文件\n* cd 到想要创建文件的路径下 \n* vim \"文件名.txt(需要加上想要创建的文件后缀,自动生成该后缀类型的文件)\" \n \n***\n### 显示操作\n* file \"文件名\"        显示文件的类型 \n* wc   \"文件名\"        统计文件的字符数,词数,行数\n\n* pwd                 查看当前所在的目录\n\n* ls                  显示当前路径下有什么文件\n* ls + \"目录名\"        显示特定的路径下有什么文件\n* ls -w               显示中文\n* ls -l               详细信息\n* ls -a               包括隐藏文件\n\n\n### 时间操作\n* date                显示系统的当前日期和时间\n* cal                 显示日历\n\n\n### 网络与通信\n* ping \"\"url\"        给一个远程主机发送 回应请求 \n* 终止ping打印         control + c\n* who                列出当前登录的所有用户\n* whoami              显示当前正进行操作的用户名\n\n# Git命令\n### 1.服务器拉取代码\n* git clone \"url\"         说明:url为服务器地址,用https的地址\n### 2.本地代码上传服务器\n* (最简单的方法)先在服务器上创建好项目,然后clone到本地,然后把项目copy进去.\n* (严格的方法) cd 到该项目的路径下\n*  git init\n*  git add .\n*  git remote add origin \"url\" \n*  git commit -m \"你的本次提交的备注信息\"\n*  git pull\n*  git push \n### 3.查看命令\n* git status            查看当前git的状态(未拉取的提交,和本地未提交的版本)\n* git log                \n* git show\n* git diff\n* git config \n### 提交命令\n* git add \"文件名\"\n* git add .\n* git pull\n* git push    \n  \n### 分支操作\n\n### gitignore的使用\n\n### 如何切换不同的服务器\n\n\n后续补充中...","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmancongios%2Fcommand-line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmancongios%2Fcommand-line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmancongios%2Fcommand-line/lists"}