For the moment, let’s focus on getting the directory size. If you want to check the directory size in Linux, you can use this command: du -sh path_to_directory This will give you the total size of the said directory in human-readable format, i.e. KB, MB or GB. Using du ...
mkdir new_directory 创建名为new_directory的目录。 代码语言:javascript 复制 mkdir-p/path/to/directory 代码语言:javascript 复制 mkdir/tmp/tm/wljslmz 创建指定路径的目录,如果路径中的目录不存在,则会一并创建。 5. mv - 移动或重命名文件 mv命令用于移动文件或重命名文件。 代码语言:javascript 复制 mv f...
If you want to check the size of the directory that is different from the current directory, use the following format for the “du” command. du-h/var The above command will help in displaying the size of the /var directory contents. You will notice an error in the below output as the...
find . -maxdepth 1 -name *.jpg -print -exec convert “{}” -resize 80x60 “thumbs/{}” ; batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick) 4、文件搜索 find / -name file1 从‘/’ 开始进入根文件系统搜索文件和目录 f...
Partition 1 of type Linux and of size 40 GiB is set Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. 运行以下任一命令通知内核更新分区表。 sudo partprobe /dev/vdb ...
Command (m for help): p Disk /dev/vdb: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x9277b47b ...
[directory]: Path to the directory you want to move into. For instance, to move to theDesktopdirectory: cd /home/phoenixnap/Desktop The system displays the new current working directory in the terminal: Use thepwd commandto check the full path to the current working directory: ...
The following command will display the size of the current directory including its sub-directories, but it will exclude the size of all.mp4files. $ du -ch --exclude='*.mp4' | grep total6.4G total Tip:Can we find the biggest or smallest directories/files? Of course, yes! Check the fol...
Step 1d: Check the host name Verify that the host name is set correctly: hostname This command returns only the host name of the machine and not its FQDN. Verify that the FQDN is set correctly: hostname-f This command returns the FQDN of the machine. ...
cat file1 | command( sed, grep, awk, grep, etc...) >> result.txt #合并一个文件的详细说明文本,并将简介写入一个已有的文件中 grep Aug /var/log/messages #在文件 '/var/log/messages'中查找关键词"Aug" grep ^Aug /var/log/messages #在文件 '/var/log/messages'中查找以"Aug"开始的词汇...