博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
common commands on Linux
阅读量:7153 次
发布时间:2019-06-29

本文共 2760 字,大约阅读时间需要 9 分钟。

#### Tibco ems admin commands

show consumers topic=topic.sample

show consumers queue="queuname"
show connections user="username"

 

#### sar

sar -W 1 100 : check swap in/out statistics

 

#### check java class version

$ file ./org/apache/log4j/Appender.class

./org/apache/log4j/Appender.class: compiled Java class data, version 45.3
Or alternatively, using javap from the JDK as @jikes.thunderbolt aptly points out:

$ javap -v ./org/apache/log4j/Appender.class | grep major

major version: 45
And if you are relegated to a Windows environment without either file or grep

> javap -v ./org/apache/log4j/Appender.class | findstr major

major version: 45

 

#### java

## to check if a 64 bit java

java -d64

java -d32

 

#### jar

## Create jar file

jar cvf test.jar 1.txt 2.txt

or put 1.txt and 2.txt into test folder, then:

jar cvf test.jar test/*

## extract jar file

jar xf test.jar

It will extract all the files from test.jar and keep all the current directory structure.

so you will see:

test/1.txt
test/2.txt

Suppose you want to extract the TicTacToe class file and the cross.gif image file. To do so, you can use this command:

jar xf test.jar 1.txt

then it will just extract 1.txt from test.jar and put it under test/1.txt.

e.g. you have below jar and it's class file included in the jar:

[lofutpd1@lonlx1060b01:~/release/UTP7.1.0/lib]$ /local/0/sw/java/jdk1.6.0_30/bin/jar tf reconciliation-common-UTP7.1.0.jar | grep DateTime

com/nomura/fitp/reconciliation/DateTimeFormatFilter.class
[lofutpd1@lonlx1060b01:~/release/UTP7.1.0/lib]$

SOmetimes you want to replace that class file in order to test your new fix, you want to replace the class file with newly build class file, so you can do:

/local/0/sw/java/jdk1.6.0_30/bin/jar uf reconciliation-common-UTP7.1.0.jar com/nomura/fitp/reconciliation/FloatValueFormatFilter.class com/nomura/fitp/reconciliation/DateTimeFormatFilter.class

#### grep

1. Only show the matched part

ps -ef | grep service | grep [processUser] | grep -oh "\processname=\w*"

2. Exclude pattern

grep -v 'pattern'

3. Case insensitive

grep -i

4. include the file name in the grep commands

grep -n 'pattern' file /dev/null

#### tar

tar -cvjf a.tar a.html

tar -xvjf a.tar

-z : gzip(quicker but larger)

-j : bzip2(slower but smaller)

#### ls

ls -lh : human readable size

ls -sSl --block-size=M : sort by size and displayed in mega bytes

ls -sSr --block-size=M : sort by size but displayed in the reverse order, and displayed in mega bytes

use top together with free command:

#### free

free -g
free -m

#### du

du -ah --max-depth=1 : not just directories but also files

du -h --max-depth=1 : just directories

 

#### wget

wget to get the content of some web page

e.g. wget http://hostname:/directory/filename.txt

转载于:https://www.cnblogs.com/glf2046/p/6510470.html

你可能感兴趣的文章
分形之二叉树(Binary Tree)
查看>>
程序员的进步从阅读自己的老代码开始
查看>>
How to make a combo box with fulltext search autocomplete support?
查看>>
大数据的三个入口
查看>>
算法生成卐和卍字图
查看>>
java模拟异步消息的发送与回调
查看>>
void指针
查看>>
Xcode把应用程序打包成ipa
查看>>
Oracle用户、权限、角色管理
查看>>
AutoMapper使用手册(一)
查看>>
基本类型赋值转换规则表
查看>>
hackerrank-knapsack
查看>>
SessionFactory的创建和Session的获得
查看>>
Hybrid框架UI重构之路:四、分而治之
查看>>
iOS项目的目录结构(Cocoa China)
查看>>
取消word中所有超链接
查看>>
javascript:addEventListener
查看>>
Mysql函数INSTR、LOCATE、POSITION VS LIKE
查看>>
atoi()函数的实现
查看>>
基于.net开发chrome核心浏览器【三】
查看>>