Saturday, July 26, 2014

mv command in linux/unix

  1. The mv command can be used for renaming files. Try this command and then list your files to prove that the command worked:
    
         mv my.config  new.config
         ls
         
  2. mv can be used to rename directories also. Try this command and then list your files to prove that the command worked:
    
         mv subdir4  dir4  
         ls
         
  3. The mv command is also used for moving files. Use the command below to move new.sample into a new location, then list your files to prove that the command worked:
    
         mv new.sample  dir4  
         ls
         ls dir4
         
  4. Like many other UNIX commands, mv recognizes wildcard characters. Try the command below and then list your files to prove that the command worked:
    
         mv *env* dir4  
         ls
         ls dir4
         

0 comments:

Post a Comment