news 2026/5/23 21:31:46

云计算作业

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
云计算作业

[root@localhost ~]# mkdir /root/haha hehe [root@localhost ~]# mkdir /root/haha hehe mkdir: 无法创建目录 "/root/haha": 文件已存在 mkdir: 无法创建目录 "hehe": 文件已存在 [root@localhost ~]# cp -r hehe /root/haha/apple [root@localhost ~]# mv hehe /apple [root@localhost ~]# echo heihei.txt >>haha -bash: haha: 是一个目录 [root@localhost ~]# rm -rf haha [root@localhost ~]# Socket error Event: 32 Error: 10053. Connection closing...Socket close. Connection closed by foreign host. Disconnected from remote host(RHCSA(192.168.184.128)) at 19:08:49. Type `help' to learn how to use Xshell prompt. [D:\~]$ Connecting to 192.168.184.128:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'. WARNING! The remote SSH server rejected X11 forwarding request. Web console: https://localhost:9090/ or https://192.168.184.128:9090/ Register this system with Red Hat Insights: rhc connect Example: # rhc connect --activation-key <key> --organization <org> The rhc client and Red Hat Insights will enable analytics and additional management capabilities on your system. View your connected systems at https://console.redhat.com/insights You can learn more about how to register your system using rhc at https://red.ht/registration Last login: Thu Mar 19 18:31:51 2026 [root@localhost ~]# mkdir /root/haha hehe [root@localhost ~]# cp -r hehe haha/apple [root@localhost ~]# cd haha [root@localhost haha]# touch heihei.txt [root@localhost haha]# mv hehe /apple mv: 对 'hehe' 调用 stat 失败: 没有那个文件或目录 [root@localhost haha]# mv hehe /root/haha/apple mv: 对 'hehe' 调用 stat 失败: 没有那个文件或目录 [root@localhost haha]# history 1 ip a 2 mkdir /root/haha hehe 3 cp -r hehe haha/apple 4 cd haha 5 touch heihei.txt 6 mv hehe /apple 7 mv hehe /root/haha/apple 8 history [root@localhost haha]# cd [root@localhost ~]# cd [root@localhost ~]# timedatectl Local time: 二 2026-03-31 19:18:10 CST Universal time: 二 2026-03-31 11:18:10 UTC RTC time: 二 2026-03-31 11:18:10 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: no NTP service: active RTC in local TZ: no [root@localhost ~]# timedatectl --help timedatectl [OPTIONS...] COMMAND ... Query or change system time and date settings. Commands: status Show current time settings show Show properties of systemd-timedated set-time TIME Set system time set-timezone ZONE Set system time zone list-timezones Show known time zones set-local-rtc BOOL Control whether RTC is in local time set-ntp BOOL Enable or disable network time synchronization systemd-timesyncd Commands: timesync-status Show status of systemd-timesyncd show-timesync Show properties of systemd-timesyncd ntp-servers INTERFACE SERVER… Set the interface specific NTP servers revert INTERFACE Revert the interface specific NTP servers Options: -h --help Show this help message --version Show package version --no-pager Do not pipe output into a pager --no-ask-password Do not prompt for password -H --host=[USER@]HOST Operate on remote host -M --machine=CONTAINER Operate on local container --adjust-system-clock Adjust system clock when changing local RTC mode --monitor Monitor status of systemd-timesyncd -p --property=NAME Show only properties by this name -a --all Show all properties, including empty ones --value When showing properties, only print the value -P NAME Equivalent to --value --property=NAME See the timedatectl(1) man page for details. [root@localhost ~]# date +%m%d%H 033119 [root@localhost ~]# date +%m%d%H > A.txt [root@localhost ~]# cut-d : -f3 /etc/passwd >UID bash: cut-d: 未找到命令... [root@localhost ~]# cut -d : -f3 /etc/passwd >UID [root@localhost ~]# cut -d : -f4 /etc/passwd >GID [root@localhost ~]# cat /etc/passwd | wc -l 39 [root@localhost ~]# cat /etc/passwd root:x:0:0:Super User:/root:/bin/bash bin:x:1:1:bin:/bin:/usr/sbin/nologin daemon:x:2:2:daemon:/sbin:/usr/sbin/nologin adm:x:3:4:adm:/var/adm:/usr/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/usr/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/usr/sbin/nologin operator:x:11:0:operator:/root:/usr/sbin/nologin games:x:12:100:games:/usr/games:/usr/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/usr/sbin/nologin nobody:x:65534:65534:Kernel Overflow User:/:/usr/sbin/nologin dbus:x:81:81:System Message Bus:/:/usr/sbin/nologin yggdrasil:x:999:999:yggdrasil system user:/var/lib/yggdrasil:/usr/sbin/nologin yggdrasil-worker:x:998:998:yggdrasil worker user:/:/usr/sbin/nologin tss:x:59:59:Account used for TPM access:/:/usr/sbin/nologin avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin systemd-oom:x:997:996:systemd Userspace OOM Killer:/:/sbin/nologin polkitd:x:114:114:User for polkitd:/:/sbin/nologin rtkit:x:172:172:RealtimeKit:/:/sbin/nologin pipewire:x:996:994:PipeWire System Daemon:/run/pipewire:/usr/sbin/nologin geoclue:x:995:993:User for geoclue:/var/lib/geoclue:/sbin/nologin clevis:x:994:992:Clevis Decryption Framework unprivileged user:/var/cache/clevis:/usr/sbin/nologin sssd:x:993:991:User for sssd:/run/sssd/:/sbin/nologin gnome-remote-desktop:x:990:990:GNOME Remote Desktop:/var/lib/gnome-remote-desktop:/usr/sbin/nologin libstoragemgmt:x:989:989:daemon account for libstoragemgmt:/:/usr/sbin/nologin systemd-coredump:x:988:988:systemd Core Dumper:/:/usr/sbin/nologin wsdd:x:987:986:Web Services Dynamic Discovery host daemon:/:/sbin/nologin colord:x:986:985:User for colord:/var/lib/colord:/sbin/nologin setroubleshoot:x:985:984:SELinux troubleshoot server:/var/lib/setroubleshoot:/usr/sbin/nologin flatpak:x:984:983:Flatpak system helper:/:/usr/sbin/nologin gdm:x:42:42:GNOME Display Manager:/var/lib/gdm:/usr/sbin/nologin gnome-initial-setup:x:983:982::/run/gnome-initial-setup/:/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/usr/share/empty.sshd:/usr/sbin/nologin chrony:x:982:981:chrony system user:/var/lib/chrony:/sbin/nologin dnsmasq:x:981:980:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/usr/sbin/nologin tcpdump:x:72:72:tcpdump:/:/usr/sbin/nologin wyx:x:1000:1000:wyx:/home/wyx:/bin/bash [root@localhost ~]# cut -d :f1 /etc/passwd cut: 分隔符必须是单个字符 请尝试执行 "cut --help" 来获取更多信息。 [root@localhost ~]# cut --help 用法:cut 选项... [文件]... 将每个 <文件> 每行的指定部分打印到标准输出。 如果没有指定 <文件>,或者 <文件> 为 "-",则从标准输入读取。 长选项的必选参数对于短选项也是必选的。 -b, --bytes=列表 只选中指定的这些字节 -c, --characters=列表 只选中指定的这些字符 -d, --delimiter=分隔符 使用 <分隔符> 而不是 TAB 作为字段分隔符 -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless the -s option is specified -n with -b: don't split multibyte characters --complement 对选中的字节、字符或字段的集合求补集 -s, --only-delimited 不打印不包含分隔符的行 --output-delimiter=字符串 使用 <字符串> 作为输出分隔符 默认值是使用输入分隔符 -z, --zero-terminated 以 NUL 空字符而非换行符作为行分隔符 --help 显示此帮助信息并退出 --version 显示版本信息并退出 使用且仅使用 -b、-c 或 -f 中的一个。每个 <列表> 都是一个范围,或者用逗号隔 开的多个范围。被选中的输入的读取顺序就是输出顺序,且每个仅输出一次。 每个范围都符合以下格式中的一种: N 第 N 个字节、字符或字段(从 1 开始数) N- 从第 N 个字符、字节或字段,到行末 N-M 从第 N 个到第 M 个(包括第 M 个)字符、字节或字段 -M 从第 1 个到第 M 个(包括第 M 个)字符、字节或字段 GNU coreutils 在线帮助:<https://www.gnu.org/software/coreutils/> 请向 <http://translationproject.org/team/zh_CN.html> 报告任何翻译错误 完整文档 <https://www.gnu.org/software/coreutils/cut> 或者在本地使用:info '(coreutils) cut invocation' [root@localhost ~]# cut -d : -f1 /etc/passwd root bin daemon adm lp sync shutdown halt mail operator games ftp nobody dbus yggdrasil yggdrasil-worker tss avahi systemd-oom polkitd rtkit pipewire geoclue clevis sssd gnome-remote-desktop libstoragemgmt systemd-coredump wsdd colord setroubleshoot flatpak gdm gnome-initial-setup sshd chrony dnsmasq tcpdump wyx [root@localhost ~]# cut -d : -f3 /etc/passwd 0 1 2 3 4 5 6 7 8 11 12 14 65534 81 999 998 59 70 997 114 172 996 995 994 993 990 989 988 987 986 985 984 42 983 74 982 981 72 1000 [root@localhost ~]# sort -r | cut -d : -f3 /etc/passwd 0 1 2 3 4 5 6 7 8 11 12 14 65534 81 999 998 59 70 997 114 172 996 995 994 993 990 989 988 987 986 985 984 42 983 74 982 981 72 1000 ^[[A^[[B^H^H cd sdadad^H^H^H^H^H^H Connection closed. Disconnected from remote host(RHCSA(192.168.184.128)) at 19:44:34. Type `help' to learn how to use Xshell prompt. [D:\~]$ Connecting to 192.168.184.128:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'. WARNING! The remote SSH server rejected X11 forwarding request. Web console: https://localhost:9090/ or https://192.168.184.128:9090/ Register this system with Red Hat Insights: rhc connect Example: # rhc connect --activation-key <key> --organization <org> The rhc client and Red Hat Insights will enable analytics and additional management capabilities on your system. View your connected systems at https://console.redhat.com/insights You can learn more about how to register your system using rhc at https://red.ht/registration Last login: Tue Mar 31 19:09:56 2026 from 192.168.184.1 [root@localhost ~]# sort -rn | cut -d : -f3 /etc/passwd 0 1 2 3 4 5 6 7 8 11 12 14 65534 81 999 998 59 70 997 114 172 996 995 994 993 990 989 988 987 986 985 984 42 983 74 982 981 72 1000 ^[ ^[[A^C [root@localhost ~]# sort -nr | cut -d : -f3 /etc/passwd 0 1 2 3 4 5 6 7 8 11 12 14 65534 81 999 998 59 70 997 114 172 996 995 994 993 990 989 988 987 986 985 984 42 983 74 982 981 72 1000 ^C [root@localhost ~]# [root@localhost ~]# head -n25 /etc/passwd |tail -n5 rtkit:x:172:172:RealtimeKit:/:/sbin/nologin pipewire:x:996:994:PipeWire System Daemon:/run/pipewire:/usr/sbin/nologin geoclue:x:995:993:User for geoclue:/var/lib/geoclue:/sbin/nologin clevis:x:994:992:Clevis Decryption Framework unprivileged user:/var/cache/clevis:/usr/sbin/nologin sssd:x:993:991:User for sssd:/run/sssd/:/sbin/nologin [root@localhost ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:0c:29:e2:ab:2d brd ff:ff:ff:ff:ff:ff altname enp3s0 altname enx000c29e2ab2d inet 192.168.184.128/24 brd 192.168.184.255 scope global dynamic noprefixroute ens160 valid_lft 1139sec preferred_lft 1139sec inet6 fe80::20c:29ff:fee2:ab2d/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@localhost ~]# ip a |grep 'link/ether' link/ether 00:0c:29:e2:ab:2d brd ff:ff:ff:ff:ff:ff [root@localhost ~]# cut --help 用法:cut 选项... [文件]... 将每个 <文件> 每行的指定部分打印到标准输出。 如果没有指定 <文件>,或者 <文件> 为 "-",则从标准输入读取。 长选项的必选参数对于短选项也是必选的。 -b, --bytes=列表 只选中指定的这些字节 -c, --characters=列表 只选中指定的这些字符 -d, --delimiter=分隔符 使用 <分隔符> 而不是 TAB 作为字段分隔符 -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless the -s option is specified -n with -b: don't split multibyte characters --complement 对选中的字节、字符或字段的集合求补集 -s, --only-delimited 不打印不包含分隔符的行 --output-delimiter=字符串 使用 <字符串> 作为输出分隔符 默认值是使用输入分隔符 -z, --zero-terminated 以 NUL 空字符而非换行符作为行分隔符 --help 显示此帮助信息并退出 --version 显示版本信息并退出 使用且仅使用 -b、-c 或 -f 中的一个。每个 <列表> 都是一个范围,或者用逗号隔 开的多个范围。被选中的输入的读取顺序就是输出顺序,且每个仅输出一次。 每个范围都符合以下格式中的一种: N 第 N 个字节、字符或字段(从 1 开始数) N- 从第 N 个字符、字节或字段,到行末 N-M 从第 N 个到第 M 个(包括第 M 个)字符、字节或字段 -M 从第 1 个到第 M 个(包括第 M 个)字符、字节或字段 GNU coreutils 在线帮助:<https://www.gnu.org/software/coreutils/> 请向 <http://translationproject.org/team/zh_CN.html> 报告任何翻译错误 完整文档 <https://www.gnu.org/software/coreutils/cut> 或者在本地使用:info '(coreutils) cut invocation' [root@localhost ~]# cut -d ' ' -f 7 /etc/passwd |sort |uniq -c 25 1 adm:x:3:4:adm:/var/adm:/usr/sbin/nologin 1 bin:x:1:1:bin:/bin:/usr/sbin/nologin 1 daemon:x:2:2:daemon:/sbin:/usr/sbin/nologin 1 games:x:12:100:games:/usr/games:/usr/sbin/nologin 1 gnome-initial-setup:x:983:982::/run/gnome-initial-setup/:/sbin/nologin 1 halt:x:7:0:halt:/sbin:/sbin/halt 1 lp:x:4:7:lp:/var/spool/lpd:/usr/sbin/nologin 1 mail:x:8:12:mail:/var/spool/mail:/usr/sbin/nologin 1 operator:x:11:0:operator:/root:/usr/sbin/nologin 1 rtkit:x:172:172:RealtimeKit:/:/sbin/nologin 1 shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 1 sync:x:5:0:sync:/sbin:/bin/sync 1 tcpdump:x:72:72:tcpdump:/:/usr/sbin/nologin 1 wyx:x:1000:1000:wyx:/home/wyx:/bin/bash [root@localhost ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:0c:29:e2:ab:2d brd ff:ff:ff:ff:ff:ff altname enp3s0 altname enx000c29e2ab2d inet 192.168.184.128/24 brd 192.168.184.255 scope global dynamic noprefixroute ens160 valid_lft 1043sec preferred_lft 1043sec inet6 fe80::20c:29ff:fee2:ab2d/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@localhost ~]# ip a |grep 'link/ether' link/ether 00:0c:29:e2:ab:2d brd ff:ff:ff:ff:ff:ff [root@localhost ~]# ip a |grep 'inet/ether' [root@localhost ~]# ip a |grep inet inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host noprefixroute inet 192.168.184.128/24 brd 192.168.184.255 scope global dynamic noprefixroute ens160 inet6 fe80::20c:29ff:fee2:ab2d/64 scope link noprefixroute [root@localhost ~]# df -h 文件系统 大小 已用 可用 已用% 挂载点 /dev/mapper/rhel-root 36G 4.5G 32G 13% / devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 1.4G 84K 1.4G 1% /dev/shm tmpfs 536M 8.2M 528M 2% /run tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service /dev/nvme0n1p2 960M 335M 626M 35% /boot tmpfs 268M 140K 268M 1% /run/user/0 /dev/sr0 7.9G 7.9G 0 100% /run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# df -h | grep ' ' 文件系统 大小 已用 可用 已用% 挂载点 /dev/mapper/rhel-root 36G 4.5G 32G 13% / devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 1.4G 84K 1.4G 1% /dev/shm tmpfs 536M 8.2M 528M 2% /run tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service /dev/nvme0n1p2 960M 335M 626M 35% /boot tmpfs 268M 140K 268M 1% /run/user/0 /dev/sr0 7.9G 7.9G 0 100% /run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# df -h | tr -d ' ' 文件系统大小已用可用已用%挂载点 /dev/mapper/rhel-root36G4.5G32G13%/ devtmpfs4.0M04.0M0%/dev tmpfs1.4G84K1.4G1%/dev/shm tmpfs536M8.2M528M2%/run tmpfs1.0M01.0M0%/run/credentials/systemd-journald.service /dev/nvme0n1p2960M335M626M35%/boot tmpfs268M140K268M1%/run/user/0 /dev/sr07.9G7.9G0100%/run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# df -h | tr -t ' ' tr: " " 后缺少操作对象 进行替换操作时,必须给定两个字符串。 请尝试执行 "tr --help" 来获取更多信息。 [root@localhost ~]# df -h | tr -t ' ' ' ' 文件系统 大小 已用 可用 已用% 挂载点 /dev/mapper/rhel-root 36G 4.5G 32G 13% / devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 1.4G 84K 1.4G 1% /dev/shm tmpfs 536M 8.2M 528M 2% /run tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service /dev/nvme0n1p2 960M 335M 626M 35% /boot tmpfs 268M 140K 268M 1% /run/user/0 /dev/sr0 7.9G 7.9G 0 100% /run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# df -h | tr -s ' ' ' ' 文件系统 大小 已用 可用 已用% 挂载点 /dev/mapper/rhel-root 36G 4.5G 32G 13% / devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 1.4G 84K 1.4G 1% /dev/shm tmpfs 536M 8.2M 528M 2% /run tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service /dev/nvme0n1p2 960M 335M 626M 35% /boot tmpfs 268M 140K 268M 1% /run/user/0 /dev/sr0 7.9G 7.9G 0 100% /run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# grep --help 用法:grep [选项]... 模式 [文件]... 在每个 <文件> 中查找指定的 <模式>。 例如:grep -i 'hello world' menu.h main.c <模式> 可以包含多个模式字符串,使用换行符进行分隔。 模式选择与解释: -E, --extended-regexp <模式> 是扩展正则表达式 -F, --fixed-strings <模式> 是字符串 -G, --basic-regexp <模式> 是基本正则表达式 -P, --perl-regexp <模式> 是 Perl 正则表达式 -e, --regexp=模式 使用指定的 <模式> 进行匹配 -f, --file=文件 从指定的 <文件> 中获得 <模式> -i, --ignore-case 对于模式和数据,忽略大小写 --no-ignore-case 不要忽略大小写(默认) -w, --word-regexp 仅匹配整个单词 -x, --line-regexp 仅匹配整行 -z, --null-data 数据行以 0 字节 (NUL) 结束,而非换行符 杂项: -s, --no-messages 不显示错误信息 -v, --invert-match 选中不匹配的行 -V, --version 显示版本信息并退出 --help 显示此帮助信息并退出 输出控制: -m, --max-count=数值 选中 <数值> 行后停止执行 -b, --byte-offset 输出的同时打印字节偏移量 -n, --line-number 输出的同时打印行号 --line-buffered 每行输出后排空输出缓冲区 -H, --with-filename 输出的同时打印文件名 -h, --no-filename 输出时不显示文件名前缀 --label=标签 使用指定 <标签> 作为标准输入文件名前缀 -o, --only-matching 只显示行中非空的匹配部分 -q, --quiet, --silent 不显示所有常规输出 --binary-files=类型 假定二进制文件是 <类型>; <类型> 可以是 "binary"、"text" 或 "without-match" -a, --text 等价于 --binary-files=text -I equivalent to --binary-files=without-match -d, --directories=ACTION how to handle directories; ACTION is 'read', 'recurse', or 'skip' -D, --devices=ACTION how to handle devices, FIFOs and sockets; ACTION is 'read' or 'skip' -r, --recursive like --directories=recurse -R, --dereference-recursive likewise, but follow all symlinks --include=GLOB 只查找匹配 GLOB(含通配符的文件模式)的文件 --exclude=GLOB 跳过匹配 GLOB 的文件 --exclude-from=文件 跳过匹配 <文件> 内容中任一文件模式的文件 --exclude-dir=GLOB 跳过匹配 GLOB 的目录 -L, --files-without-match print only names of FILEs with no selected lines -l, --files-with-matches print only names of FILEs with selected lines -c, --count print only a count of selected lines per FILE -T, --initial-tab make tabs line up (if needed) -Z, --null print 0 byte after FILE name 文件控制: -B, --before-context=数值 打印前面 <数值> 行上下文 -A, --after-context=数值 打印后面 <数值> 行上下文 -C, --context=数值 打印前后 <数值> 行上下文 -数值 等价于 --context=数值 --group-separator=分隔符 在带有上下文的匹配块之间打印 <分隔符> --no-group-separator 不要在带有上下文的匹配块之间打印分隔符 --color[=何时], --colour[=何时] 使用标记高亮匹配的字符串; <何时> 可以是 "always"、"never" 或 "auto" -U, --binary 不要清除行尾的 CR 字符 (MSDOS/Windows) 若 <文件> 为 "-",则从标准输入读取。若没有指定 <文件>,则递归模式 下从 "." 读取,其他情况下从 "-" 读取。若指定的 <文件> 数量少于两个, 则默认启用 -h 选项。如果有任意行被选中,则退出状态为 0,否则 退出状态为 1;如果有错误发生,且未指定 -q 选项,则退出状态为 2。 请向 <bug-grep@gnu.org> 报告软件错误。 请向 <i18n-zh@googlegroups.com> 报告翻译错误。 GNU grep 的主页:<https://www.gnu.org/software/grep/> GNU 软件一般性帮助:<https://www.gnu.org/gethelp/> [root@localhost ~]# find /var -name *.log /var/log/audit/audit.log /var/log/sssd/sssd_kcm.log /var/log/rhsm/rhsmcertd.log /var/log/rhsm/rhsm.log /var/log/tuned/tuned.log /var/log/tuned/tuned-ppd.log /var/log/anaconda/anaconda.log /var/log/anaconda/program.log /var/log/anaconda/packaging.log /var/log/anaconda/storage.log /var/log/anaconda/lvm.log /var/log/anaconda/dnf.librepo.log /var/log/anaconda/hawkey.log /var/log/anaconda/dbus.log /var/log/anaconda/lorax-packages.log /var/log/anaconda/journal.log /var/log/boot.log /var/log/vmware-vmtoolsd-root.log /var/log/vmware-vmsvc-root.log /var/log/vmware-vmusr-root.log /var/log/vmware-network.3.log /var/log/vmware-network.2.log /var/log/vmware-network.1.log /var/log/vmware-network.log /var/log/dnf.log /var/log/dnf.librepo.log /var/log/dnf.rpm.log [root@localhost ~]# mkdir --help 用法:mkdir [选项]... 目录... 若 <目录> 不存在,则创建 <目录>。 长选项的必选参数对于短选项也是必选的。 -m, --mode=模式 设置文件模式(格式同 chmod),而不是 a=rwx - umask -p, --parents 需要时创建目标目录的父目录,但即使这些目录已存在 也不视为错误,且其文件模式也不受 -m 选项影响。 -v, --verbose 每次创建新目录时,打印一条消息 -Z 将每个创建的目录的 SELinux 安全上下文设置为默认类型 --context[=上下文] 类似 -Z,但如果指定了 <上下文>,则将 SELinux 或 SMACK 安全上下文设置为 <上下文> --help 显示此帮助信息并退出 --version 显示版本信息并退出 GNU coreutils 在线帮助:<https://www.gnu.org/software/coreutils/> 请向 <http://translationproject.org/team/zh_CN.html> 报告任何翻译错误 完整文档 <https://www.gnu.org/software/coreutils/mkdir> 或者在本地使用:info '(coreutils) mkdir invocation' [root@localhost ~]# cp -r /var -name *.log /logfile cp: 无效的选项 -- m 请尝试执行 "cp --help" 来获取更多信息。 [root@localhost ~]# mkdir /root/logfile [root@localhost ~]# cp /var -name *.log /logfile cp: 无效的选项 -- m 请尝试执行 "cp --help" 来获取更多信息。 [root@localhost ~]# df -h | tr -s ' ' | grep ' /$' | cut -d' ' -f4 32G [root@localhost ~]# echo "当前/系统的剩余大小为:$(df -h | tr -s ' ' | grep ' /$' | cut -d' ' -f4)" 当前/系统的剩余大小为:32G [root@localhost ~]# df -h | tr -s ' ' 文件系统 大小 已用 可用 已用% 挂载点 /dev/mapper/rhel-root 36G 4.5G 32G 13% / devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 1.4G 84K 1.4G 1% /dev/shm tmpfs 536M 8.2M 528M 2% /run tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service /dev/nvme0n1p2 960M 335M 626M 35% /boot tmpfs 268M 148K 268M 1% /run/user/0 /dev/sr0 7.9G 7.9G 0 100% /run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# df -h | tr -s ' ' |grep ' /$' /dev/mapper/rhel-root 36G 4.5G 32G 13% / [root@localhost ~]# df -h 文件系统 大小 已用 可用 已用% 挂载点 /dev/mapper/rhel-root 36G 4.5G 32G 13% / devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 1.4G 84K 1.4G 1% /dev/shm tmpfs 536M 8.2M 528M 2% /run tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service /dev/nvme0n1p2 960M 335M 626M 35% /boot tmpfs 268M 148K 268M 1% /run/user/0 /dev/sr0 7.9G 7.9G 0 100% /run/media/root/RHEL-10-0-BaseOS-x86_64 [root@localhost ~]# mkdir logfile | cp /var/log/*.log /logfile mkdir: 无法创建目录 "logfile": 文件已存在 cp: 目标 '/logfile': 没有那个文件或目录 [root@localhost ~]# mkdir logfile | cp /var/log/*.log /logfile cp: 目标 '/logfile': 没有那个文件或目录 [root@localhost ~]# mkdir logfile | cp /var/log/*.log logfile [root@localhost ~]# tar -zcvf all_log_backup.tar.gz /logfile tar: 从成员名中删除开头的“/” tar: /logfile:无法 stat: 没有那个文件或目录 tar: 由于前次错误,将以上次的错误状态退出 [root@localhost ~]# tar -zcvf all_log_backup.tar.gz logfile logfile/ logfile/boot.log logfile/dnf.librepo.log logfile/dnf.log logfile/dnf.rpm.log logfile/vmware-network.1.log logfile/vmware-network.2.log logfile/vmware-network.3.log logfile/vmware-network.log logfile/vmware-vmsvc-root.log logfile/vmware-vmtoolsd-root.log logfile/vmware-vmusr-root.log [root@localhost ~]# tar -zxvf all_log_backup.tar.gz -C /root logfile/ logfile/boot.log logfile/dnf.librepo.log logfile/dnf.log logfile/dnf.rpm.log logfile/vmware-network.1.log logfile/vmware-network.2.log logfile/vmware-network.3.log logfile/vmware-network.log logfile/vmware-vmsvc-root.log logfile/vmware-vmtoolsd-root.log logfile/vmware-vmusr-root.log [root@localhost ~]# history 1 ip a 2 mkdir /root/haha hehe 3 cp -r hehe haha/apple 4 cd haha 5 touch heihei.txt 6 mv hehe /apple 7 mv hehe /root/haha/apple 8 history 9 cd 10 timedatectl 11 timedatectl --help 12 date +%m%d%H 13 date +%m%d%H > A.txt 14 cut-d : -f3 /etc/passwd >UID 15 cut -d : -f3 /etc/passwd >UID 16 cut -d : -f4 /etc/passwd >GID 17 cat /etc/passwd | wc -l 18 cat /etc/passwd 19 cut -d :f1 /etc/passwd 20 cut --help 21 cut -d : -f1 /etc/passwd 22 cut -d : -f3 /etc/passwd 23 sort -r | cut -d : -f3 /etc/passwd 24 sort -rn | cut -d : -f3 /etc/passwd 25 sort -nr | cut -d : -f3 /etc/passwd 26 head -n25 /etc/passwd |tail -n5 27* cut -f ip a 28* 29 cut --help 30 cut -d ' ' -f 7 /etc/passwd |sort |uniq -c 31 ip a 32 ip a |grep 'link/ether' 33 ip a |grep 'inet/ether' 34 ip a |grep inet 35 df -h 36 df -h | grep ' ' 37 df -h | tr -d ' ' 38 df -h | tr -t ' ' 39 df -h | tr -t ' ' ' ' 40 df -h | tr -s ' ' ' ' 41 grep --help 42 find /var -name *.log 43 mkdir --help 44 cp -r /var -name *.log /logfile 45 mkdir /root/logfile 46 cp /var -name *.log /logfile 47 df -h | tr -s ' ' | grep ' /$' | cut -d' ' -f4 48 echo "当前/系统的剩余大小为:$(df -h | tr -s ' ' | grep ' /$' | cut -d' ' -f4)" 49 df -h | tr -s ' ' 50 df -h | tr -s ' ' |grep ' /$' 51 df -h 52 mkdir logfile | cp /var/log/*.log /logfile 53 mkdir logfile | cp /var/log/*.log logfile 54 tar -zcvf all_log_backup.tar.gz /logfile 55 tar -zcvf all_log_backup.tar.gz logfile 56 tar -zxvf all_log_backup.tar.gz -C /root 57 history
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/5/23 21:30:20

