ls and rm are a couple of command-line/system programs in Unix and Linux operating systems, they aren't regular expressions.ls
is used to list the files/directories in the current directory and rm
is used to remove/delete files.
As stated, ls -l
lists the files/folders in the current directory. The l parameter makes ls list more detailed information about the items in the current directory.
Similarly rm -rf
will delete files/directories. The r parameter makes it delete files recursively (so it will go into any subdirectories and delete files there too), the f parameter suppresses any confirmation messages (e.g. "Are you sure you want to delete this file? (y/n)") and forcibly deletes any files.
So using rm -rf
will delete everything in the current directory and everything in any sub-directories.
Opening a terminal session as root and using the rm -rf
command at the root of the filesystem is one sure-fire way of deleting everything on your Unix/Linux system. Which may be why some of your class laughed when they saw it. It's OK to use rm -rf if you want to remove a lot of files/folders, but you need to be very careful when doing so! (Again, just don't use it at the root of the filesystem or in any system directories when you have root priveleges!)
Even as an ordinary user, using rm -rf
in the wrong place could delete all files that you have the appropriate permissions for (so all of your personal files, …