Multiple choice technology operating systems

What are the ways to get the filename from the absolute path in a variable Mypath=/my/path/file

  1. filename=basename Mypath

  2. filename =file Mypath

  3. filename = ${Mypath#/*/*/}
  4. echo \$Mypath | awk ‘ FS=”/” { print \$4 } ‘
Reveal answer Fill a bubble to check yourself
A,C,D Correct answer
Explanation

Multiple valid methods exist: basename command directly extracts filename, parameter expansion ${Mypath##*/} removes path prefix, or awk splits by '/' to get the last field. The 'file' command shows file type, not filename.