Last update at :2024-05-15,Edit by888u
Compression/decompression command tar:
The tar command is a commonly used decompression or packaging command in Linux. Commonly used extension file names are .tgz/.tar.gz
#tar cvf a.tar.gz *.* (package all files in the current directory and compress them into file names a.tar.gz) #tar cvf a.tar.gz /home (package all files in the home folder and compress them into file names a.tar.gz) #tar xvf a.tar.gz (Extract a.tar.gz to the current folder, zxvf can also be used) #tar tvf a.tar.gz (browse the files in the a.tar.gz compressed package)Switch directory cd:
cd is a commonly used command to switch directories, similar to the cd command in DOS.
#cd /home/wwwroot (enter the /home/wwwroot directory) #cd .. (enter the upper directory) #cd – (enter the last directory entered) #cd / (enter the root directory) Note: Explanations are in parentheses.View the hard disk size occupied by files/directories
When we use VPS, we often encounter a situation where most of the hard disk space has been occupied for no apparent reason. We don’t know what files occupy this space. At this time, we need this command to check.
You can check it like this du –h —max–depth=1 /root, where /root can be replaced with other directories, so that you can see what is taking up space in the directory:
[root@woyard ~]# du -h --max-depth=1 /root 9.7M /root/wwwlogs 247K/root/www 120K/root/wwwroot 2.07M /root/ghost 6.14M/rootModify file host chown -R www.www filename # chown -R username.groupname filename
The user who modified fiflename is: www and the group is: www -R means that the directory and all contents under the directory are set to the same specified permission bits ================================================== ========== Modify file permissions chmod -R 700 /home/cookiex/abc Modify the permissions of folder abc to: 777 -R means that the directory and all contents under the directory are set to the same specified permission bits ================================================== ========== Check CPU information: cat /proc/cpuinfo | grep -m 1 “model name”
Check the power-on hours: smartctl /dev/sda –all | grep “Power_On_Hours”
================================================ =============
Recommended site searches: domain name registration website query, telecom ip address query, how to query domain name registration number, foreign vps server rental, the cheapest dual-line space, overseas virtual host, domain name query, Taiwan server rental, ip proxy, dynamics vps change ip in seconds,
发表评论