Get the App
SLTechnology News&Howtos  ›  Servers  › 

Commands for LINUX file management and user and group management

Shulou Source: shulou.com Published: 2022-06-03 05:58:10 10月02日 Update

1, display/etc directory, with non-letter beginning, followed by a letter and other arbitrary length of any character files or directories;

ls -a /etc/[^[:alpha:]]*

2. Copy all files or directories starting with P and ending with non-numbers in/etc directory to/tmp/mytest1 directory;

cp -a /etc/p*[^[:digit:]] /tmp/mytest1/

3. Convert the contents of the/etc/issue file to uppercase and save them to the/tmp/issue.out. file;

4. Summarize and describe how to use the user and group management class commands and complete the following exercises:

(1) Create group distro with GID 2019;

groupadd distro -g 2019

(2) Create user mandriva, whose ID number is 1005; the basic group is distro;

useradd -u 1005 -g distro mandriva

(3) Create user mageia with ID number 1100 and home directory/home/linux;

useradd -u 1100 -d /home/linux mageia

(4) Add password to user mageia, password is mageedu;

(5) Delete mandriva, but keep its home directory;

(6) Create user slackware, ID number of which is 2002, basic group is distro, additional group peguin;

(7)Change the default shell of slackware to/bin/tcsh;

(8)Add additional groups admins for user slackware;

Tags: Directory user file letter password beginning attachment command management usage content uppercase character number method length home Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB Microsoft MySQL vpn