---
title: "Linux常用命令管理"
author: "Flemming323"
date: "2014-10-09T10:19:47Z"
tags: []
categories: ["编程语言"]
slug: "linux"
draft: false
lastmod: "2014-10-09T10:19:47Z"
id: 2126499
url: "https://flemming323.iteye.com/blog/2126499"
---

netstat -lntp 查看端口

 

ls 列出目标目录中所有的子目录和文件

 

ifconfig 查看本机IP

 

rpm -e --nodeps + 包名 卸载软件

 

1.查找被占用的端口  
          netstat -tln    
          netstat -tln | grep 8083 

 netstat -tln 查看端口使用情况，而netstat -tln | grep 8083 则是只查看端口8083的使用情况

 

2.查看端口属于哪个程序？端口被哪个进程占用  
         lsof -i :8083 

 

3.杀掉占用端口的进程  
          kill -9 进程id 

 

Linux关闭防火墙命令

1） 永久性生效，重启后不会复原  
开启：chkconfig iptables on  
关闭：chkconfig iptables off

2） 即时生效，重启后复原  
开启：service iptables start  
关闭：service iptables stop