Basic Linux commands Flashcards
What does ‘pwd’ stand for in command line operations?
Print working directory (current location)
‘pwd’ is a command used to display the current directory path in the terminal.
What is the purpose of the ‘ls’ command?
List directory contents
‘ls’ is used to view files and directories within the current working directory.
What does the ‘ls -l’ command do?
Long listing format (includes permissions, owner, size, etc.)
This command provides detailed information about files and directories.
What is the function of ‘ls -a’?
Show hidden files
‘ls -a’ lists all files, including those that are hidden (starting with a dot).
What command is used to change the current directory?
cd <directory></directory>
‘cd’ stands for change directory and allows navigation to specified directories.
What does ‘cd ..’ do?
Move up one directory level
This command takes the user to the parent directory of the current directory.
What is the purpose of ‘cd -‘?
Switch to the previous directory
‘cd -‘ allows the user to return to the last directory they were in.
How do you create a new directory in command line?
mkdir <directory></directory>
‘mkdir’ stands for make directory and is used to create a new directory.
What command would you use to remove a file?
rm <file></file>
‘rm’ is the command for removing files from the filesystem.
What does ‘rm -r <directory>' accomplish?</directory>
Remove a directory and its contents
The ‘-r’ flag stands for recursive, allowing the removal of directories and all files within.