GNU Core Utilities provide the basic file, shell, and text commands present on essentially every Linux system: ls, cp, mv, rm, cat, cut, sort, head, tail, du, df, date, sync, shred, truncate, chmod, chown, and many more. Full list: List of GNU Core Utilities commands.
Coreutils tools documented in depth elsewhere on this site¶
| Tool | Page |
|---|---|
cut |
cut |
date |
date |
dd |
dd |
du |
du |
mv |
mv |
shred |
shred |
sync |
sync |
Common commands not given their own page¶
sort -k2,2 -n file # sort by the 2nd field, numerically
sort -u file # sort and remove duplicates
head -n 20 file / tail -n 20 file
tail -f /var/log/app.log # follow a growing file
wc -l file # line count
truncate -s 0 file # empty a file without deleting it
chmod -R u+rwX,go+rX dir/ # recursive permissions, capital X = only directories/executables get +x
chown -R user:group dir/
readlink -f path # resolve symlinks to an absolute path
realpath path
nl file # number lines
tr 'a-z' 'A-Z' < file # translate characters
paste file1 file2 # merge lines side by side
comm sorted1 sorted2 # compare two sorted files line by line
join file1 file2 # relational join on a common field
cat deserves one specific mention: cat -A file reveals hidden whitespace ($ at line ends, ^I for tabs, ^M for stray carriage returns), which is the fastest way to explain "these two files look identical but diff says they differ" — see diff.