Here are some commonly used terminal commands that can help you navigate and manage your system effectively:
Basic Commands
-
pwd: Prints the current working directory. It shows you where you are in the filesystem.pwd -
ls: Lists the files and directories in the current directory.ls -
cd: Changes the current directory. You can navigate to different directories using this command.cd /path/to/directory -
mkdir: Creates a new directory.mkdir new_directory -
rm: Removes files or directories. Use with caution, especially with the-roption for recursive deletion.rm file.txt rm -r directory_name
File Management
-
cp: Copies files or directories.cp source.txt destination.txt -
mv: Moves or renames files or directories.mv old_name.txt new_name.txt -
cat: Displays the contents of a file.cat file.txt -
nanoorvim: Opens a text editor in the terminal for editing files.nano file.txt vim file.txt
System Monitoring
-
top: Displays real-time system processes and resource usage.top -
htop: An enhanced version oftopwith a more user-friendly interface (requires installation).htop -
df: Shows disk space usage for all mounted filesystems.df -h -
free: Displays memory usage statistics.free -h
Networking
-
ping: Tests connectivity to a host.ping example.com -
curl: Transfers data from or to a server, often used for testing APIs.curl http://example.com
Package Management (Debian-based systems)
-
apt update: Updates the list of available packages.sudo apt update -
apt install: Installs a package.sudo apt install package_name
These commands form the foundation of terminal usage and can significantly enhance your productivity when working in a Linux environment. If you have any specific commands you want to learn more about, feel free to ask!
