Basic Linux commands and Linux commands
- Compression and decompression commands
-
- Compression: tar-zcvf appName.tar.gz. date appFileName (for example, tar-zcvf rc.tar.gz. 0513 rc)
- Decompress: tar-xvf tarFile
- Tar command details:
-
- Tar package compression;-c archive file,-x compressed file,-z gzip compression,-j bzip2 compression,-v view shows the compression or decompression process, and-f uses the file name.
-
- Tar-cvf rc.tar rc package only, not compressed;
- Tar-zcvf rc.tar.gz rc package and compress it with gzip. (commonly used)
- Tar-jcvf rc.tar.bz2 rc package and compress it with bzip2.
- Decompress, tar-xcvf fileName
- Find Files:
-
- Search for file content:
- Grep-R "search content "*
- File Permission:
- There are three permissions: The R read value is 4, the W write value is 2, and the X executable value is 1.
- Command: chmod
- Chmod + x filename add executable permissions to the file;
- Chmod + w fileanme add write permission to the file
- Soft connection B>:
Linux installation service:
How to view the system version in linux:
Disk space and File Usage: df-h (human readable) du-h -- max-depth = 1/usr. You can view the space occupied by files in the directory where/usr starts to be 1. |
|
Command: > Filename View the find. /-size + 204800 view the file content find. /-type f-name "*. jsp "| xargs grep" Weihai "searches for all jsp files in the current directory, including" Weihai ", to view the deleted files. Which processes are still accessing the files: lsof-n | grep deleted: |
Sudo fdisk-l |
View local IP Address Curl ifcpnfig. me View the output file: Tail-f nohup. out Background startup: Nohup./startWeblogic. sh |
Lsof-p [process ID] can view the file opened by an ID process. Super copy: |
Scp fromfilePath tofilePath (userName @ IP:/filePath) ForExample: Scp isportal_uum_sj.tar.gz.0928 root@172.16.66.18:/opt/apache-tomcat-6.0.37/webapps |
|
> Setup to view the system status such as system servie; SFTP/ftp protocol firewall: vi/etc/sysconfig/iptables open a port limit (through the firewall ): -a input-m state -- state NEW-m tcp-p tcp -- dport 3083 (port)-j ACCEPT basic command firewall: service iptables stop/start Settings disable/Enable Firewall by default: chkconfig iptables off/on Time Synchronization Service: yum install ntp command: ntpdate cn.pool.ntp.org sysctl-w net. ipv4.tcp _ tw_recycle = 1 install gcc yum-y install gcc make gcc-c ++ openssl-devel