Unlock Powerful File Management: Essential Linux Commands Explained
This guide provides concise explanations of dozens of essential Linux commands—from file viewing and manipulation (cat, less, grep) to permission management (chmod, chown), searching (find, locate), and advanced utilities (awk, patch, scp)—helping users quickly master core command‑line operations.
cat
The cat command concatenates files and prints them to the standard output.
chattr
The chattr command changes file attributes.
chgrp
The chgrp command changes the group ownership of a file or directory.
In UNIX‑like systems, file and directory permissions are managed by owner and group; chgrp can set the group using either the group name or its numeric ID.
chmod
Linux/Unix file permissions are divided into three classes: owner, group, and others. chmod controls how a file may be accessed by others.
chown
Every file in Linux/Unix has an owner. chown changes the owner of a specified file to a given user or group (user name or UID; group name or GID). The command accepts a space‑separated list of files, supporting wildcards. Only the system administrator (root) can change file ownership.
cksum
The cksum command checks a file’s CRC to ensure it was not corrupted during transfer. It returns a checksum; if no file is specified or the name is "-", it reads from standard input.
cmp
The cmp command compares two files for differences. If the files are identical, no output is produced; otherwise it reports the first differing byte and line number. It can also read from standard input when a file name is "-".
diff
The diff command compares files line by line to show differences. When comparing directories, it compares files with the same name but does not descend into sub‑directories.
git
In text mode, git is a file manager similar to Norton Commander, providing an interactive interface for version control.
find
The find command searches for files under a specified directory. Without parameters, it lists all sub‑directories and files in the current directory.
file
The file command identifies the type of a file.
diffstat
The diffstat command reads the output of diff and displays statistics such as insertions, deletions, and modifications per file.
ln
The ln command creates a hard or symbolic link to a file, allowing the same file to appear in multiple locations without duplicating data.
cut
The cut command displays characters from position num1 to num2 of each line.
indent
The indent command formats C source files for easier reading.
gitview
The gitview command shows file contents in both hexadecimal and ASCII formats.
less
lessallows forward and backward navigation of a file, unlike more which only moves forward.
locate
The locate command searches for files or directories using a pre‑built database.
Typical usage: locate your_file_name.
lsattr
The lsattr command displays file attributes; combined with chattr you can modify them.
mattrib
The mattrib command changes or displays MS‑DOS file attributes, mimicking the DOS attrib command.
mc
The mc command provides a menu‑driven file manager with four panels.
mdel
The mdel command deletes MSDOS‑format files, prompting before removing read‑only files.
mdir
The mdir command lists directories in an MS‑DOS file system.
mktemp
The mktemp command creates a temporary file for use in shell scripts.
more
moredisplays a file page by page; press space to advance, b to go back, and h for help.
mmove
The mmove command moves or renames files/directories in an MS‑DOS file system.
mread
The mread command copies MS‑DOS files into a Linux/Unix directory (now superseded by mcopy).
mren
The mren command renames or moves MS‑DOS files or directories.
mtools
The mtools suite displays the commands it supports for MS‑DOS file system manipulation.
mtoolstest
The mtoolstest command tests and shows the configuration of mtools.
mv
The mv command renames or moves files or directories.
od
The od command outputs file contents in octal format.
paste
The paste command merges columns from multiple files side by side.
patch
The patch command applies changes to files, allowing batch updates of many files.
rcp
The rcp command copies remote files or directories; multiple sources can be copied into an existing destination directory.
rm
The rm command removes files or directories.
slocate
The slocate command searches for files or directories using a database of system paths.
split
The split command divides a large file into smaller pieces, defaulting to 1000‑line chunks.
tee
The tee command reads from standard input, writes to standard output, and simultaneously saves the data to a file.
tmpwatch
The tmpwatch command deletes unnecessary temporary files based on an age threshold (hours).
touch
The touch command updates a file’s access and modification timestamps; if the file does not exist, it creates an empty file.
umask
The umask command sets the default permission mask applied when creating new files.
which
The which command locates an executable in the directories listed in the $PATH environment variable.
cp
The cp command copies files or directories.
whereis
The whereis command searches for binary, source, and manual files in predefined locations.
mcopy
The mcopy command copies files between MSDOS and Linux filesystems.
mshowfat
The mshowfat command displays the FAT record number of an MS‑DOS file.
rhmask
The rhmask command encrypts or decrypts files for secure transmission.
scp
The scp (secure copy) command transfers files between Linux hosts over SSH.
awk
awkis a powerful text‑processing language named after its creators Aho, Weinberger, and Kernighan.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