系统性能优化与开源工具应用指南:从问题定位到持续优化

系统性能优化与开源工具应用指南&#xff1a;从问题定位到持续优化 【免费下载链接】Atlas &#x1f680; An open and lightweight modification to Windows, designed to optimize performance, privacy and usability. 项目地址: https://gitcode.com/GitHub_Trending/atl…

作者头像 李华
网站建设 2026/4/1 13:47:36

MatterGen材料生成模型:3分钟快速入门与实战指南

MatterGen材料生成模型&#xff1a;3分钟快速入门与实战指南 【免费下载链接】mattergen Official implementation of MatterGen -- a generative model for inorganic materials design across the periodic table that can be fine-tuned to steer the generation towards a …

作者头像 李华
网站建设 2026/4/1 13:46:50

Python 如何反向 `enumerate` 遍历枚举

在 Python 中&#xff0c;enumerate() 是一个常用的内置函数&#xff0c;用于在遍历可迭代对象&#xff08;如列表、元组、字符串等&#xff09;时同时获取索引和值。但默认情况下&#xff0c;enumerate() 是从前往后遍历的。那么&#xff0c;**如何反向 enumerate 遍历&#x…

作者头像 李华
网站建设 2026/4/1 13:46:46

告别重复编码:用快马AI自动生成软件库e7c9的高效调用代码

