GNU Core Utilities(Coreutils,GNU的核心工具軟體包):包含了對類Unix操作系統上使用的許多基本工具(如cat,ls和rm)的重新實現 GNU coreutils通過合併早期的軟體包textutils,shellutils和fileutils以及一些其他雜項工具而創建出 ...
GNU Core Utilities(Coreutils,GNU的核心工具軟體包):包含了對類Unix操作系統上使用的許多基本工具(如cat,ls和rm)的重新實現
GNU coreutils通過合併早期的軟體包textutils,shellutils和fileutils以及一些其他雜項工具而創建出來。
Coreutils支持很長的選項作為命令的參數,以及(除非設置了POSIXLY_CORRECT環境變數)鬆散約定,即使在常規參數之後也允許選項
Coreutils軟體包包含了Linux下許多基本的且核心的命令
在CentOS7下獲取coreutils源代碼包:
//通過ls命令的所屬軟體包來獲取coreutils軟體包的版本 #rpm -qf /bin/ls >>>coreutils-8.22-18.el7.x86_64 //下載yumdownloader工具,yumdownloader是一個從RPM源下載RPM軟體包的程式 #yum -y install yum-utils //使用yumdownloader命令下載源代碼,如下: #yumdownloader --source coreutils-8.22-18.el7.x86_64 //使用yumdownloader下載到的是rpm軟體包 //需要使用rpm2cpio命令將軟體包轉為cpio歸檔文件 //再使用cpio命令,將cpio歸檔文件複製提取為另一個tar歸檔文件 #rpm2cpio coreutils-8.22-18.el7.src.rpm | cpio -idv coreutils-8.22.tar.xz >>>coreutils-8.22.tar.gz //使用tar命令對的coreutils-8.22.tar.xz壓縮包進行解壓縮 #tar xf coreutils-8.22.tar.xz //coreutils軟體包的源代碼已經下載到本地,在其目錄下,有個src目錄 //存放基本命令(如ls等)的C語言代碼
更多的內容可以參考GNU關於coreutils軟體包的說明:https://www.gnu.org/software/coreutils/coreutils.html
coreutils軟體包包含的命令列表:
Name | Category | Description |
---|---|---|
chcon | File utilities | Changes file security context |
chgrp | File utilities | Changes file group ownership |
chown | File utilities | Changes file ownership |
chmod | File utilities | Changes the permissions of a file or directory |
cp | File utilities | Copies a file or directory |
dd | File utilities | Copies and converts a file |
df | File utilities | Shows disk free space on file systems |
dir | File utilities | Is exactly like "ls -C -b ". (Files are by default listed in columns and sorted vertically.) |
dircolors | File utilities | Set up color for ls |
install | File utilities | Copies files and set attributes |
ln | File utilities | Creates a link to a file |
ls | File utilities | Lists the files in a directory |
mkdir | File utilities | Creates a directory |
mkfifo | File utilities | Makes (FIFOs) |
mknod | File utilities | Makes block or character special files |
mktemp | File utilities | Creates a temporary file or directory |
mv | File utilities | Moves files or rename files |
realpath | File utilities | Returns the resolved absolute or relative path for a file |
rm | File utilities | Removes (deletes) files, directories, device nodes and symbolic links |
rmdir | File utilities | Removes empty directories |
shred | File utilities | Overwrites a file to hide its contents, and optionally deletes it |
sync | File utilities | Flushes file system buffers |
touch | File utilities | Changes file timestamps |
truncate | File utilities | Shrink or extend the size of a file to the specified size |
vdir | File utilities | Is exactly like "ls -l -b ". (Files are by default listed in long format.) |
b2sum | Text utilities | Computes and checks Blake2 message digest |
base32 | Text utilities | base32 encodes or decodes data and prints to standard output |
base64 | Text utilities | base64 encodes or decodes data and prints to standard output |
cat | Text utilities | Concatenates and prints files on the standard output |
cksum | Text utilities | Checksums and count the bytes in a file |
comm | Text utilities | Compares two sorted files line by line |
csplit | Text utilities | Splits a file into sections determined by context lines |
cut | Text utilities | Removes sections from each line of files |
expand | Text utilities | Converts tabs to spaces |
fmt | Text utilities | Simple optimal text formatter |
fold | Text utilities | Wraps each input line to fit in specified width |
head | Text utilities | Outputs the first part of files |
join | Text utilities | Joins lines of two files on a common field |
md5sum | Text utilities | Computes and checks MD5 message digest |
nl | Text utilities | Numbers lines of files |
numfmt | Text utilities | Reformat numbers |
od | Text utilities | Dumps files in octal and other formats |
paste | Text utilities | Merges lines of files |
ptx | Text utilities | Produces a of file contents |
pr | Text utilities | Converts text files for printing |
sha1sum,sha224sum ,sha256sum ,sha384sum ,sha512sum |
Text utilities | Computes and checks, SHA-224/256/384/512 message digest |
shuf | Text utilities | generate random permutations |
sort | Text utilities | sort lines of text files |
split | Text utilities | Splits a file into pieces |
sum | Text utilities | Checksums and counts the blocks in a file |
tac | Text utilities | Concatenates and prints files in reverse order line by line |
tail | Text utilities | Outputs the last part of files |
tr | Text utilities | Translates or deletes characters |
tsort | Text utilities | Performs a |
unexpand | Text utilities | Converts spaces to tabs |
uniq | Text utilities | Removes duplicate lines from a sorted file |
wc | Text utilities | Prints the number of bytes, words, and lines in files |
arch | Shell utilities | Prints machine hardware name (same as uname -m) |
basename | Shell utilities | Removes the path prefix from a given pathname |
chroot | Shell utilities | Changes the root directory |
date | Shell utilities | Prints or sets the system date and time |
dirname | Shell utilities | Strips non-directory suffix from file name |
du | Shell utilities | Shows disk usage on file systems |
echo | Shell utilities | Displays a specified line of text |
env | Shell utilities | Displays and modifies |
expr | Shell utilities | Evaluates expressions |
factor | Shell utilities | Factors numbers |
false | Shell utilities | Does nothing, but exits unsuccessfully |
groups | Shell utilities | Prints the groups of which the user is a member |
hostid | Shell utilities | Prints the numeric identifier for the current host |
id | Shell utilities | Prints real or effective GID |
link | Shell utilities | Creates a link to a file |
logname | Shell utilities | Print the user's login name |
nice | Shell utilities | Modifies scheduling priority |
nohup | Shell utilities | Allows a command to continue running after logging out |
nproc | Shell utilities | Queries the number of (active) processors |
pathchk | Shell utilities | Checks whether file names are valid or portable |
pinky | Shell utilities | A lightweight version of finger |
printenv | Shell utilities | Prints environment variables |
printf | Shell utilities | Formats and prints data |
pwd | Shell utilities | Prints the current working directory |
readlink | Shell utilities | Displays value of a symbolic link |
runcon | Shell utilities | Run command with specified security context |
seq | Shell utilities | Prints a sequence of numbers |
sleep | Shell utilities | Delays for a specified amount of time |
stat | Shell utilities | Returns data about an inode |
stdbuf | Shell utilities | Controls buffering for commands that use stdio |
stty | Shell utilities | Changes and prints terminal line settings |
tee | Shell utilities | Sends output to multiple files |
test | Shell utilities | Evaluates an expression |
timeout | Shell utilities | Run a command with a time limit |
true | Shell utilities | Does nothing, but exits successfully |
tty | Shell utilities | Prints terminal name |
uname | Shell utilities | Prints system information |
unlink | Shell utilities | Removes the specified file using the unlink function |
uptime | Shell utilities | Tells how long the system has been running |
users | Shell utilities | Prints the user names of users currently logged into the current host |
who | Shell utilities | Prints a list of all users currently logged in |
whoami | Shell utilities | Prints the effective userid |
yes | Shell utilities | Prints a string repeatedly |
[ | Other Utilities | A synonym for test; this program permits expressions like [ expression ]. |