Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Created December 13, 2016 10:37
Show Gist options
  • Save hsleonis/8697802dd1c581406b8c7341c6019181 to your computer and use it in GitHub Desktop.
Save hsleonis/8697802dd1c581406b8c7341c6019181 to your computer and use it in GitHub Desktop.
SSH commands to remove files and folders
/* The command in its simpliest form looks like: */
rm myFile.txt myFile1.txt myFile2.txt …etc…
/* Fortunately, rm accepts several arguments which can ease us.
In the above example, we could type: */
rm myFile*.txt
/* This will match all files starting with ‘myFile’ and ending in ‘.txt’ */
/* To delete a whole folder and its content recursively, you can use: */
rm -rf foldername/
/*To delete all files/folders in the current directory,
without deleting the directory itself, you would need to use: */
rm -rf *
/* Please be very careful when using rm command,
as it might have devastating effects on your website/server,
should you delete a system file or a folder. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment