The Linux command line is a powerful and efficient way to interact with your system. This reference guide covers 20 essential commands that provide a solid foundation for navigating and performing basic tasks in Linux.
Så här gör du
Steg 1: List Files and Directories (ls)
Show the contents of the current directory.
lsSteg 2: Change Directory (cd)
Move to a different directory.
cd /path/to/directorySteg 3: Print Working Directory (pwd)
Display the current directory path.
pwdSteg 4: Copy Files (cp)
Copy files from one location to another.
cp source destinationSteg 5: Move or Rename Files (mv)
Move files or rename them.
mv oldname newnameSteg 6: Remove/Delete Files (rm)
Delete files. Be cautious; this action is irreversible.
rm filenameSteg 7: Make Directory (mkdir)
Create a new directory.
mkdir directorynameSteg 8: Remove Directory (rmdir)
Delete an empty directory.
rmdir directorynameSteg 9: Concatenate and Display File Content (cat)
Display the entire content of a file.
cat filenameSteg 10: Text Editor (nano)
Open a simple text editor for creating or editing files.
nano filenameSteg 11: Manual Pages (man)
Access the manual pages for a command to learn more about its usage.
man command_nameSteg 12: Process Status (ps)
Display information about running processes.
psSteg 13: Terminate a Process (kill)
Terminate a running process using its process ID (PID).
kill PIDSteg 14: Disk Free (df)
Display information about disk space usage.
df -hSteg 15: Disk Usage (du)
Show the disk usage of files and directories.
du -hSteg 16: Change File Permissions (chmod)
Modify the permissions of a file or directory.
chmod permissions filenameSteg 17: Superuser (sudo)
Execute a command with administrative privileges.
sudo commandSteg 18: Command History (history)
View a list of recently executed commands.
historySteg 19: Search Text (grep)
Search for a specific pattern in a file.
grep pattern filenameSteg 20: Exit the Terminal (exit)
Close the terminal session.
exit
Important: Use caution with commands like rm and sudo, as they can have significant consequences if used incorrectly.