24 ms·
Run Commands, the 'rc' in '.bashrc'
- 7ewis 7y ago>run commands In case you didn't want to click the link.
- nkkollaw 7y agoSaved my life.
- HALtheWise 7y agoI know that it's a figure of speech, but I'm amused by trying to imagine circumstances where needing to click a HN link could be a life threatening situation.
- nkkollaw 7y agoWell, maybe "saved me a click", then. :-)
- johnisgood 7y agoHovering over the link would have saved you a click, too. :P
- knicholes 7y agoHave you ever seen the movie "Swordfish"?
- benj111 7y agoWell hypothetically each mouse button has a certain finite number of clicks in it before it breaks. It could be in the future you'd need to click to send some crucial evidence to stop you getting sentenced to death. It could be that this saved click is the difference between the mouse failing or not on that occasion. Of course the parent clicked send on their comment undoing the OPs good work. This is all astoundingly improbable, but people buy lottery tickets each week.
- joevandyk 7y agoThat’s why I buy a new mouse after every 10 clicks. It’s pretty rare for them to fail on the 11th click.
- NullPrefix 7y ago>Well hypothetically each mouse button has a certain finite number of clicks in it before it breaks. Omron switches (most commonly used) are rated from 1M to 20M clicks. >It could be in the future you'd need to click to send some crucial evidence to stop you getting sentenced to death. It could be that this saved click is the difference between the mouse failing or not on that occasion. Double click is the most common failure mode. When clicking, the switch hesitates back and forth resulting in two mouse click events generated. This could turn "drag and drop" into "launch program". Will leave the rest for your imagination.
- alluro2 7y ago"And thus The Last War begun and ended, in a fiery blaze of thermonuclear detonations, initiated by a faulty $10 mouse, whose left switch has far surpassed its expected rating, before failing at a critical probability junction, along with whole of humanity."
- eesmith 7y agoOr read/decode the link URL, ending "wiki/Run_commands".
- agumonkey 7y agoreminiscent of runcom (Louis Pouzin alpha shell)
- frereubu 7y agoThere's a little bit of history in there too though, which I appreciated. The fact that the title of the linked article on Wikipedia is "Run Commands" could make the HN title seem clickbaity, but I would never have clicked on something that just said "Run Commands", and now I know something new.
- phillco 7y agoWikipedia could also be safely considered as "not a clickbait site".
- raverbashing 7y agoYes but without the context it's a bit hard to know what's it talking about
- spodek 7y agoOh yeah? This Wikipedia page is pure clickbait: https://en.wikipedia.org/wiki/Clickbait https://en.wikipedia.org/wiki/Clickbait
- cerberusss 7y agoComes with a pretty amazing example as well: "7 Clickbait Advertisements You Won't Believe".
- escapecharacter 7y agoYeah but just look at this article title! https://en.wikipedia.org/wiki/List_of_unsolved_deaths https://en.wikipedia.org/wiki/List_of_unsolved_deaths The purple prose!
- LordDragonfang 7y agoMeaning the prose is literally purple, because you've obsessively clicked all the links?
- 7y ago
- satyanash 7y agoI always thought it was 'runtime configuration'.. as opposed to compile-time configuration.
- airstrike 7y agoI always thought of it as "remote controlled" even though it makes absolutely zero sense
- aidos 7y agoMore interestingly, I only recently learned that you can add a ~/.ssh/rc to run commands on every ssh login. Are there other common useful rc locations people are aware of?
- periya 7y agoWhoa! Thanks for that tip, that’s an incredibly useful tip.
- boobePhuu7iet7i 7y agoDo you add that on your system, and it executes the commands on all the servers you connect to? Or do you add it to the server and they only run when you login to that server?
- OrgNet 7y agoLooks like it executes the commands only on the server where ~/.ssh/rc or /etc/ssh/sshrc exists. > ~/.ssh/rc > Commands in this file are executed by ssh when the user logs in, just before the user's shell (or command) is started. See the sshd(8) manual page for more information.
- aidos 7y agoYou add it to the remote system. I use it for updating a symlink in a known location to point to SSH_AUTH_SOCK. I then get tmux sessions set up to look in that location. Effectively, each time I ssh in, I fix all the ssh forwarding in active sessions (this is on local dev vagrant machines).
- jeremyjh 7y agoCan anyone give an example of a command I'd want to run on every .ssh login, but not put into my .zshrc/.bashrc on that machine?
- syncsynchalt 7y agoAs an example: I'd love to run `set -o vi` on every ec2-user login, but the machines tend to be ephemeral and this command might not be wanted by other users, so I don't add it to /etc/profile or /etc/bashrc.
- spraak 7y agoSomehow I interpreted and pronounced it as [r]esour[c]e
- weinzierl 7y agoSo 'run commands' is the historically correct interpretation. For me, I've heard it explained as 'run configuration' many years ago and that is the explanation that stuck because rc is in essence used for config files no matter if they run commands or not. Others have found different expansions, which are probably equally obvious for them. The ones I stumbled upon by a quick search [1,2,3,4]: run commands run control run configuration runtime configuration resource control Maybe there are more. [1] https://unix.stackexchange.com/questions/3467/what-does-rc-in-bashrc-stand-for/3469#3469 https://unix.stackexchange.com/questions/3467/what-does-rc-i... [2] https://superuser.com/questions/144339/vimrc-screenrc-bashrc-kshrc-etc-what-does-the-rc-mean https://superuser.com/questions/144339/vimrc-screenrc-bashrc... [3] https://askubuntu.com/questions/23482/what-does-rc-in-bashrc-nanorc-stand-for https://askubuntu.com/questions/23482/what-does-rc-in-bashrc... [4] http://www.catb.org/~esr/writings/taoup/html/ch10s03.html http://www.catb.org/~esr/writings/taoup/html/ch10s03.html
- Sharlin 7y agoCertainly the other expansions are backronyms, invented by people wondering what the "rc" stands for.
- jasoneckert 7y agoDitto here - I've heard it referred to as runtime configuration for decades (even when I worked at SUN writing drivers and interfaces for SunOS 4 and 5).
- gingabriska 7y agoI used to think bash RC is for Remote Control. RC files were remote control files for m. I am pretty sure, I can't be the only one who asssumed that.
- Sebb767 7y agoWould be my first association as well, from things like RC cars and RC planes. Doesn't really make sense in this context, though (but run commands sounds a little bit of as well; something like configuration commands would've sounded better in my opinion).
- benj111 7y agoI like how it was termed a fossil when it was added to Unix. Now we seem to be flooded with them. TTY, terminal, core dump, floppy disk save icon.
- neom 7y agoSpurred me to find out that the ht in .htaccess is Hypertext
- ryanmarsh 7y agoI always thought rc files stood for ResourCe... in hindsight I realize how doumb that was.
- sanlyx 7y agoNot dumb at all; in fact, Win32 resource scripts[1] end with the ".rc" extension [1]: https://docs.microsoft.com/en-us/windows/win32/menurc/about-resource-files https://docs.microsoft.com/en-us/windows/win32/menurc/about-...
- nwellnhof 7y agoThat's probably because they're named after the RC tool which stands for "resource compiler".
- curtis 7y agoOK, now can somebody explain to me the difference between .bashrc and .bash_profile?
- rusk 7y agoformer is runtime bash environment, latter is when you log in with an interactive shell to run commands, and stuff.
- Kwpolska 7y agoExcept Linux terminal emulators tend to launch a non-login shell (where .bash_profile is not read), and at the same time macOS’ Terminal.app prefers login shells.
- joshklein 7y agoProfile is for login shells (thus executed once when logging in at the terminal or over SSH). The rc file is for interactive non-login shells (thus executed once each time you open a new e.g. xterm window). But some systems treat all terminal emulator windows as login shells by default (e.g MacOS), though you can change that behavior.
- yebyen 7y agoInteractive shells can also be login shells, and they run bashrc too (don't they?) Wait... is this the reason why you see profiles that load bashrc?
- deleted 7y ago[deleted]
- ksaj 7y agoMostly running a shell script doesn't necessarily need to have all your aliases included, for one of many possible examples, but it conveniently doesn't really hurt things either. Making one setting the default is a way to promote "sameness" for those who aren't about to go about adapting different use cases. But for "power users," the ability to alter the experience depending on context is there awaiting your specifics.
- m4r35n357 7y agoHmm, I thought it was "run control" . . . ;)
- amelius 7y agoSame here ...
- JasonFruit 7y agoI bet we all read the same Eric Raymond book/article.
- rmwaite 7y agoESR making things up authoritatively on the spot - no way.
- k__ 7y agoRun commands is funny since many modern tools use ...RC files which usually don't include direct commands, but declarative configuration.
- mindfulplay 7y agoI wish Hacker News had a section called Daily Factoids .. this particular article is really interesting but isn't News.
- biztos 7y agoI spent the last 20 years thinking it was for “resource” — and now I can’t even remember why I thought that.
- thope 7y agoI thought that too, for me it's due to Windows resource files having `.rc` extension. how mind works https://docs.microsoft.com/en-us/windows/win32/menurc/about-resource-files https://docs.microsoft.com/en-us/windows/win32/menurc/about-...
- dredmorbius 7y agoESR promulgated that in TAOUP.
- cmroanirgo 7y agoIronically, .bashrc is not mentioned specifically at all in the Wikipedia page, whereas .vimrc is. > It is used for any file that contains startup information for a command.
- cat199 7y agoto note the: rc in Unix mentioned by K&R in the article likely refers to '/etc/rc', which was a shell script run by init in research Unix (and still BSD, but not SysV)
- cat199 7y agosee also: https://www.freebsd.org/cgi/man.cgi?query=init&sektion=8&apropos=0&manpath=Unix+Seventh+Edition for 'then', and: https://www.freebsd.org/cgi/man.cgi?query=rc&sektion=8&apropos=0&manpath=FreeBSD+12.0-RELEASE+and+Ports https://www.freebsd.org/cgi/man.cgi?query=rc&sektion=8&apropos=0&manpath=OpenBSD+6.5 for (some of) 'now'.
- coding123 7y agoWow, the HN title was the click bait and the article was just an article.
- budhajeewa 7y agoInterestingly, in a `readme.md` that I had to write[1] yesterday, I had to refer to this file, and I used the term "rc file". I wondered what "rc" actually meant. It's interesting because I found the answer today on HN. So random and unexpected . Anyway, I wonder whether if I referred to it as the "Run Commands File", would the people recognize what I meant. --- 1. https://github.com/a2way-com/template-docker-laravel/blob/55f95489d359c85370f61ca7d06b0570cd8ffca4/readme.md https://github.com/a2way-com/template-docker-laravel/blob/55...
- loeg 7y agoSame as /etc/rc. (From which are obviously derived: /etc/rc.local, /etc/rc.d, etc.) FreeBSD init(8) still refers to it as "runcom": https://github.com/freebsd/freebsd/blob/90b1841/sbin/init/init.c#L1041-L1054 https://github.com/freebsd/freebsd/blob/90b1841/sbin/init/in... https://github.com/freebsd/freebsd/blob/90b1841/sbin/init/pathnames.h#L42 https://github.com/freebsd/freebsd/blob/90b1841/sbin/init/pa...
- IMMUNISE 7y agoThe history of /usr and /home are pretty amusing too: 'When the operating system grew too big to fit on the first RK05 disk pack (their root filesystem) they let it leak into the second one, which is where all the user home directories lived (which is why the mount was called /usr). They replicated all the OS directories under there (/bin, /sbin, /lib, /tmp...) and wrote files to those new directories because their original disk was out of space. When they got a third disk, they mounted it on /home and relocated all the user directories to there so the OS could consume all the space on both disks and grow to THREE WHOLE MEGABYTES (ooooh!).' - http://lists.busybox.net/pipermail/busybox/2010-December/074114.html http://lists.busybox.net/pipermail/busybox/2010-December/074...
- runn1ng 7y agoI found it funny that random decisions from 60s, 70s, 80s still have repercussions on how we use computers today, because backwards compatibility beats cleanliness every time. Be right back, solving some Windows backslash and CRLF issues.
- jhanschoo 7y agoInterestingly, some distros have undone/are undoing the usr split, fedora around 2012 and Debian still ongoing, see https://wiki.debian.org/UsrMerge https://wiki.debian.org/UsrMerge and its associated links
- segfaultbuserr 7y agoInteresting. So basically, the "rc" in ".bashrc" has a meaning similar to the "EXEC" in "AUTOEXEC.BAT".
- rezeroed 7y agoAre there any distros with no interest in backward compatibility?
- alanbernstein 7y agoI thought it stood for "reconnect", now I can't figure out where I got that idea.
- MisterTea 7y agoInterestingly the Plan 9 shell is called rc, written by Tom Duff (see Duff's Device). This has at times lead to some confusion on my part when working between unix and plan 9. Syntax is similar to bash.