close

#disable auto service
sudo systemctl disable application.service

#To list systemd services on CentOS/RHEL 7.x+ use
#The syntax is:
systemctl
systemctl | more
systemctl | grep httpd
systemctl list-units --type service
systemctl list-units --type mount

#To list all services:
systemctl list-unit-files

#find pid
top


#查詢網卡名稱及使用的 IP 地址, 即如同直接執行 “ifconfig” 一樣:

$ ip a
$ ip addr
$ ip address
$ ip addr show

Vim Text Editor

/etc/sysconfig/network-scripts/
vi sudo

Find the following code:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL

In this case, we’re granting root privileges to the user mynewuser . Add the following below that code:


#modify user password, must be root user

sudo passwd linuxize(username)

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

#list all services name
systemctl list-unit-files --type=service


#remove file without asking
rm -f XX.*                 

#check disc usage space
df -h
#check indoe space
df -i
#Check file size
cd /
du -sh *
 
摘要:Linux Ubuntu 硬碟大小查詢

df -h 可知道目前硬碟剩餘空間與使用空間
du -h 可知目前此資料夾下所有檔案與資料夾所佔硬碟大小總數
du -s 可知目前此資料夾總共佔用硬碟大小總數,以G為單位
du -sh 可知目前此資料夾總共佔用硬碟大小總數,以G為單位
ls -l可看檔案大小

於 Linux 如何查看 詳細的硬體資訊、型號

先記錄硬碟的部份, 有下述幾種指令可以使用:

    sudo smartctl -i /dev/sda # 顯示硬碟型號及規格, apt-get install smartmontools
    sudo hdparm -i /dev/sda1 # apt-get install hdparm
    sudo hdparm -I /dev/sda1 # 更詳細的資訊

 

arrow
arrow
    文章標籤
    linux centos 命令
    全站熱搜
    創作者介紹
    創作者 黑水晶 的頭像
    黑水晶

    黑水晶的部落格

    黑水晶 發表在 痞客邦 留言(0) 人氣()