那些年经常使用的命令行汇总

这篇笔记用以汇总那些年经常使用的命令行,以备关键时候可能用到,尽管如今不少工具都提供图形化的方式操做。java

Git

对于代码管理工具(SCM),就我我的经验来讲,这些年我用过svn、cvs、perforce、git。目前,Git是最流行的一个,不少的IDE都和Git有很好的集成。node

下面是一些经常使用的git命令行汇总:android

1,本地有一个项目,以前没有用git管理,现开始用git管理git

git init

2,检查项目文件的状态spring

git status

3,提交全部文件到本地branchsql

git add -A
git commit -m "commit message"

4,添加远程分支shell

git remote add origin
git pull
git branch -a
git branch --set-upstream-to=origin/master master

5,提交到远程分支数据库

git push
git push -u origin master

6,建立分支express

git branch dev

7,切换分支npm

git checkout dev

8,删除已经提交到远程分支的文件

git rm --cached FILENAME

Maven

Maven是java领域一个很是流行的工具,它不单单是一个依赖管理工具,同时也是项目构建工具。在maven以前的ant和ivy就是纯粹的包管理工具。类比其它技术栈,maven就约等于nodejs领域的npm+grunt/gulp;约等于.net领域的nuget+msbuild。

1,经常使用的构建命令

mvn clean test
mvn clean install -Dmaven.test.skip=true
mvn clean install -DskipTests=true

2,maven流行的一个主要缘由是其丰富的插件,下面是几个常见的插件:

  • 查看某个插件的使用详情
mvn help:describe -DgroupId=org.somewhere -DartifactId=some-plugin -Dversion=0.0.0
  • 若是项目有依赖冲突问题,能够用下面命令查看依赖详情
mvn dependency:tree -Dverbose -Dincludes=spring-expression
  • Run集成测试
mvn failsafe:integration-test -DskipIntegrationTests=false
mvn failsafe:integration-test -Dit.test=integrationtest.CustomerServiceIT -DskipIntegrationTests=false
  • 启动jetty
mvn jetty:run -Dhttp.proxyHost=proxy.abc.com -Dhttp.proxyPort=8080 -Dhttps.proxyHost=proxy.abc.com -Dhttps.proxyPort=8080
  • 根据archetype模版快速生成一个项目
mvn archetype:generate -DarchetypeArtifactId=some-archetype -DarchetypeGroupId=org.somewhere -DarchetypeVersion=3.4.0

* CURL

curl是一个很是实用的在命令行环境下用来发送http请求的工具,经常在建立一些自动化脚本的时候会用到。

下面是几个经常使用的命令:

1,发送post请求

curl -X POST -H "Content-Type: application/json" -H "shop-name:nike" -d '{"customerId":"testopenidddde","activityType":"AWARD","points":10,"description":"test","transactionAmount":0}' --proxy "" 'http://loyaltymashup.115.159.37.55.xip.io/rewardActivity'

2,发送get请求

curl -X GET -H "shop-name: nike" --proxy "" 'http://loyaltymashup.115.159.37.55.xip.io/members/oNeMQuKdUplMg2XLrfNjoI11iFD0'

3,发送delete请求

curl -X DELETE -H "shop-name: nike"--proxy "" 'http://loyaltymashup.115.159.37.55.xip.io/members/oNeMQuKdUplMg2XLrfNjoI11iFD0'

SQL

尽管市面上数据库产品众多(数据库 10 年风云变迁!哪款你最爱?),可是它们基本上都支持通用的sql,因此熟记基本的sql语句很是有用。

下面是一些经常使用的sql DML语句:

查询

SELECT * FROM customer;
SELECT * FROM customer where name='customer1';
SELECT * FROM table1 LEFT JOIN table2 ON table1.column=table2.column;

插入

INSERT INTO customer(id,NAME) VALUES(2,'customer2');
INSERT INTO customer(id,NAME) VALUES(2,'customer2'),(3,'customer3');

更新

UPDATE customer SET name='customer2+' WHERE MOD(id,2)=0;

删除

DELETE FROM customer WHERE id=5;
TRUNCATE customer;

Shell

相比我的电脑操做系统基本上是windows和macOS的天下,移动端操做系统基本上是android和iOS的天下,服务器操做系统则基本上是Linux主导。Linux基于unix发展而来,如今有多个发行版本:服务器版(Debian、RHEL、CentOS等),桌面版(Ubuntu、Fedora、OpenSUSE等)。

Shell是命令行使用Linux系统的工具,相似于windows上的dos命令行工具。虽然shell有不少版本,可是各个版本之间的差异不大,其中经常使用的是bash。掌握一些经常使用的命令对建立一些shell脚本很是有帮助。

下面是一些经常使用的shell命令:

1,文件管理

pwd(查看当前目录)、cd(切换目录)、ls(列出当前目录全部文件)、mkdir(建立目录)、touch(建立文件)、cp(复制)、mv(剪切)、rm(删除)、cat(查看文件内容)、tail(从文件尾查看,查看日志颇有用)、find(查找文件)、grep(filter文件内容)。

2,进程管理

ps、top、kill

3,查看用户

whoami

4,查看系统配置

uname

5,查看磁盘内存

df、du、free

注:上面全部命令均可以在命令后面加-h或者--help来查看命令具体如何使用;另外,经过manual+命令也能够。

T-code

经过SAPGUI 操做erp,熟记一些t-code有时候能够大大提升工做效率,特别是对于一个SAP的员工来讲。

下面是一些经常使用的t-code:

bp 管理business partner

su01 帐号权限

spro IMG

va05 列出销售清单

se93 查看T-code list

cs01 建立BOM

mm01 建立物料

mm02 物料主数据

xd03 查询customer

se11 表定义查询-but000表

注:t-code前面加/n和/o的区别

/n leaves the current transaction and takes you to a new transaction in the same session.

/o opens another session and takes you to the new transaction in it. You still have your previous session open with the previous transaction.

相关文章
相关标签/搜索