Linux java 老是忘记的命令

修改 保存 xxx.conf文件

#查看修改文件
vi xxx.conf
#修改完之后  按esc    输入:wq 保存并退出
:wq

运行jar包

#运行jar
nohup java -jar xxxx.jar >log.txt &
#查看日志
tail -f log.txt

查看端口

netstat -tunlp|grep  端口号

结束进程

kill -9 进程

压缩解压

tar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg
tar –czf jpg.tar.gz *.jpg   //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gz
tar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2
tar –cZf jpg.tar.Z *.jpg   //将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Z
rar a jpg.rar *.jpg //rar格式的压缩,需要先下载rar for [Linux](http://lib.csdn.net/base/linux "Linux知识库")
zip jpg.zip *.jpg //zip格式的压缩,需要先下载zip for [linux](http://lib.csdn.net/base/linux "Linux知识库")

tar –xvf file.tar //解压 tar包
tar -xzvf file.tar.gz //解压tar.gz
tar -xjvf file.tar.bz2   //解压 tar.bz2
tar –xZvf file.tar.Z   //解压tar.Z
unrar e file.rar //解压rar
unzip file.zip //解压zip

Linux java环境变量配置

JAVA_HOME=/usr/java/jdk1.8.5_151

JRE_HOME=/usr/java/jdk1.8.0_151/jre

PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

export JAVA_HOME JRE_HOME PATH CLASSPATH

修改/etc/profile文件 
刷新 source /etc/profile

nginx配置文件


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
    server {
        listen       80;
        server_name  45.112.205.186;

   # location / {
    #          root /usr/local/futuresProject;
#                index  index.html index.htm;
 #                proxy_pass http://45.112.205.186:8080;
  #               proxy_redirect off ;
   #              proxy_set_header Host $host;
    #             proxy_set_header X-Real-IP $remote_addr;
     #            proxy_set_header REMOTE-HOST $remote_addr;
      #           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       #          proxy_connect_timeout 300;
        #         proxy_send_timeout 300;
         #        proxy_read_timeout 600;
          #       proxy_buffer_size 256k;
           #      proxy_buffers 4 256k;
            #     proxy_busy_buffers_size 256k;
             #    proxy_temp_file_write_size 256k;
              #   proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
               #  proxy_max_temp_file_size 128m;
        # }


    location / {
            root   /usr/local/nginx/html/;
            index  index.html index.htm;
        }

    location /html {
        root /usr/local/nginx;
        index index.html;
    }
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

你可能感兴趣的:(Linux java 老是忘记的命令)