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).
find
Searches for files and directories based on conditions.
chmod
Changes file permissions (e.g., chmod 755 file.sh).
chown
Changes file ownership (e.g., chown user:group file.txt).
df
Displays disk space usage of file systems.
du
Shows disk usage of files and directories.
ps
Displays information about running processes.
sudo
Runs commands with elevated privileges.
ssh
Connects to a remote server securely.
ifconfig
Configures network interfaces (deprecated, replaced by ip).
ip
Displays or modifies IP address and network configurations.
ping
Tests connectivity to a remote host by sending ICMP packets.
traceroute
Traces the route packets take to reach a destination.
hostname
Shows or sets the system hostname.
shutdown
Shuts down or restarts the system (e.g., shutdown -h now).