|
I have a quick grep question. I have a txt file that has lines that look like: IM,009-0001,D,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0001.TIF;2 IM,009-0002, ,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0002.TIF;2 IM,009-0003, ,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0003.TIF;2 Basically, all I want to do is strip the zeroes out of the first part (the part immediately after the IM),and change the hyphen to a period. So, I want to go from: code:
code:
|
# ¿ Sep 20, 2007 17:42 |
|
|
# ¿ Apr 26, 2024 06:33 |
|
I've converted my old desktop PC into an Ubuntu file server that I've thrown in my closet, and I was wondering if there was an easier/better way to administer the files. Right now, I've got a 20gb home partition, and then two 400gb drives that I'm using to store media on. Every time I want to copy or moves files to or from these drives, I need to use sudo, because I'm not the owner (root is) of the drive. I've since chown'd both drives to be me, and used chmod to make all files 777. However, every time a new file gets added to the drive(s), it makes the owner root. I don't want to have to sudo every single time I want to copy/move/delete something, and I don't exactly feel especially comfortable with having everything chmodded to 777. Is there an easier way to maintain this system?
|
# ¿ May 29, 2008 22:14 |
|
Harokey posted:What are you using to copy the files over to the drive? Just cp commands. 99% of the time, I access the computer via SSH, so it's mostly just copying files from my laptop/other computers to one of those 400gb drives. rTorrent also downloads files to one of the drives. Even though I've logged in via SSH as myself, the main user, it places everything as root. It doesn't bother me enough to be ripping my hair out or anything, but it just doesn't feel "safe" to be constantly resetting permissions and ownership to 777.
|
# ¿ May 29, 2008 23:45 |
|
chryst posted:That doesn't sound right. If you're copying as a non-root user, the newly copied files should be owned by the person copying. Are you maybe using su without a - (dash) somewhere? Even when I download files with wget (without using sudo) when I'm logged in via SSH, the file defaults to being owned by root. I've gotten pretty used to the situation by now, as bizarre as it is, and I nearly always use a sudo command, but that just doesn't sound like that's the way it should be working. If it matters, my home partition, and the two mounted 400gb drives are all formatted as ext3, so there's no weird NTFS gibberish going on. I've never used sudo with a dash before. I don't think I've ever even seen that before? I don't use "su," I always use "sudo." Any ideas? Thanks!
|
# ¿ May 30, 2008 01:03 |
|
Nope. I get that when I download to my home directory, when I'm logged in as me. My two other drives are also chowned to me, and it happens there, too. Edit: I haven't checked the setuid, I'll check that out. Obsolete fucked around with this message at 01:32 on May 30, 2008 |
# ¿ May 30, 2008 01:30 |
|
whoami returns as saying it's me, and id -a me returns:code:
Obsolete fucked around with this message at 04:30 on May 30, 2008 |
# ¿ May 30, 2008 04:27 |
|
Harokey posted:So you're not copying files over the network from another machine? I assumed you were because you said you were using it as a file server. I just want to make sure this is not the case, and you're just using this machine standalone. I do both. Files download (via rTorrent or some such) to one of the drives, then I copy those to the other drive into specific folders. However, even when using the machine standalone, and logged in as me, and downloading to my home directory, or copying something from my home directory to someplace else, I always have to either use sudo or chown the file to move the file to a drive outside my home directory, despite the drives all being chown'd, chgrp'd, and chmod'd to me. Obsolete fucked around with this message at 19:37 on May 30, 2008 |
# ¿ May 30, 2008 19:35 |
|
Lucien posted:Please post your output of Done. code:
|
# ¿ May 31, 2008 00:29 |
|
Harokey posted:Wait, the drive or the drive's mount point? ie /dev/sdb1 or /media/sdb1 Sorry, the mount point. So, /media/sda3 and /media/sdb1
|
# ¿ Jun 1, 2008 01:28 |
|
I have a gigantic CSV file that uses pilcrow as the delimiter. I've tried to change it to tabs using tr and sed and can't seem to figure it out. It seems like the command doesn't recognize the pilcrow as a valid character, regardless if I'm using the symbol itself or hex code. I can't seem to hit on the right combination of characters that it wants me to use to run properly.code:
I've also tried with the $ in front of the first set but that didn't work either. I've tried both the character itself (u00b6) and some different hex combinations for it (\xb6, \xc2, etc). Does tr not work with these non printable characters? I tried sed as well but don't think it will work. Sorry if I didn't explain that very well. I've tried a bunch of different combos of characters and can't seem to hit on a solution.
|
# ¿ Jul 19, 2016 18:15 |
|
so loving future posted:I suspect it's your shell or terminal or some combination of horrible poo poo in there. Huh. Well drat. I'll try a different shell and a different machine. Thanks for checking!
|
# ¿ Jul 19, 2016 19:20 |
|
|
# ¿ Apr 26, 2024 06:33 |
|
Mr Shiny Pants posted:Me neither, and the original post did not show the character. I had to type the post on my phone so couldn't paste the character. It probably would have made the question easier! That's interesting that people didn't know what that was called. I didn't even think about that part of it. Thanks to the post about checking the encoding. I'll look into that too. I haven't had a chance to get back to it since I last posted. The encoding piece was really useful. Hopefully that or just changing shells solves the problem. Thanks again everyone!
|
# ¿ Jul 21, 2016 15:17 |