[kwlug-disc] Switching Jobs from Debian Shop to RHEL?

CrankyOldBugger crankyoldbugger at gmail.com
Tue Jul 15 13:28:48 EDT 2014


I'm sure everybody knows this one, but when I forget to put "sudo" at the
start of a command, and that command subsequently fails, I just type

sudo !!

instead of re-typing the entire command.  I use this simple trick a lot.



On 15 July 2014 13:00, Joe Wennechuk <youcanreachmehere at hotmail.com> wrote:

> Yes.. I love this little bit here. Thank you very much for it. I Have
> begun to use it regularly. Very Nice.
>
> I love these little tips, and tricks. Does anyone else have any neat
> tricks they use to make life easier? Does anyone know any more such magical
> expressions?
>
> ------------------------------
> From: timdaman at gmail.com
> Date: Sun, 13 Jul 2014 18:50:29 -0400
> To: kwlug-disc at kwlug.org
> Subject: Re: [kwlug-disc] Switching Jobs from Debian Shop to RHEL?
>
> To add to William's hint...
>
> You will find yourself editing something at some point and suddenly
> realize, when saving, your don't have permissions to edit it. Normally one
> will end up writing to /tmp, quitting, sudoing to root (sudo -i), catting
> the /tmp file over the original, and dropping privileges again.
>
> There is a better way
>    :w !sudo tee %
>
> :w: Write a file (in vi speak)
> !: specify that a pipe should be used to write the file
> sudo: Become root
> tee: take standard input and copy it to a file
> %: expands to the current file open in the buffer (vi function)
>
> I am embarrassed to say how often I use this trick.
> --Tim
>
> --Tim
>
>
> On Sun, Jul 13, 2014 at 5:14 PM, William Park <opengeometry at yahoo.ca>
> wrote:
>
> On Sun, Jul 13, 2014 at 01:59:45PM -0400, Chris Craig wrote:
> > On 13 July 2014 12:52, William Park <opengeometry at yahoo.ca> wrote:
> >
> > > Hands-on is the best way.  It won't take long, if you already know one
> > > Linux.  Most of "issues" you'll face will be how it interacts with
> other
> > > machines.  And, that's something you can't learn in isolation.
> >
> > I've used Debian/Ubuntu at work for the last three jobs I've had, but
> > still use Slackware at home. Well I did use Slackware for the first of
> > the three but there were some issues with cross compiling so switched
> > to Debian. I played around with Red Hat as my first Linux distro but
> > ultimately didn't like it too much - that was over 10 years ago
> > though. The most trouble I had was with dependency resolution. I'd
> > rather solve dependencies manually with Slackware than try to get rpm
> > to recognize that they're resolved, or not as the case may be.
> >
> > There are things I tolerate at work that I wouldn't at home, but
> > they're different use cases. Unity is too flaky and I never liked
> > their unified application menu or task switcher, but there are limited
> > applications that I use so it's not too bad. At home I wouldn't find
> > it usable.
> >
> > One of the major differences you might find is if you're dependent on
> > "sudo" for a lot of things, it's not used so much outside of Ubuntu. I
> > use sudo at work and not really at home. I've found that Red Hat
> > doesn't upgrade well.
> >
> > You might find this interesting, Joe:
> > http://unix.stackexchange.com/questions/57849
>
> A fellow Slackware users... howdy. :-)
>
> Here's some thought on "sudo" off top of my head (in case you don't get
> straight root access):
>     - sudo -i
>     - sudo -e   --> edit file
>     - visudo    --> edit /etc/sudoers.  I add "NOPASSWD:" to avoid
>       typing password.
>     - vipw [-s]
>     - vigr [-s]
> --
> William
>
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
>
>
> _______________________________________________ kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140715/501a7e6f/attachment.htm>


More information about the kwlug-disc mailing list