Tuesday, May 7, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 5099  / 3 Years ago, wed, october 27, 2021, 9:25:08

Explaining more on this question. Are commands like ls, cd, rm,... applications if they are than how does the terminal knows where they are, and is the terminal just a interface to interact with the programs, is nothing more than just programs just interacting with each other? Secondly, Is bash the only language that will work in the terminal, if it is just programs just interacting with each other?


More From » command-line

 Answers
7

The terminal can be used to execute programs within a given PATH - you can find it by running echo $PATH in a bash teminal - example output:



/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/wilf/.local/bin:/home/wilf/bin:/usr/games


This is set when the terminal starts - when it using using the BASH shell (default on lots of Linux systems), it checks ~/.bashrc before starting. Then when you run a command, it searches the path for the command, and executes if it finds it.



With my example $PATH above, I can place an executable script in /home/wilf/.local/bin (e.g. extension-update from here), and then be able to run it terminal without specifying the full path to the executable (e.g. /home/wilf/.local/bin/extension-update, /usr/bin/firefox, etc)


[#24654] Thursday, October 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anxietunnel

Total Points: 66
Total Questions: 120
Total Answers: 115

Location: Norway
Member since Sat, Mar 4, 2023
1 Year ago
;