
In this table, we have compiled a list of some of the most commonly used Linux file commands. These commands can be used to perform a variety of tasks related to files and directories, such as listing the contents of a directory, creating and deleting files and directories, moving and copying files and directories, changing file and directory permissions and ownership, and manipulating the contents of files.
The table is organized by function, with each command listed along with a brief description of what it does. By understanding and using these commands, you should be able to work with files and directories in Linux more efficiently and effectively.
Command | Description |
---|---|
ls | Lists the contents of a directory. |
cd | Changes the current working directory. |
pwd | Prints the current working directory. |
mkdir | Creates a new directory. |
rmdir | Deletes an empty directory. |
rm | Deletes a file or directory. |
mv | Moves or renames a file or directory. |
cp | Copies a file or directory. |
chmod | Changes the permissions of a file or directory. |
chown | Changes the owner of a file or directory. |
chgrp | Changes the group of a file or directory. |
touch | Creates an empty file or updates the timestamp of an existing file. |
cat | Concatenates and prints the contents of one or more files. |
head | Prints the first few lines of a file. |
tail | Prints the last few lines of a file. |
less | Displays a file a page at a time. |
grep | Searches for a pattern in the contents of one or more files. |
find | Searches for files and directories based on various criteria. |
sort | Sorts the lines of a file. |
uniq | Removes duplicate lines from a file. |
wc | Counts the lines, words, and characters of a file. |
cut | Extracts selected fields from a file. |
paste | Merges lines of files. |
join | Joins lines of two files based on a common field. |
sed | Edits the contents of a file using a script. |
awk | Processes the contents of a file using a script. |
tar | Archives and compresses files. |
gzip | Compresses a file. |
bzip2 | Compresses a file. |
gunzip | Decompresses a gzip-compressed file. |
bunzip2 | Decompresses a bzip2-compressed file. |