🐧 Linux / Shell Scripting
Beginner
What do the ls, cd, pwd, mkdir, rm, cp, and mv commands do?
Answer
These are the fundamental Linux file-system commands. ls lists directory contents (ls -la shows hidden files and details). cd path changes the current directory; cd .. moves up one level. pwd prints the current working directory. mkdir dir creates a new directory (mkdir -p a/b/c creates nested directories). rm file removes a file; rm -rf dir recursively deletes a directory — use with caution. cp src dst copies a file or directory (-r for directories). mv src dst moves or renames a file. Mastering these commands is the foundation of Linux navigation and file management.