Using the Linux Ls Command to List File Names by File Suffix – Linux Commands Training Quick Tips

linux72 Using the Linux Ls Command to List File Names by File Suffix   Linux Commands Training Quick Tips
Clyde E. Boom asked:




A Linux “file name suffix” (a.k.a. filename suffix) is the dot “something” at the end of a filename, such as .txt (dot txt) and .conf (dot conf).

A Linux file suffix can be one or more characters. Such as .o (one character), .so (two characters) and .cfg (three characters) and a file suffix can even have another . (dot) followed by more characters, such as: .2.gz.

Some Linux file names show the “type” of file, such as .txt for text files and .conf for Linux server and system configuration files.

Also, many Linux file names do not have file name suffixes.

For example, many Linux command program files, sometimes called “binaries”, such as the ls command binary – and the program files for many other Linux commands – don’t have a file name suffix.

Linux ls Command Examples Showing Various File Types for Several Files

The * (asterisk) in the Linux ls command examples below is being used to represent “anything” in the file name at the left of the file name suffix.

For example, *.conf is used with the Linux ls command (and other commands) to get a listing of files with any text in the name at the left of the .conf.

Linux Commands Training Tips: When an * (asterisk) is used with a Linux command, this is called a wildcard character and this can also be used with other commands to show information on Linux files and directories. And the other wildcard character is the ? (question mark) and these can be used in other ways.

The Linux commands below will work in most Linux distributions, however, some of the ls commands below may not show any Linux files in the output, depending on your distribution.

The Linux ls command example below shows the (very important) Linux system and server configuration files in the etc directory ending in .conf.

$

Random Posts

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment