[ale] bash commands

Richard Bronosky richardbronosky at gmail.com
Tue May 22 08:45:19 EDT 2012


Okay, I will say that the gem in this discussion is the little know
command: tee

If you ever find yourself using vim to read a file owned by root and then
want to edit it, can do so and write to the file as root using...
:w !sudo tee %

How that words is...
:w !command - writes the content of the buffer as the pipe input to command.
% - is a register that gets substituted with the current file path
tee - see: man tee
On May 20, 2012 10:37 AM, "Shawn" <taaj.shawn at gmail.com> wrote:

> If you have a distro that uses sudo by default you will run into issues
> with redirection. Take a look at this article it explains a couple methods
> for redirecting output. I use the tee method.
> http://psas.pdx.edu/SudoSetup/
> ------Original Message------
> From: Drifter
> Sender: ale-bounces at ale.org
> To: ale at ale.org
> ReplyTo: Atlanta Linux Enthusiasts
> Subject: [ale] bash commands
> Sent: May 18, 2012 5:27 PM
>
> I keep reminding myself that I don't begin to know what I think I know! :(
>
> I am about to upgrade this box, finally from FC 13 to FC 14.
> Ought to be simple enough.  I have the CD, which I think will do a clean
> install onto a software RAID.
>
> Prior to that I really ought to have on hand a list of all the installed
> packages.
>
> So I created a file <app_list.txt> on the Desktop and then tried this:
>
> yum list installed | ~/Desktop/app_list.txt
> and got back this
>
> bash: /home/kilpatms/Desktop/app_list.txt: Permission denied
>
> WTF!
>
> So I checked the perms on the existing (empty) file and they were correct.
> Then I tried the same thing as root, expanding the ~/ and got the same
> response.
>
> So, How DO I make yum throw a list of the installed packages to a text file
> rather than to the terminal?
>
> Sean
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
> Sent via BlackBerry
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20120522/11e63478/attachment.html 


More information about the Ale mailing list