From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Bash functions for frequent tasks

Bash functions for frequent tasks - Linux Tutorial

From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Start my 1-month free trial

Bash functions for frequent tasks

- [Presenter] If we do the same task often we can add it to a shell startup script as a shortcut, so it is available when the shell opens. These shortcuts can be in the form of a shell function or Command alias. Let's talk about shell functions. Note that the order of execution in bash is first bash aliases. And then bash functions followed by bash built-in commands that are built into the bash shell. And lastly, the commands that reside on the disk. If we type in a command without providing a path to it, the shell will search for it in the directories listed in the path variable. If you want to force a certain command to run, provide the relative path or the absolute path on the command line. For bash functions and aliases, it's important to know which files to add them to. There are many different shell startup scripts that get executed depending on how the shell we're using was started. The shell could be an…

Contents