The procedure for creating and deleting files and directories is similar to DOS, as well, however the commands are named slightly different. Note that during deletions, there is no undelete, or recycle bin. In addition, wildcards may be used as well. This makes deleting files a potentially dangerous activity. Please use caution. The following commands are available:
Action | Command | Syntax / Example |
---|---|---|
Copy a file | cp | cp [path]<filename> <destination_path> Examples: cp index.html /usr/root [Enter] cp /mnt/stat.sh /usr/bin [Enter] |
Delete a file | rm | rm <filename> Example: rm index.html [Enter] |
Rename a file | mv | mv <currentfilename> <newfilename> Example: mv index.html index.htm [Enter] |
Create a directory | mkdir | mkdir <newdirectoryname> Example: mkdir temp [Enter] |
Delete a directory | rmdir | rmdir <directorytodelete> Example: rmdir temp [Enter] |
Rename a directory | mv | mv <olddirectoryname> <newdirectoryname> Example: mv webpages htmldocs [Enter] |