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

Chris Craig kwlug.org at ciotog.net
Thu Jul 17 14:05:38 EDT 2014


I use {,} all the time to save typing. Eg
diff /etc/hosts{.new,}
for when doing an upgrade, and .new files are provided. Then if I'm
happy with the .new, run:
mv !*
Otherwise:
rm !:1

On 17 July 2014 10:50, Andrew Mercer <andrew at andrewmercer.net> wrote:
> Joe, have you found this site yet?
>
> http://www.commandlinefu.com/commands/browse
>
> A lot of good stuff there if you can figure out the context lol
>
> The most recent cool trick (to me) that I started using was this:
>
> cp file.txt{,.bak.`date +%Y%m%d.%H%M`}
>
> For backing up a file before editing. Saves on specifying 2 files and
> includes a timestamp.
>
> ---
> Andrew Mercer
> www.andrewmercer.net
>
>
> On 2014-07-15 13:00, Joe Wennechuk 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 [1]
>>>
>>>
>>> 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 [2]
>>
>>
>> _______________________________________________ kwlug-disc mailing
>> list kwlug-disc at kwlug.org
>> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>
>> Links:
>> ------
>> [1] http://unix.stackexchange.com/questions/57849
>> [2] 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





More information about the kwlug-disc mailing list