Displays all files or directories in the/var/directory that start with 1, end with a lowercase letter, and have at least one digit in the middle (which can have other characters).
Command:
Ls-d/var/1*[0-9]*[a-z]
Displays files or directories that start with any number in the/etc directory and end with a non-numeric number.
Command:
ls-d/etc/[[:d igit:]]*[[1]]
Displays the/etc directory, not the beginning of the letter, followed by a letter and any other length of any character file or directory.
Command:
ls-d/etc/[[2]][[:alpha:]]*
In the/tem directory, create a file that begins with Tfile, followed by the current date and time, with a filename such as: tfile-2016-05-27-09-32-22.
Command:
touch/tmptfile-' date+%y-%m-%d-%h-%m-%s '
Copy all the files or directories in the/etc directory to the/tmp/mytest1 directory that begin with P and do not end with a number.
Command:
Mkdir/tmp/mytest1 (now create the Mytest1 directory in the/tmp directory)
Cp-r/etc/p*[[3]]/tmp/mytest1
Copy all files or directories ending with. D in the/etc directory into the/tmp/mytest2 directory.
Command:
Mkdir/tmp/mytest2
Cp-r/etc/*.d/tmp/mytest2
Copy all files that end with. conf to the/TMP/MYTEST3 directory in the/etc/directory, starting with 1 or M or N.
Command:
Mkdir/tem/mytest3
Cp-r/etc/[1,m,n,]*.conf/tmp/mytest3
:d igit:?
: Alpha:?
:d igit:?
/var,/etc,/tmp Directory operation under Linux