磁盘空间命令
df 检查硬盘使用情况
-a 列出所有文件系统和各分区的磁盘使用情况
cc@ubuntu:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 977348 0 977348 0% /dev
tmpfs 201712 1796 199916 1% /run
du 显示文件目录的大小
-ab 列出所有文件和目录所占空间
cc@ubuntu:~$ du -ab 2.txt
44 2.txt
网络操作命令
ifconfig 显示网络设备的状态
这里遇到一个问题,输入ifconfig,会提示找不到命令,之后输入根据提示输入sudo yum install net-tools后
cc@ubuntu:~$ ifconfig
Command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools
cc@ubuntu:~$ sudo install net-tools
提示当前文件夹不可用。
cc@ubuntu:~$ ifconfig
Command 'ifconfig' is available in '/sbin/ifconfig'
The command could not be located because '/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative privileges associated with your user account.
ifconfig: command not found
切换到root,然后就成功了。
ping 检测主机
按ctrl+c 或者ctrl+z 退出
网友评论