Saturday, April 26, 2014

rm

  •   rm command examples
Get confirmation before removing the file.

$ rm -i filename.txt


It is very useful while giving shell metacharacters in the file name argument.

Print the filename and get confirmation before removing the file.

$ rm -i file*


Following example recursively removes all files and directories under the example directory. This also removes the example directory itself.

$ rm -r example

Related Posts:

  • bzip2 bzip2 command examples To create a *.bz2 compressed file:   $ bzip2 test.txt To uncompress a *.bz2 file: bzip2 -d test.txt.bz2 Normal 0 false false false … Read More
  • cp cp command examples   Copy file1 to file2 preserving the mode, ownership and timestamp. $ cp -p file1 file2 Copy file1 to file2. if file2 exists prompt for confirmation before overwritting it. … Read More
  • cd cd command examples Use “cd -” to toggle between the last two directories Use “shopt -s cdspell” to automatically correct mistyped directory names on cd Normal 0 false false false EN-IN… Read More
  • chmod chmod command examples chmod command is used to change the permissions for a file or directory. Give full access to user and group (i.e read, write and execute ) on a specific file. $ chmod u… Read More
  • crontab crontab command example View crontab entry for a specific user  # crontab -u linuxcare -l Schedule a cron job every 10 minutes. */10 * * * * /home/linuxcare/check-disk-space More crontab ex… Read More

0 comments:

Post a Comment