Skip to main content

Linux

	•	ls
Lists files and directories in the current directory.
• cd <directory>
Changes the current working directory.
• pwd
Prints the full path of the current working directory.
• cp <source> <destination>
Copies files or directories.
• mv <source> <destination>
Moves or renames files or directories.
• rm <file>
Removes a file.
• rm -r <directory>
Recursively removes a directory and its contents.
• mkdir <directory>
Creates a new directory.
• rmdir <directory>
Removes an empty directory.
• cat <file>
Displays the contents of a file.
• less <file>
Views file contents one page at a time.
• grep <pattern> <file>
Searches for a pattern within a file.
• find <directory> -name "<pattern>"
Searches for files by name starting from a specified directory.
• ps
Lists currently running processes.
• top
Displays real-time information about running processes.
• kill <pid>
Terminates a process by its process ID (PID).
• sudo <command>
Executes a command with superuser (root) privileges.
• systemctl status <service>
Shows the status of a systemd-managed service.
• systemctl start/stop/restart <service>
Starts, stops, or restarts a systemd service.
• apt-get update
Updates the package index.
• apt-get upgrade
Upgrades installed packages to their latest versions.
• apt-get install <package>
Installs a package using the APT package manager.
• nano <file> or vi <file>
Opens a file in a text editor (Nano or Vim).