Linux命令01--Coreutils软件包01--认识coreutils

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.xz 

//使用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软件包包含的命令列表:

Programs in coreutils 8.27
NameCategoryDescription
chconFile utilitiesChanges file security context
chgrpFile utilitiesChanges file group ownership
chownFile utilitiesChanges file ownership
chmodFile utilitiesChanges the permissions of a file or directory
cpFile utilitiesCopies a file or directory
ddFile utilitiesCopies and converts a file
dfFile utilitiesShows disk free space on file systems
dirFile utilitiesIs exactly like "ls -C -b". (Files are by default listed in columns and sorted vertically.)
dircolorsFile utilitiesSet up color for ls
installFile utilitiesCopies files and set attributes
lnFile utilitiesCreates a link to a file
lsFile utilitiesLists the files in a directory
mkdirFile utilitiesCreates a directory
mkfifoFile utilitiesMakes (FIFOs)
mknodFile utilitiesMakes block or character special files
mktempFile utilitiesCreates a temporary file or directory
mvFile utilitiesMoves files or rename files
realpathFile utilitiesReturns the resolved absolute or relative path for a file
rmFile utilitiesRemoves (deletes) files, directories, device nodes and symbolic links
rmdirFile utilitiesRemoves empty directories
shredFile utilitiesOverwrites a file to hide its contents, and optionally deletes it
syncFile utilitiesFlushes file system buffers
touchFile utilitiesChanges file timestamps
truncateFile utilitiesShrink or extend the size of a file to the specified size
vdirFile utilitiesIs exactly like "ls -l -b". (Files are by default listed in long format.)
b2sumText utilitiesComputes and checks Blake2 message digest
base32Text utilitiesbase32 encodes or decodes data and prints to standard output
base64Text utilitiesbase64 encodes or decodes data and prints to standard output
catText utilitiesConcatenates and prints files on the standard output
cksumText utilitiesChecksums and count the bytes in a file
commText utilitiesCompares two sorted files line by line
csplitText utilitiesSplits a file into sections determined by context lines
cutText utilitiesRemoves sections from each line of files
expandText utilitiesConverts tabs to spaces
fmtText utilitiesSimple optimal text formatter
foldText utilitiesWraps each input line to fit in specified width
headText utilitiesOutputs the first part of files
joinText utilitiesJoins lines of two files on a common field
md5sumText utilitiesComputes and checks MD5 message digest
nlText utilitiesNumbers lines of files
numfmtText utilitiesReformat numbers
odText utilitiesDumps files in octal and other formats
pasteText utilitiesMerges lines of files
ptxText utilitiesProduces a of file contents
prText utilitiesConverts text files for printing
sha1sum,
sha224sum,
sha256sum,
sha384sum,
sha512sum
Text utilitiesComputes and checks, SHA-224/256/384/512 message digest
shufText utilitiesgenerate random permutations
sortText utilitiessort lines of text files
splitText utilitiesSplits a file into pieces
sumText utilitiesChecksums and counts the blocks in a file
tacText utilitiesConcatenates and prints files in reverse order line by line
tailText utilitiesOutputs the last part of files
trText utilitiesTranslates or deletes characters
tsortText utilitiesPerforms a
unexpandText utilitiesConverts spaces to tabs
uniqText utilitiesRemoves duplicate lines from a sorted file
wcText utilitiesPrints the number of bytes, words, and lines in files
archShell utilitiesPrints machine hardware name (same as uname -m)
basenameShell utilitiesRemoves the path prefix from a given pathname
chrootShell utilitiesChanges the root directory
dateShell utilitiesPrints or sets the system date and time
dirnameShell utilitiesStrips non-directory suffix from file name
duShell utilitiesShows disk usage on file systems
echoShell utilitiesDisplays a specified line of text
envShell utilitiesDisplays and modifies
exprShell utilitiesEvaluates expressions
factorShell utilitiesFactors numbers
falseShell utilitiesDoes nothing, but exits unsuccessfully
groupsShell utilitiesPrints the groups of which the user is a member
hostidShell utilitiesPrints the numeric identifier for the current host
idShell utilitiesPrints real or effective GID
linkShell utilitiesCreates a link to a file
lognameShell utilitiesPrint the user's login name
niceShell utilitiesModifies scheduling priority
nohupShell utilitiesAllows a command to continue running after logging out
nprocShell utilitiesQueries the number of (active) processors
pathchkShell utilitiesChecks whether file names are valid or portable
pinkyShell utilitiesA lightweight version of finger
printenvShell utilitiesPrints environment variables
printfShell utilitiesFormats and prints data
pwdShell utilitiesPrints the current working directory
readlinkShell utilitiesDisplays value of a symbolic link
runconShell utilitiesRun command with specified security context
seqShell utilitiesPrints a sequence of numbers
sleepShell utilitiesDelays for a specified amount of time
statShell utilitiesReturns data about an inode
stdbufShell utilitiesControls buffering for commands that use stdio
sttyShell utilitiesChanges and prints terminal line settings
teeShell utilitiesSends output to multiple files
testShell utilitiesEvaluates an expression
timeoutShell utilitiesRun a command with a time limit
trueShell utilitiesDoes nothing, but exits successfully
ttyShell utilitiesPrints terminal name
unameShell utilitiesPrints system information
unlinkShell utilitiesRemoves the specified file using the unlink function
uptimeShell utilitiesTells how long the system has been running
usersShell utilitiesPrints the user names of users currently logged into the current host
whoShell utilitiesPrints a list of all users currently logged in
whoamiShell utilitiesPrints the effective userid
yesShell utilitiesPrints a string repeatedly
[Other UtilitiesA synonym for test; this program permits expressions like [ expression ].

相关推荐