Quote:
Originally Posted by serena86
first, i want to change filenames with .txt suffix to .doc suffix. i tried by typing $ mv *.txt*.doc command but it gives me error message. why it doesn't work?
|
The reason this doesn't work is that bash (I'm assuming you are using bash for a shell) doesn't know how to resolve the two wild cards. While you may look at the two lists, and say well those match up just change the extension bash tries to take the txt list, and just plop it on the doc list. (This last statement is not totally accurate but at least gives the picture.)
For something that does work try a for loop, and the utility basename. All basic Linux commands such as these have a manual and can be accessed by typing
.
Quote:
Originally Posted by serena86
what command should i type to search the root directory??
|
To search the best utility is locate if you have it and your database is up to date; otherwise, you will have to use find. If you are simply looking for a file by name find is almost simple:
Code:
find / -type f -name '<name>'
Quote:
Originally Posted by serena86
i want to remove all filenames from my directory that start with a digit and end with ".html". what comand should i type?
|
Now this sounds a bit like a homework question, and I honestly don't remember off hand how to do this without a for loop and grep, but I like to use
regular expressions.
Hope this gives you a place to start,
Alunduil