linux restart command, linux view port occupancy, linux delete files, linux view processes, linux delete folders, linux shut-down orders, linux depressure command, linux

Displays the directory file as a basic linux command that must be in the developer’s possession Shows lls -l detailed information displays ls -h view directories show all files, including hidden files ls -d look at directory properties Find / name file find /name filename.txt ** search for file file file(filename.txt) by name. find. name “*.xml” returns to all xml files found. -name ‘*.xml’ ⁇ xargs grep “hello world” & Deletes files with zero file size ls -l ⁇ grep ‘.jar’ to find all jar files in the current directory grep ‘test ‘d* to show all files starting with d containing lines of test. grep ‘test’ aa bb cc shows lines of test in aa,bb,cc files. grep ‘[a-z]⁇ aa shows all rows containing at least 5 consecutive lowercase characters per string Create multi-level directories mkdir/tmp/file remove empty directories cd/tmp/hello/test switch to specified directory cd …/ switch to previous directory cd / root switch to current work catalogues pwd copy multiple files or directories cp-r sourceFolder targetFolder copying the entire folderc-rrgceFolder folder and retain document attributes scpurefilile file/ filenameName Cat-n /etc/services Show the contents of the files in rows More / etc/services spaces or f Turn over enter or q or Q Exit Specify the number of lines after displaying files[指定字串][文件]
-i 不区分大小写
-v 排除指定字串
grep mysql /root/install.log

压缩文件,压缩后格式.gz
gzip boduo
特点:1.只能压缩文件不能压缩目录2.不保留源文件

解压缩.gz的压缩文件
gunzip
gunzip boduo

打包目录,压缩后格式.tar.gz
tar -zcvf Japan.tar.gz Japan
-c 打包(create)
-v 显示详细信息
-f 指定文件名
-z 打包同时压缩
特点:1.既可以压缩文件也可以压缩文件2.保留文件

解压缩.tar.gz的压缩文件
tar -zxvf Japan.tar.gz
-x 解包
-v 显示详细信息
-f 指定解压文件
-z 解压缩

列出压缩文件列表
tar -tzf test.tar.gz

压缩文件或目录,压缩后格式.zip
zip boduo.zip boduo 压缩文件
zip -r Japan.zip Japan 压缩目录
特点:1.既可以压缩文件也可以压缩文件2.保留文件

解压缩.zip的压缩文件
unzip boduo.zip

压缩文件,压缩后格式.bz2
bzip2 -k boduo 压缩文件后保留源文件
tar -cjf Japan.tar.bz2 Japan 打包并压缩目录

解压缩.bz2的压缩文件
bunzip2 -k boduo.bz2 解压缩后保留源文件
tar -xjf Japan.tar.bz2 解压缩bz2压缩文件

切换用户
su -username

修改文件权限
chmod 777 file.java //file.java的权限-rwxrwxrwx,r表示读、w表示写、x表示可执行
使用超级管理员身份执行命令
sudo rm a.txt使用管理员身份删除文件

See if a program runs ps-ef ⁇ grep tomcat

End the thread process Kill-9 19979 Terminator position 19979 Check port occupancy netstat – tunpl ⁇ grep 8080 View port usage 8080 See which port belongs to the top 10 processes psof-i:80 viewing process ps x ⁇ grep java ps ax view all processes ps-ef ⁇ grep tomcat look at the top 10 processes (MEM) print information echo $JAVA_HOME printing values of Java home environment variable psauxaux=1; ps auxhead-1; psauxx ⁇ pt -vdrt – hec4 +g4 http://file.tgz
curl http://file.tgz

Write content in a document echo “www.baidu.com” >> /tmp/test/test.txt

df -h 查看分区使用状况
du -ah 统计目录大小
free -m 查看内存与缓存使用状况

sudo -i 由跳板机状态跳转到linux命令状态

补充:

以下为日常开发中操作linux测试环境操作:

linux查看磁盘空间并清理日志:
df -h logs下查看磁盘使用情况
echo ” > /opt/tomcat/tomcat_mall_18091/logs/catalina.outlinux look at logcd/opt/tomcat/tomcat_mal_18091/logs tail-f Catalina.unlinux look at ps-ef grep tomcat for all processes in Tomcat ps -ef -ef grep ⁇ grep 80 ⁇ grep 18091 for the process tomcat18091, showing process number linux kill—9 199796 linux viewing port occupancy below (with a view to excluding whether or not tomcat80 has been occupied) netstat -tunplepyp 8080 closed tomcat: cd/opt/tomcat/tomct_mut_180int/bund/shsh. cd /opt/tomcat/tomcat_mal_18091/bin/startup.sh bin directory./startup.sh view start-up log: tail-f /opt/tomcat/tomcat_mall_18091/logs/catalina.out logs

The entire environmental process is initiated under linux: cd /opt/tomcat/tomcat_mall_18091/bin 2. View the tomcat port number 18091, displaying process numbers ps-ef grep tomcat ⁇ grep 18091 3. Termination of process 21676-9 21676 4. Start tomcat server. /startup.sh 5. Access to initial log tail-f . . ./logs/catalia.out

linux restart commands sudo reboot, linux view port occupation netstat-tunpl ⁇ grep 8080, linux remove file rm readme.txt, linux view process ps, linux delete folder rm-rf test, linux shutdown order shutdown-h now, linux depressure command, unzip-o-d/home/sunny myfile.zip depress the Myfile.zip file to /home/sunny

sed命令_Linux sed命令:替换、删除、更新文件中的内容sed '/2/d' roc.txt删除带2的行

echo向文件追加或覆盖内容echo 'add content'>>/home/data/test.sh 追加>> 覆盖>

未经允许不得转载:萌萌Apprentissage » linux restart command, linux view port occupancy, linux delete files, linux view processes, linux delete folders, linux shut-down orders, linux depressure command, linux

Like (0) 打赏

Comments 0

Protected with IP Blacklist CloudIP Blacklist Cloud
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

//下一个脚本特效
//下一个脚本