Skip to content

Latest commit

 

History

History
147 lines (114 loc) · 3.09 KB

File metadata and controls

147 lines (114 loc) · 3.09 KB

בדיקות לטרמינל - מטלת הגשה במערכות הפעלה

קובץ זה מרכז תרחיש בדיקה מלא לטרמינל שפיתחתם במסגרת המטלה.
המטרה היא לבדוק שהפקודות שיישמתם פועלות בצורה תקינה בכל המצבים, כולל רווחים בשמות קבצים, רווחים לפני ואחרי הפקודה, תווים מיוחדים וכדומה.


📂 שלב ראשון: בדיקות פקודות בסיסיות

בדיקות תצוגה

ls
ls -l
       ls              # רווחים לפני ואחרי
pwd
whoami

📝 שלב שני: יצירת קבצים ותיקיות לבדיקה

echo "Hello, this is a test file." > file1.txt
read file1.txt
echo "Another file with different content." > "file2 .txt"
read file2 .txt
mkdir test_dir
echo "This is a file inside a directory." > test_dir/file3.txt
read test_dir/file3.txt

📄 שלב שלישי: בדיקות לפקודת cp

cp file1.txt file1_copy.txt
read file1_copy.txt
cp "file1.txt" "file1 copy.txt"
read "file1 copy.txt"
cp file2.txt test_dir/
read file2.txt test_dir/
mkdir "test dir"
cp file2.txt "test dir/"
ls -l

📁 שלב רביעי: בדיקות לפקודת cd

cd test_dir
pwd
cd ..
pwd
cd "test dir"
pwd

🔚 שלב חמישי: בדיקות לפקודת exit

exit
       exit          # רווחים לפני ואחרי

⚠️ שים לב: exit אמור לסגור את הטרמינל, לכן יש להפעיל מחדש את הטרמינל לאחר בדיקה זו.


🗑️ שלב שישי: בדיקות לפקודת delete

delete file1_copy.txt
delete "file1 copy.txt"
delete test_dir/file3.txt
ls -l

🚚 שלב שביעי: בדיקות לפקודת mv

mv file2.txt file2_mvd.txt
mv "file2_mvd.txt" test_dir/
ls -l
ls test_dir

✍️ שלב שמיני: בדיקות לפקודת echoppend

echo "Appended text line." >> file1.txt
cat file1.txt

✏️ שלב תשיעי: בדיקות לפקודת echowrite

echo "Overwriting file content." > file1.txt
cat file1.txt

📖 שלב עשירי: בדיקות לפקודת read

read file1.txt
read "file that does not exist.txt"

🔢 שלב אחד-עשר: בדיקות לפקודת wc

wc -w file1.txt
wc -l file1.txt
wc -w "file that does not exist.txt"

🔗 שלב שניים-עשר: בדיקות לפקודת mypipe

ls -l | wc -l
cat file1.txt | wc -w

🧹 שלב אחרון: ניקוי סביבת העבודה (אופציונלי)

delete file1.txt
delete test_dir/file2_mvd.txt
delete test_dir

⚠️ הערות חשובות

  • יש לבדוק כל פקודה גם עם רווחים לפני ואחרי.
  • יש לבדוק פקודות עם שמות קבצים המכילים רווחים.
  • מומלץ להריץ את כל הרצף הזה מתחילתו ועד סופו לאחר כל שינוי שביצעתם בקוד.

בהצלחה! 💪