Bash Commands
uname -aنمایش سیستم و کرنل (Show system and kernel)
head -n1 /etc/issueنمایش توزیع (Show distribution)
mountنمایش فایلسیستمهای مانتشده (Show mounted filesystems)
dateنمایش تاریخ سیستم (Show system date)
uptimeنمایش آپتایم (Show uptime)
whoamiنمایش نام کاربری (Show your username)
man commandنمایش راهنمای دستور (Show manual for command)
Bash Shortcuts
CTRL-cتوقف دستور فعلی (Stop current command)
CTRL-zتعلیق برنامه (Sleep program)
CTRL-aبرو به ابتدای خط (Go to start of line)
CTRL-eبرو به انتهای خط (Go to end of line)
CTRL-uبرش از ابتدای خط (Cut from start of line)
CTRL-kبرش تا انتهای خط (Cut to end of line)
CTRL-rجستجو در تاریخچه (Search history)
!!تکرار آخرین دستور (Repeat last command)
!abcاجرای آخرین دستور با شروع abc (Run last command starting with abc)
!abc:pچاپ آخرین دستور با شروع abc (Print last command starting with abc)
!$آخرین آرگومان دستور قبلی (Last argument of previous command)
ALT-.آخرین آرگومان دستور قبلی (Last argument of previous command)
!*تمام آرگومانهای دستور قبلی (All arguments of previous command)
^abc^123اجرای دستور قبلی، جایگزینی abc با 123 (Run previous command, replacing abc with 123)
Bash Variables
envنمایش متغیرهای محیطی (Show environment variables)
echo $NAMEچاپ مقدار متغیر $NAME (Output value of $NAME variable)
export NAME=valueتنظیم $NAME برابر value (Set $NAME to value)
$PATHمسیر جستجوی اجراییها (Executable search path)
$HOMEدایرکتوری خانگی (Home directory)
$SHELLشل فعلی (Current shell)
IO Redirection & Pipes
cmd < fileورودی cmd از فایل (Input of cmd from file)
cmd1 <(cmd2)خروجی cmd2 به عنوان ورودی فایل به cmd1 (Output of cmd2 as file input to cmd1)
cmd > fileخروجی استاندارد (stdout) به فایل (Standard output (stdout) of cmd to file)
cmd > /dev/nullنادیده گرفتن stdout (Discard stdout of cmd)
cmd >> fileافزودن stdout به انتهای فایل (Append stdout to file)
cmd 2> fileخروجی خطا (stderr) به فایل (Error output (stderr) of cmd to file)
cmd >&2هدایت stdout به stderr (stdout to same place as stderr)
cmd 2>&1هدایت stderr به stdout (stderr to same place as stdout)
cmd &> fileتمام خروجیها به فایل (Every output of cmd to file)
cmd1 | cmd2هدایت stdout از cmd1 به cmd2 (stdout of cmd1 to cmd2)
cmd1 |& cmd2هدایت stderr از cmd1 به cmd2 (stderr of cmd1 to cmd2)
cmd1 ; cmd2اجرای cmd1 سپس cmd2 (Run cmd1 then cmd2)
cmd1 && cmd2اجرای cmd2 اگر cmd1 موفق بود (Run cmd2 if cmd1 is successful)
cmd1 || cmd2اجرای cmd2 اگر cmd1 موفق نبود (Run cmd2 if cmd1 is not successful)
{ cmd }اجرای cmd در سابشل (Run cmd in a subshell)
Directory & File Operations
pwdنمایش دایرکتوری فعلی (Show current directory)
mkdir dirساخت دایرکتوری dir (Make directory dir)
cd dirتغییر به دایرکتوری dir (Change directory to dir)
cd ..برو به دایرکتوری بالاتر (Go up a directory)
touch file1ساخت فایل file1 (Create file1)
cat file1 file2چسباندن و نمایش فایلها (Concatenate files and output)
less file1نمایش صفحهبندی شده file1 (View and paginate file1)
file file1دریافت نوع فایل file1 (Get type of file1)
cp file1 file2کپی file1 در file2 (Copy file1 to file2)
mv file1 file2انتقال file1 به file2 (Move file1 to file2)
rm file1حذف file1 (Delete file1)
head file1نمایش ۱۰ خط اول file1 (Show first 10 lines of file1)
tail file1نمایش ۱۰ خط آخر file1 (Show last 10 lines of file1)
tail -f file1نمایش زنده خطوط آخر (Output last lines of file1 as it changes)
ls Options
ls -aنمایش همه (شامل مخفیها) (Show all (including hidden))
ls -Rلیست بازگشتی (Recursive list)
ls -rترتیب معکوس (Reverse order)
ls -tمرتبسازی بر اساس زمان (Sort by last modified)
ls -Sمرتبسازی بر اساس اندازه (Sort by file size)
ls -lفرمت لیست طولانی (Long listing format)
ls -1یک فایل در هر خط (One file per line)
ls -mخروجی با جداکننده کاما (Comma-separated output)
ls -Qخروجی داخل کوتیشن (Quoted output)
Search Files
grep pattern filesجستجوی pattern در files (Search for pattern in files)
grep -iجستجوی بدون حساسیت به حروف (Case insensitive search)
grep -rجستجوی بازگشتی (Recursive search)
grep -vجستجوی معکوس (Inverted search)
grep -oفقط نمایش بخش مچشده (Show matched part of file only)
find /dir/ -name name*پیدا کردن فایل با اسم name* در dir (Find files starting with name in dir)
find /dir/ -user nameپیدا کردن فایلهای کاربر name در dir (Find files owned by name in dir)
find /dir/ -mmin numفایلهای تغییرکرده در num دقیقه اخیر (Find files modifed less than num minutes ago)
whereis commandپیدا کردن binary/source/manual دستور (Find binary / source / manual for command)
locate fileپیدا کردن فایل (جستجوی سریع ایندکس) (Find file (quick search of system index))
Process Management
psنمایش اسنپشات پراسسها (Show snapshot of processes)
topنمایش زنده پراسسها (Show real time processes)
kill pidکشتن پراسس با ID (Kill process with id pid)
pkill nameکشتن پراسس با نام (Kill process with name name)
killall nameکشتن تمام پراسسها با نام (Kill all processes with names beginning name)
Nano & Screen Shortcuts
Nano
Ctrl-Rخواندن فایل (Read file)
Ctrl-Oذخیره فایل (Save file)
Ctrl-Xبستن فایل (Close file)
ALT-Aشروع انتخاب متن (Start marking text)
CTRL-Kبرش متن یا خط (Cut marked text or line)
CTRL-Uچسباندن متن (Paste text)
ALT-/انتهای فایل (End of file)
CTRL-Aابتدای خط (Beginning of line)
CTRL-Eانتهای خط (End of line)
CTRL-Cنمایش شماره خط (Show line number)
CTRL-_برو به خط (Go to line number)
CTRL-Wجستجو (Find)
ALT-Wپیدا کردن بعدی (Find next)
CTRL-\جستجو و جایگزینی (Search and replace)
Screen
screenشروع session جدید (Start a screen session.)
screen -rاتصال مجدد به session (Resume a screen session.)
screen -listنمایش session های فعلی (Show your current screen sessions.)
CTRL-A cساخت ترمینال جدید (Create a new terminal.)
CTRL-A nرفتن به ترمینال بعدی (Go to the next terminal.)
CTRL-A pرفتن به ترمینال قبلی (Go to the previous terminal.)
CTRL-A "نمایش لیست ترمینالها (Show current terminals.)
CTRL-A Aتغییر نام ترمینال فعلی (Rename the current instance.)
File Permissions
4خواندن (read (r))
2نوشتن (write (w))
1اجرا (execute (x))
chmod 644 fileتغییر دسترسی به rw-r--r-- (Change mode to rw-r--r--)
chmod -R 750 folderتغییر دسترسی بازگشتی به rwxr-x--- (Recursively chmod to rwxr-x---)
chown usr:grp fileتغییر مالک (usr) و گروه (grp) (Change owner to usr, group to grp)