• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/35

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

35 Cards in this Set

  • Front
  • Back

CatLess فایل

نمایش محتوای یک فایل بصورت صفحه صفحه more


نمایش محتوای یک فایل بصورت صفحه صفحه less و از more کاربردیتره چون بالا و پاین میره و جستجو داره و فانکشهای vi رو داره


head و tail نمایش ابتدا و انتهای فایل


cat read files sequentially and write to standard output


dmesg

Driver message


Print Message buffer of kernel


و حاوی اطلاعات device driver هاست


dmesg | grep tty


لیست driver های سریال

ps(Process status) و top(Table of processes)

Process status


ps -a


همه پراسسهای در حال اجرا رو میاره. اگر x اضافه بشه پراسسهایی که مال tty ما نیستند رو هم نشون میده. پس خوشکلش اینه برای نمایش همه پراسسها


ps -aux


ps - p 1241


پراسس در حال اجرا با شماره 1241 رو میاره


ps - p $$


پراسس آیدی شل رو میاره


top is task manager of linux(table of processes)

Shell and terminal(terminam Emlator)

Shell=Command Line interpretter and processing commands


Terminal=text input/output environment


Shell in ubuntu is bash


Terminal. In Ubuntu is GNOME Terminal

Catless nanovi

Nanovi editor


Catless همونجا نشون میده

whoami, passwd

whoami=>Return who you are


passwd=> change password

echo output string

Output strings to standard output or file

Catless nanovi echo output strings

S

مشخصات سیستم. و یوزر و...

uname


whoami مشخصات یوزر


passwd تغییر پسورد

pwd

Print Working Directory

mv

در یک فولدر کار rename انجام می‌دهد

mkdir

cp, rm, mv


touch create a new empty file

man

Man Display the user manual of any commands

Shelesh bashe

Shelesh bashe

همه دستورات با مثال

ss64.com

Parent and current directory

.. Parent directory


. Current directory


Masalan vaghty migim


less ./a.txt


یعنی a ای که تو همین دایرکتوری هست رو اجرا کن

|, >, >>, <

| output of one program to another


ls | grep amir



> Outut to file


ls > out.txt



>> append the output to file


ls >> existedoutput.txt

Shell default ubuntu

Bash hast. Vali. Mituni sh bezani o ba sh kar koni bejaye bash

Processes

ps نمایش پروسسها


Top مثل task manager


kill pid


Kill کردن یک پروسس id


***htop عالیه***


هم پروسسها رو خوشکل میبنی هم میتونی kill کنی راحت

htop

عالیه برای پروسسها

ls 1> stdout.txt 2> stderr.txt


cat 0< stdout.txt


(ya hamun cat stdout.txt


Ya cat < stdout.txt


)

0 stdin


1 stdout


2 stderr



ls > stdout.txt


فقط stdout رو میریزه

فولدر etc

برای configuration files استفاده میشه

فولدر tmp

برای ایجاد فایلهای tmp برای همه کاربران

touch newfile


echo "matn" > newfile


cat > largefile

Create an empty file


Echo ba mohtava


Cat یک خوبی داره متن باز میشه و میتونی کلی توش بنویسی و بعد ctrl+c بزنی


و ذخیره بشه. بدرد متن طولانی میخوره

tail -f logFile

بطور زنده میتونی ته لاگ یک برنامه رو میتونی ببینی راحت باهاش

Find in files and directories

find / -name "*.txt"

xargs command [intial args]

کامند رو با intial args و stdinput اجرا میکنه. مثال


find -name ".txt" | xargs cat


خروجی find یه سری اسم فایل هست که بعنوان stdin دستور xargs آرگومان دستور cat قرار میگیرند و محتواهاشون نشون داده میشه


fins -name "*.txt" | xargs rm


تمام فایلهای txt رو پاک میکنه

هرجا pattern دیدی مثل


grep pattern


find -name pattern

بهترین حالت


"pattern"


اگه کارکتر خاص هم داشتی


\-


* بمعنای هرچیزی

Ip address

Ifconfig


hostname -i

Tar


cz o cj, x

tar -czvf name.tar.gz /tmp


//compress with gzip



tar -cjvf name.tar.bz2 /tmp


//compress with bzip2



tar -xvf name.tar.*


//extraxt both gzip or bzip2(auto detect)



**چون f ورودی داره اگه چیزی بعد f بذاری به کخ میره یعنی


-cvfz


خطا میده. f باید آخری باشه

User

adduser amir//


passwd amir//change password


su amir//login as amir

User

adduser amir//


passwd amir//change password


su amir//login as amir

تغییر owner فایل

chown amir:amir filename

Find os and architecture

Os specification and version


cat /etc/os-release



Architecture


uname -i

Back tick ya backslash

Enter multiline commamd i powershell or linux terminal