

# Delete all files starting with XX in the current directory and all subdirectories # Delete all files starting with XX in the current directory without confirmation This will allow the rm command to go down through the directory tree from where the command is issued and act on any files or subdirectories that it finds. The second switch is -r, which stands for recursive. When you hit Enter, the command is done and there is no going back. When you run the rm command with the -f switch, it will delete whatever you tell it to delete without checking or asking if you are sure. It turns off the “Are you sure?” prompt that normally comes up when you try to delete a file. There are two important flags that you need to be aware of. Related: Ways to Get Command- Line Help on Linux Since the rm command permanently deletes files and directories, you must be extremely careful when issuing a command that traverses directories and acts based on wildcards. The rm command also functions as a powerful utility for removing entire directories and even directory trees. Rmdir ~/temporary Removing Directory Trees With rm # Remove a temporary directory from your home directory # Remove an empty directory from the current path Use the ls -a command to show hidden files that need to be removed if you get an error. A common problem when using this command is trying to delete a directory that seems empty but contains hidden files. You can use rmdir to remove an empty directory. # Remove all files starting with ab in a specific directory # Remove all files starting with the letters ‘ab’ in the current directory # Remove a single file in the current directory You can delete multiple files by using the * wildcard character. The rm command simply requires the name or path to a file or files to delete. Short for remove, the rm and rmdir commands will remove (as in permanently delete) files and directories.

Typing any command followed by "-help" will often show quick usage examples.For example, the commands cd /home/user and cd ~ are the same. You can substitute ~ anywhere in a command to represent that path.
#SHOW HIDDEN FILES MAC COMMAND LINE FULL#
The full path to that directory is usually something like /home/user/ or /var/home/user/. This directory stores all your personal files. Every user on Linux has a home directory. The tilde (~) is shorthand for your home directory.Be sure to pay attention to capital and lowercase letters when copying or entering any command.

ls -a and ls -A are also two different commands. Typing Ls or LS will return a command not found error. Typing ls will list files in your current directory. Capital and lowercase letters are different in Linux.
