Posted in

Wildcards Practice and Soft & Hard Links

Wildcards PracticeCreate test files with different extensions:

touch file1.txt file2.txt file3.log file4.log test1.txt test2.log

Use wildcard * to filter files:

ls *.txt

ls *.log

Use wildcard ? to match a single character:

ls file?.txt

Use character range [1-2]:

ls file[1-2].txt

Delete files using wildcard:

rm *.log

Take screenshots before and after deletion.


Soft & Hard Links

Create original file and check inode:

echo “Linux Practice” > original.txt

ls -li original.txt

Create hard link:

ln original.txt hardlink.txt

ls -li original.txt hardlink.txt

Create soft link:

ln -s original.txt softlink.txt

ls -li original.txt hardlink.txt softlink.txt

Delete original file and observe behavior:

rm original.txt

ls -li

Verify using cat command:

cat hardlink.txt

cat softlink.txt

Take screenshots showing inode comparison and link behavior.


Leave a Reply

Your email address will not be published. Required fields are marked *