TL
Tool Lab
💰Donate
💰Donate

مرجع أوامر Linux

مرجع سريع لأوامر Linux/Unix الأساسية: إدارة الملفات، معالجة النصوص، العمليات، الشبكات والمزيد.

الملفات والأدلة

ls -laList files with details and hidden files
cd <dir>Change directory
pwdPrint working directory
mkdir -p <dir>Create directory (and parents)
rm -rf <dir>Remove directory recursively (careful!)
cp -r <src> <dest>Copy files/directories recursively
mv <src> <dest>Move or rename file/directory
touch <file>Create empty file or update timestamp
find . -name "*.txt"Find files by name pattern
find . -type f -size +10MFind files larger than 10MB
du -sh *Show disk usage of each item
df -hShow disk space usage

معالجة النصوص

cat <file>Print file contents
less <file>Page through file (q to quit)
head -n 20 <file>Show first 20 lines
tail -n 20 <file>Show last 20 lines
tail -f <file>Follow file (live log viewing)
grep -r "pattern" .Search for pattern recursively
grep -i "pattern" <file>Case-insensitive search
grep -n "pattern" <file>Show line numbers in results
sed -i "s/old/new/g" <file>Replace text in file in-place
awk '{print $1}' <file>Print first column
sort <file>Sort lines alphabetically
sort -n -k2 <file>Sort numerically by 2nd column
uniq -cCount and deduplicate adjacent lines
wc -l <file>Count lines in file
cut -d"," -f1,3 <file>Cut specific columns (CSV)

العمليات

ps auxList all running processes
topInteractive process viewer
htopEnhanced process viewer (if installed)
kill <pid>Terminate process by PID
kill -9 <pid>Force kill process
pkill <name>Kill processes by name
pgrep <name>Find PIDs by process name
nohup <cmd> &Run command immune to hangups, in background
jobsList background jobs
bg %1Resume job 1 in background
fg %1Bring job 1 to foreground

الصلاحيات والملكية

chmod 755 <file>Set rwxr-xr-x permissions
chmod +x <file>Make file executable
chown user:group <file>Change file owner and group
sudo <cmd>Run command as superuser
sudo -iSwitch to root shell
su - <user>Switch to another user
umask 022Set default permission mask

الشبكات

curl -I <url>Show response headers only
curl -L -o file <url>Download file following redirects
wget <url>Download file
ping <host>Test network connectivity
traceroute <host>Trace network path to host
nslookup <domain>DNS lookup
dig <domain>Detailed DNS lookup
netstat -tulnShow listening ports
ss -tulnShow listening ports (modern)
ssh user@hostConnect via SSH
scp <file> user@host:/pathCopy file via SSH
rsync -avz src/ user@host:dest/Sync files efficiently

الأرشيفات والضغط

tar -czf archive.tar.gz <dir>Create gzip compressed archive
tar -xzf archive.tar.gzExtract gzip archive
tar -cjf archive.tar.bz2 <dir>Create bzip2 compressed archive
zip -r archive.zip <dir>Create zip archive
unzip archive.zipExtract zip archive
gzip <file>Compress file with gzip
gunzip <file>.gzDecompress gzip file

معلومات النظام

uname -aSystem and kernel information
cat /etc/os-releaseOS version information
free -hMemory usage
uptimeSystem uptime and load
whoWho is logged in
idCurrent user and group IDs
envShow environment variables
export VAR=valueSet environment variable
which <cmd>Find command path
historyCommand history
man <cmd>Manual page for a command

حول هذه الأداة

يوفر مرجع أوامر Linux مجموعة منتقاة من أوامر Linux/Unix الأساسية مرتبة في سبع فئات: إدارة الملفات والأدلة، معالجة النصوص، التحكم بالعمليات، الصلاحيات والملكية، الشبكات، الأرشيفات والضغط، ومعلومات النظام.

يتضمن كل أمر مثالًا من الاستخدام الفعلي ووصفًا موجزًا. استخدم مربع البحث للتصفية السريعة حسب اسم الأمر أو الكلمة المفتاحية في الوصف.

كيفية الاستخدام

  1. اكتب اسم أمر أو كلمة مفتاحية في مربع البحث.
  2. مرر عبر الفئات لاستعراض الأوامر.
  3. راجع الأمر ووصفه، ثم استخدمه في طرفيتك.
  4. استبدل العناصر النائبة بين الأقواس الزاوية (<dir>, <file>, إلخ) بقيم فعلية.

حالات الاستخدام

مهندسو DevOps الذين يكتبون نصوص النشر، ومسؤولو النظام الذين يصحّحون مشكلات الخوادم، والمطورون الذين يتحققون من صلاحيات الملفات أو العمليات، والمبتدئون الذين يتعلمون أساسيات سطر أوامر Linux.

الأسئلة الشائعة

  • ماذا تعني الأقواس الزاوية (<>)؟ الأقواس الزاوية هي عناصر نائبة. استبدل <dir> بمسار دليل فعلي، و<file> باسم ملف، و<pid> بمعرّف عملية، وهكذا.
  • ماذا أفعل إذا لم يُعثر على الأمر؟ بعض الأوامر مثل htop غير مثبّتة افتراضيًا. ثبّتها عبر مدير الحزم (مثل sudo apt install htop) أو تحقق من توفرها باستخدام أمر man.
  • ما الاحتياطات الواجب اتخاذها عند استخدام sudo؟ يُشغّل sudo الأوامر بصلاحيات المستخدم الجذر. الأوامر المدمّرة مثل rm -rf مع sudo قد تتسبب في فقدان لا يمكن استعادته للبيانات. تحقق دائمًا قبل التنفيذ.