When the user presses Enter, the shell converts /etc/*release* into a list of matching filenames before it executes the command. The command effectively becomes:
$ ls /etc/fedora-release /etc/lsb-release /etc/redhat-release
This is different from some other platforms, where the application itself is responsible for filename expansion. The use of shell globbing simplifies the design of software, but it can cause unexpected side effects when an argument is not intended to be a filename. For example, the echo command is used to display messages:
$ echo This is a test.
This is a test.
However, if you add stars to either side of the message, then globbing will kick in and expand those stars to a list of all files in the current directory:
$ echo *** This is a test. ***
bin boot dev etc home lib lost+found media misc mnt net opt proc ptal root sbin selinux srv sys tftpboot tmp usr var This is a test. bin boot dev etc home lib lost+found media misc mnt net opt proc ptal root sbin selinux srv sys tftpboot tmp usr var
The solution is to quote the argument to prevent globbing:
$ echo '*** This is a test. ***'
*** This is a test. ***
4.3.2.2. The merged file hierarchy
Microsoft Windows uses drive designators at the start of pathnames, such as the
You can view the mount table, showing which devices are mounted at which points in the tree, by using the
$ mount
/dev/mapper/main-root on / type ext3 (rw)
/dev/proc on /proc type proc (rw)
/dev/sys on /sys type sysfs (rw)
/dev/devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md0 on /boot type ext3 (rw)
/dev/shm on /dev/shm type tmpfs (rw)
/dev/mapper/main-home on /home type ext3 (rw)
/dev/mapper/main-var on /var type ext3 (rw)
/dev/sdc1 on /media/usbdisk type vfat
(rw,nosuid,nodev,_netdev,fscontext=system_u:object_r:removable_t,user=chris)
Or you can view the same information in a slightly more readable form, along with free-space statistics, by running the
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/main-root
30G 12G 17G 42% /
/dev/md0 251M 29M 210M 13% /boot
/dev/shm 506M 0 506M 0% /dev/shm
/dev/mapper/main-home
48G 6.6G 39G 15% /home
/dev/mapper/main-var 30G 13G 16G 45% /var
/dev/sdc1 63M 21M 42M 34% /media/usbdisk
Note that
4.3.3. What About...
4.3.3.1. ...finding out which files are going to match an ambiguous filename before executing a command?
While the cursor is on or adjacent to the ambiguous filename, press Tab twice.
$ ls
a2.html all-20090412
a3f1.html
$ ls a*
Alternately, press Esc-* and
$ ls a*
$ ls a2.html all-20050412 a3f1.html
4.3.3.2. ...entering a filename quickly at the shell prompt?
Type the first few characters of the filename, then press Tab.
$ ls all
$ ls all-20090412