cd —change the working directory cd ~ — go to home directory cd .. — move up one level of your directory cd - — go to previous directory ls — list the content of a directory pwd — shows your current working directory rm and rmdir — remove a file or directory cp — copy a file or directory mv — move a file or directory File and Directory Commands Command Description Example ls List directory contents. cd Change directory. cd /path/to/directory pwd Show current directory. pwd mkdir Create a new directory. mkdir new_directory rmdir Remove an empty directory. rmdir empty_directory rm Delete files or directories. rm file.txt touch Create an empty file. touch new_file.txt cp Copy files or directories. cp file.txt /path/to/destination mv Move or rename files. mv file.txt /path/to/new_location cat Display file contents. cat file.txt nano/vim Edit files in terminal. nano file.txt fi...
Comments
Post a Comment