Many of these commands have already been covered and a few will revisited in more detail in a later module.
User_id can be the name or numeric UID of the user of interest. The GNU version will also allow the group id to be changed at the same time.
chgrp group_id filelist
find - search all sub-directories from a specified starting point for a file matching specified criteria. The following would search for all c source code files in all directories under your home directory.
find $HOME -name "*.c"
find will be covered in more detail in its own module.
Exercise : #( Run the following command and look at the output. Lines in parenthesis are comments, don't enter them) #( List a character special file. This is the interface to the sound card and takes serial streaming data ) #(lists possible filetypes recognized) file -l ls -l /dev/console file /dev/console#( List a symbolic link file. This is the interface to the cd/dvd reader. Because it may be either, two symbolic links to the actual interface file were created. )
ls -l /dev/dvd file /dev/cdrom ls -l /dev/cdrom ls -l /dev/dvd ls -l /dev/sr0 file /dev/sr0#( List a block special file. This is the interface to one of the hard drives. ) ls -l /dev/sda file /dev/sda#( List a named pipe. A pipe is a special interface between running processes or programs that allow them to communicate with each other. init is the program that starts most other programs (children) and initctl is a named pipe interface that allows init and its children to communicate. ) ls -l /dev/xconsole file /dev/xconsole#( List a directory file. ) ls -ld /dev file /dev#( The following are all regular files but have formats or data specific to certain programs. ) #( List some different regular files. ) ls -l /etc/fstab file /etc/fstab file /etc/udev/udev.conf file /etc/xml/xml-core.xml file /etc/console-setup/cached_UTF-8_del.kmap.gz file /etc/ssh/moduli file /etc/emacs/site-start.d/50autoconf.el file /bin/setupcon file /bin/readlink |
The filetypes found above are not comprehensive, just a sampling. At one time, the recognized filetypes were kept in a text file.
However, Debian currently stores them in /usr/share/file/magic.mgc which is a binary most likely in a database format.
See man on topics :