Where to find usr/bin/etc. in finder

Joined
Jan 2, 2013
Messages
13
Reaction score
0
Points
1
I just bought a new mac and am trying to move my Perl programs to it.

The terminal tells me that perl is installed to user/bin/perl

But how do I move my Perl programs to this directory? It's unclear how to get to this directory in the finder.

If anyone can help, I'd really appreciate it. Thanks!
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,771
Reaction score
2,111
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
"/usr/bin" should be reserved for System programs, you shouldn't be installing your personal programs in there. Keep your programs with your home directory and use the command "#!/usr/bin/perl" to invoke it from your program..
 
OP
U
Joined
Jan 2, 2013
Messages
13
Reaction score
0
Points
1
rzr, thanks very much. (In the meantime, I managed to find the "Go" command, but you have a good point.) By "home," are you referring to the documents directory?

Also, what's the filepath to the documents directory?

Thanks very much
 
OP
U
Joined
Jan 2, 2013
Messages
13
Reaction score
0
Points
1
Also, if I did as you instructed above, where would Perl save my output files? There is no native "Perl" directory in /user/bin.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Perl is an interpreter - for your programs. So you just invoke it from command line.

#!/usr/bin/perl

belongs at the top of your perl program as the very first line. This line says what to call to interpret the code. So if it is a shell script it would have something like

$!/bin/sh

Then you have to make your file executable to run it. Or you can just invoke perl on your file.
perl myfile.perl

You don't have to move your perl files anywhere - just execute them with perl.

Home is /Users/<your user name>
All personal files and pretty much everything you work on should reside in a directory inside your home directory. You can get to your home directory in terminal by typing
cd ~
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,771
Reaction score
2,111
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
By "home" I'm referring to the "/Users/<your username>" folder. This will contain other folder like Documents, Movies, Pictures, Downloads, Applications and so on. All of these folders and their content belong to your account only..
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Also, if I did as you instructed above, where would Perl save my output files? There is no native "Perl" directory in /user/bin.
The Perl scripts will save output wherever they are designed to do so. You'll have to consult the developers for this one.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
The Perl scripts will save output wherever they are designed to do so. You'll have to consult the developers for this one.

If its not specified, it'll generally be in the directory you are in when you run the script.

I hate typing on the iPad.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
I hate typing on the iPad.

Have you tried the dictation function? I actually like using that - but you can't use it in libraries and it is weird talking so formally.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Have you tried the dictation function? I actually like using that - but you can't use it in libraries and it is weird talking so formally.

No, if I do that... I can't use it for work.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
If its not specified, it'll generally be in the directory you are in when you run the script.
Absolutely which will cause problems if the individual puts the script in /usr/bin.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Absolutely which will cause problems if the individual puts the script in /usr/bin.

Aye - then it becomes visible to everyone as an executable. This is actually how some Trojans work - they try to install themselves into known $PATH locations - so that everyone can run them. Imagine replacing the command 'ls' with something harmful. Generally a good idea not to install or put anything into /usr/bin /sbin /bin (there are others too) unless you know why you are doing it.
 
OP
U
Joined
Jan 2, 2013
Messages
13
Reaction score
0
Points
1
Thanks again for your help. I am the developer, and on the PC, the output files were indeed saved in the folder I was in when running the script. I wasn't sure if it was the same story here.
I prefer to have my Perl scripts in the same folder as the output, which is why I saved all of them in a

So one more question: How does one access /usr/bin from the finder? I know you can get to it using the "Go" command, but is there another way? I'm asking because I'd like to open up a .csv output file using Excel.

Thanks again.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I think you need to rethink your understanding of that directory. You shouldn't be interacting with it directly. If you've put files there, remove them. Instead, think about putting your scripts elsewhere and add that path to your PATH.
 
Joined
May 19, 2009
Messages
8,428
Reaction score
295
Points
83
Location
Waiting for a mate . . .
Your Mac's Specs
21" iMac 2.9Ghz 16GB RAM - 10.11.3, iPhone6s & iPad Air 2 - iOS 9.2.1, ATV 4Th Gen tvOS, ATV3
So one more question: How does one access /usr/bin from the finder? I know you can get to it using the "Go" command, but is there another way? .

Finder Shift>Command>G type /usr/bin and when the window shows up with it, and if you use this quite a bit, the bin Folder at the top of the window, click and drag it into Finder Sidebar and then its at your disposale in 1 click
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,771
Reaction score
2,111
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Thanks again for your help. I am the developer, and on the PC, the output files were indeed saved in the folder I was in when running the script. I wasn't sure if it was the same story here.
I prefer to have my Perl scripts in the same folder as the output, which is why I saved all of them in a

So one more question: How does one access /usr/bin from the finder? I know you can get to it using the "Go" command, but is there another way? I'm asking because I'd like to open up a .csv output file using Excel.

Thanks again.

This is akin you putting all of your files in the /Windows/System32 directory. You know you wouldn't do that if you are a developer..so don't look to put anything in the /usr/bin folder..
 
OP
U
Joined
Jan 2, 2013
Messages
13
Reaction score
0
Points
1
This is akin you putting all of your files in the /Windows/System32 directory. You know you wouldn't do that if you are a developer..so don't look to put anything in the /usr/bin folder..

I'm not a developer, but an academic who happens to program in Perl. However, I do understand that it's not ideal to store files there. I originally did so because I needed to to know the path to the directory where your input files live. In Windows, you can easily find that for any given file. Here, it took some trial and error to find (though it's simple in hindsight).

The core issue was that I didn't know the filepath into the Documents sub-folder, which is why I stored it in usr/bin. I've now figured out the filepath (Documents/[whatever],) so I've moved the Perl folder out of usr/bin.

In any case, thanks for the help, Razor.
 
OP
U
Joined
Jan 2, 2013
Messages
13
Reaction score
0
Points
1
Finder Shift>Command>G type /usr/bin and when the window shows up with it, and if you use this quite a bit, the bin Folder at the top of the window, click and drag it into Finder Sidebar and then its at your disposale in 1 click

Thank you, Tattooed!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top