gtar xzvf file.tar.gz # if gtar is available, otherwise,gunzip < file.tgz | tar xvf -Note the use of
< (gunzip file.tgz | tar xvf - won't work). You can always run gunzip and tar in 2 steps, which creates an extra tar file:gunzip file.tar.gzHow to find a port number (8080) in use:
tar xvf file.tar
netstat -an | grep 8080How to kill all java processes:
killall javaHow to list all background jobs:
jobs
[1] Running ./standalone.shHow to kill the current background job:
kill %How to list all java processes:
$JAVA_HOME/bin/jps
$JAVA_HOME/bin/jps -l
$JAVA_HOME/bin/jps -lv
ps -ef | grep java # more reliable than jpsHow to find a java (jboss) process with jps and kill it:
jps | grep jboss | awk '{print $1}' | xargs kill -9How to find a jboss process with "ps -ef" and kill it:
ps -ef | grep -v grep | grep jboss | awk '{print $2}' | xargs kill -9Note that in "ps -ef" output, the PID is the 2nd column, after UID. This is different from "ps" and "jps..." output, where PID is column 1.
How to find a file is opened by which program and user (takes a while to finish):
lsof | vim -How to list all files in current directory in absolute path (for copying the path):
find $PWDHow to sort a list of items (e.g., file paths) and remove duplicates:
sort a.txt > b.txt
uniq b.txt > c.txt