作为一名经常和第三方库打交道的开发者&#xff0c;我深刻体会到手动编写调用代码的繁琐。尤其是像e7c9这样功能强大的软件库&#xff0c;虽然封装完善&#xff0c;但每次调用都需要反复查阅文档、处理边界情况&#xff0c;效率实在不高。最近尝试用InsCode(快马)平台的AI辅助生…

作者头像 李华
网站建设 2026/4/1 13:43:53

Umi-OCR:开源离线OCR工具的全场景效率提升指南

Umi-OCR&#xff1a;开源离线OCR工具的全场景效率提升指南 【免费下载链接】Umi-OCR OCR software, free and offline. 开源、免费的离线OCR软件。支持截屏/批量导入图片&#xff0c;PDF文档识别&#xff0c;排除水印/页眉页脚&#xff0c;扫描/生成二维码。内置多国语言库。 …

作者头像 李华
网站建设 2026/4/1 13:42:33

Windows系统性能优化全景指南:从问题诊断到持续优化

Windows系统性能优化全景指南&#xff1a;从问题诊断到持续优化 【免费下载链接】Atlas &#x1f680; An open and lightweight modification to Windows, designed to optimize performance, privacy and usability. 项目地址: https://gitcode.com/GitHub_Trending/atlas1…

作者头像 李华