Linux Commands Flashcards
ls
Lists files and directories in the current directory.
cd
Changes the current directory (e.g., cd /home/user).
pwd
Prints the current working directory path.
mkdir
Creates a new directory (e.g., mkdir new_folder).
rmdir
Deletes an empty directory.
rm
Deletes files or directories (use rm -r for directories).
cp
Copies files or directories (e.g., cp file.txt /backup/).
mv
Moves or renames files and directories.
touch
Creates an empty file or updates the timestamp of an existing file.
cat
Displays the contents of a file.
nano
Opens a simple text editor in the terminal.
vi or vim
Opens the vi or vim text editor for editing files.
man
Displays the manual page for a command (e.g., man ls).
echo
Prints text to the terminal or redirects it to a file (e.g., echo “Hello” > file.txt).
grep
Searches for a specific pattern in files (e.g., grep “error” log.txt).