Run basename /srv/www/index.html.
basename /srv/www/index.html
Use basename and dirname as script building blocks.
Shell scriptingbasenamedirnameprintf
Click any instruction for the command details, the why, and the common mistake to avoid.
Run basename /srv/www/index.html.
basename /srv/www/index.html
Run dirname /srv/www/index.html.
dirname /srv/www/index.html
Run printf /srv/www/index.html | xargs basename.
printf /srv/www/index.html | xargs basename
Create a free account to sync completed lessons, XP, streaks, course status, and your next lesson across sessions.
Checking account status...
Progress sync is idle.
Progress sync stores completion IDs, scores, streaks, badges, and game settings. Terminal contents, editor snippets, lab scratch, email, and real names are never published on leaderboards or share cards.
Use basename and dirname as script building blocks.
Run the commands in order and compare the outputs.
Junior operators build confidence by gathering evidence before changing systems.
printf <text>
Print formatted training text.
basename|dirname <path>
Split paths into file and directory parts.