xugaoxiang | 迷途小书童

Linux common commands-43: useradd

The useradd command is used to create a new user or change user information. The created account is saved in the /etc/passwd file. Syntax format: useradd [parameter] [username] Common parameters: Example # 创建新的账号xugaoxiang useradd xugaoxiang # 创建账号,但不创建其HOME目录,也就是/home/xugaoxiang,同时禁止登录useradd -M -s /sbin/nologin xugaoxiang添加新用户,指定UID为666,指定用户组为root,toor成员,指定shell类型为/bin/sh # useradd -u 666 -s /bin/sh -G root,toor xugaoxiang This article is reprinted from […]

Linux common commands-43: useradd Read More »

Linux common commands-42: passwd

The passwd command is used to set user authentication information. The operation requires administrator privileges. Common format: passwd [parameter] Common parameters: Example # 修改当前用户的密码passwd # 修改root的密码passswd root # 锁定用户密码,不允许修改passwd -l xugaoxiang # 解除锁定passwd -u xugaoxiang # 清除密码passwd -d xugaoxiang # 下次登录修改密码passwd -e xugaoxiang This article is reprinted from https://xugaoxiang.com/2022/06/13/linux-cmds-42-passwd/ This site is for inclusion only,

Linux common commands-42: passwd Read More »

Linux common commands-41: usermod

usermod command is used to modify user accounts. Syntax format: usermod [parameter] Common parameters: Example # 更改用户登录的目录,如以xugaoxiang登录系统,会进入到目录/home/test usermod -d /home/test xugaoxiang # 修改用户名,从xugaoxiang到test usermod -l test xugaoxiang This article is reprinted from https://xugaoxiang.com/2022/06/13/linux-cmds-41-usermod/ This site is for inclusion only, and the copyright belongs to the original author.

Linux common commands-41: usermod Read More »

Linux common commands-40: wget

The wget command is used to download files from the specified URL . It is very stable, supports HTTP , HTTPS , FTP and other network protocols, and also supports proxies. Syntax format: wget [parameter] Common parameters: Example # 下载文件wget https://xugaoxiang.com/package.zip # 下载,保存为test.zip wget -O test.zip https://xugaoxiang.com/package.zip # 断点续传wget -c -O test.zip https://xugaoxiang.com/package.zip This article

Linux common commands-40: wget Read More »

Linux common commands-39: dpkg

The dpkg command is a tool for installing, creating and managing software packages in Debian Linux systems. Syntax format: dpkg [parameter] Common parameters: Example # 安装软件包dpkg -i test.deb # 显示已安装的软件包dpkg -l # 显示软件包中的内容dpkg -c test.deb # 删除软件包dpkg -r test.deb This article is reprinted from https://xugaoxiang.com/2022/06/11/linux-cmds-39-dpkg/ This site is for inclusion only, and the copyright belongs

Linux common commands-39: dpkg Read More »

Linux common commands-38: file

The file command is used to identify the file type and also the encoding format of some files. It obtains the file type by looking at the header information of the file. Syntax format: file [parameter] [file] Common parameters: Example # 显示文件类型file cuda_10.1.243_418.87.00_linux.run If it is an executable file This article is reprinted from https://xugaoxiang.com/2022/06/11/linux-cmds-38-file/

Linux common commands-38: file Read More »

Linux common commands-37: export

The export command is used to display and set system environment variables. Syntax format: export [parameter] Common parameters: Example # 列出当前所有变量export # 过滤PATH export | grep PATH # 设置变量ENVI export ENVI=100 # 常见的追加环境变量的值,如PATH export PATH=/home/xugaoxiang/bin:$PATH This article is reprinted from https://xugaoxiang.com/2022/06/11/linux-cmds-37-export/ This site is for inclusion only, and the copyright belongs to the original author.

Linux common commands-37: export Read More »

Linux common commands-36: tree

The tree command is used to list the contents of a directory in tree-like form. Syntax format: tree [parameter] Common parameters: Example tree # 只显示2层目录tree -L 2 # 只显示目录,不显示文件tree -d # 根据目录和文件的更改时间来排序tree -t This article is reprinted from https://xugaoxiang.com/2022/06/11/linux-cmds-36-tree/ This site is for inclusion only, and the copyright belongs to the original author.

Linux common commands-36: tree Read More »

Python utility module (31) PyPDF2

surroundings python 3.8 PyPDF2 2.1.0 foreword PyPDF2 is an open source, free library written in pure python language, mainly used to process pdf files, including common functions such as separation, merging, cropping, conversion, encryption, and decryption. Install Install using pip , execute the command pip install PyPDF2 Example of use Let’s take a look at

Python utility module (31) PyPDF2 Read More »

Linux common commands-35: more

The more command is similar to less , and is also used for paging display of large files, but it is not as rich in functions as less . For small files you can use cat . Syntax format: more [parameter] [file] Common parameters: Example # 查看文件test.py,在左下角会有显示内容的百分比more test.py # 从第10行开始显示more +10 test.py # 先清除屏幕内容,然后从第10行开始显示more -p

Linux common commands-35: more Read More »

Linux common commands-33: netstat

The netstat command is used to display various network related information such as network connections, routing tables, interface status, etc. Syntax format: netstat [parameter] Common parameters Example # 显示详细的网络信息netstat -a # 显示网卡列表netstat -i # 显示路由表netstat -r This article is reprinted from https://xugaoxiang.com/2022/06/10/linux-cmds-33-netstat/ This site is for inclusion only, and the copyright belongs to the original

Linux common commands-33: netstat Read More »

Linux common commands-32: dmesg

The dmesg command is used to inspect and control the kernel’s ring buffer. The kernel stores boot information in the ring buffer . We generally use dmesg to view the boot information of the system. At the same time, the boot information is saved in the file /var/log/dmesg . Syntax format: dmesg [parameter] Common parameters:

Linux common commands-32: dmesg Read More »