Wildcards are *, ?, [].
To list files and directories starting from a,
ls a*
To find files and directories with a in their name,
ls *a*
Consider the following example
ls ?a*
In here ‘?’ represents only one character. That means this command lists all files and directories with a as second character in their name.
ls M[ia]*
This command lists files and directories starts with M and second character is either i or a
ls ?[va]*
This command lists files those have v or a as a second character
We can use wildcards when coping, moving and deleting files.
Example
cp f* demo
This command copies all the files starting from f to directory called demo
Important:
Wildcards are very powerful, but be careful, because lots of damage can be happen very easily specially when deleting.
Tuesday, August 12, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment