xugaoxiang | 迷途小书童

Linux common commands-69: mkfs

The mkfs command is used to format disk partitions and supports most file system formats, such as vfat , ext2 , ext3 , ext4 , etc. Syntax format: mkfs [parameters] Common parameters: Example # 将sda5分区格式化成ext4格式mkfs -t ext4 /dev/sda5 This article is reprinted from https://xugaoxiang.com/2022/06/22/linux-cmds-69-mkfs/ This site is for inclusion only, and the copyright belongs to […]

Linux common commands-69: mkfs Read More »

Linux common commands-68: dd

dd command is used to read, convert and output data. Data can be read from standard input or a file, converted to a specified format, and output to a file, device, or standard output. Syntax format: dd [parameter] Common parameters: Example # /dev/null,可以向它输出任何数据# /dev/zero,是一个输入设备,可以用它来初始化文件,该设备无穷尽地提供0 # 备份/dev/sdb全盘数据,使用gzip压缩并保存dd if=/dev/sdb | gzip > /root/image.gz # 将压缩的备份文件恢复到指定盘gzip -dc /root/image.gz

Linux common commands-68: dd Read More »

Linux common commands-67: nm

The nm command is mainly used to list symbols in certain files, that is, some functions and global variables, which are often used in code debugging. Syntax format: nm [parameters] Common parameters: Example # 显示目标文件test.o中的未定义符号,需要和其他对象文件进行链接nm -u test.o # 在/usr/lib/ 目录下找出哪个库文件定义了memset函数nm -A /usr/lib/* 2>/dev/null | grep “T memset” This article is reprinted from https://xugaoxiang.com/2022/06/22/linux-cmds-67-nm/ This site

Linux common commands-67: nm Read More »

Linux common commands-66: watch

The watch command executes the given command periodically, and the command output is displayed in full screen, which can help you monitor the running result of a command, saving you from running it manually over and over again. Press ctrl+c to exit. Syntax format: watch [parameter] [command] Common parameters: Example # 重复执行ls命令watch ls # 每隔2秒运行一次nvidia-smi

Linux common commands-66: watch Read More »

Linux common commands-64: locate

locate command is similar in function to find -name , but much faster than find . Syntax format: locate [parameter] [file] Common parameters: Example locate /etc/em This article is reprinted from https://xugaoxiang.com/2022/06/19/linux-cmds-64-locate/ This site is for inclusion only, and the copyright belongs to the original author.

Linux common commands-64: locate Read More »

Linux common commands -63: date

The date command is used to display or set the system date and time. Syntax format: date [options] [+output form] Common parameters: Example # 显示当前系统时间date # 设置系统时间date -s “20220320 12:00:00” # 只设置日期date -s 03/20/2022 # 只修改时间date -s 12:00:00 This article is reprinted from https://xugaoxiang.com/2022/06/19/linux-cmds-63-date/ This site is for inclusion only, and the copyright belongs to

Linux common commands -63: date Read More »

Linux common commands-62: wc

The wc command counts the number of bytes, words, and lines in the specified file, and displays the statistics for output. Syntax format: wc [parameter] [file] Common parameters: Example # 统计文件test.txt中的字数wc -w test.txt # 统计文件test.txt中的字节数wc -c test.txt # 统计文件test.txt中的行数wc -l test.txt This article is reprinted from https://xugaoxiang.com/2022/06/19/linux-cmds-62-wc/ This site is for inclusion only, and the

Linux common commands-62: wc Read More »

Linux common commands-60: lsof

The lsof command is used to obtain information about files opened by a process. In linux , everything is a file. The lsof command can view all opened files, such as: ordinary files, directories, special block files, pipes, socket sockets, devices, Unix domain sockets, etc. lsof needs to be executed as root user. Syntax format:

Linux common commands-60: lsof Read More »

Linux common commands-59: free

The free command displays the physically free and used memory in the system, including swap memory. This information is obtained by parsing the file /proc/meminfo . Syntax format: free [parameter] Common parameters: Example free # 以MB显示内存使用情况free -m This article is reprinted from https://xugaoxiang.com/2022/06/16/linux-cmds-59-free/ This site is for inclusion only, and the copyright belongs to the

Linux common commands-59: free Read More »

Linux common commands-58: which

The role of the which command is to search for the location of the system command in the path specified by the PATH variable. Syntax format: which [parameter] [file] Common parameters: Example which ffmpeg This article is reprinted from https://xugaoxiang.com/2022/06/16/linux-cmds-58-which/ This site is for inclusion only, and the copyright belongs to the original author.

Linux common commands-58: which Read More »

Linux common commands-57: whereis

The whereis command is used to locate the path of the command’s binary program, source code file, and man page and other related files. Its search speed is very fast, because it does not search in the disk, but queries in a database, which is automatically created by the linux system and contains information about

Linux common commands-57: whereis Read More »