Go Back   Android Forums > Android Forums Community > The Lounge > Computers & IT

Like Tree1206Likes

test: Reply
 
LinkBack Thread Tools
Old January 17th, 2013, 12:25 PM   #1 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Cool The "Linux questions (and other stuff)" thread

With all the splintered discussions about Linux around here, I thought perhaps we could have a thread dedicated to all things Linux. Whether you're a new Linux user, or someone considering installing Linux, or have specific questions or solutions about a Linux feature or program, how about posting here? I'll start by pasting in some code I posted in a totally non-computer related thread!

The following bash code will replace spaces in file names with underscores:

[high]#!/bin/bash

ls > /tmp/current_files
mv /tmp/current_files ./current_files
cat current_files | tr ' ' '_' > current_files_new
FileCount=$(wc -l current_files | awk '{print $1}')
count=1
while [ "$count" -le "$FileCount" ]
do ReadAwk="FNR=="$count
OldName=$(awk $ReadAwk current_files)
NewName=$(awk $ReadAwk current_files_new)
mv "$OldName" "$NewName" > /dev/null 2>&1
count=$(($count+1))
done
rm current_files
rm current_files_new
exit 0[/high]

My advice is that you try it first in a temporary directory with copies of files, just to verify for yourself that it works as expected. Also, if you're unsure what any part of it does, feel free to ask.

Advertisements
__________________


MoodyBlues is online now  
Reply With Quote
The Following 6 Users Say Thank You to MoodyBlues For This Useful Post:
9to5cynic (January 17th, 2013), alostpacket (January 18th, 2013), argedion (January 17th, 2013), Davdi (January 18th, 2013), Speed Daemon (January 18th, 2013), Stinky Stinky (October 7th, 2013)
sponsored links
Old January 17th, 2013, 05:47 PM   #2 (permalink)
The TechnoFrog
 
argedion's Avatar
 
Join Date: Jun 2011
Location: The Severed Garden
Posts: 5,826
 
Device(s): Nexus 7 (2012)
Carrier: Not Provided

Thanks: 6,006
Thanked 5,575 Times in 2,572 Posts
Default

Great Idea. hopefully this becomes one of my newest hangouts. I'm always looking to learn something new.

so let me ask the first question. I download a file (graphic) from a website that puts its name in brackets along with the name of the file.

example
[www.somesite.com]fantasy (7).jpg

what would be the best way to rename the file without having to do a full rename of each and every file? for the sake of this example lets say ten files.

thanks
__________________
All My Links In one Convenient Place
Asking simple questions can keep us from doing dumb things.
argedion is online now  
Reply With Quote
Old January 17th, 2013, 06:08 PM   #3 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by argedion View Post
Great Idea. hopefully this becomes one of my newest hangouts. I'm always looking to learn something new.
Let's hope it takes off. When I realized that questions like the 'spaces in file names' one were popping up in threads that had NOTHING to do with computing, let alone Linux, it just seemed like having a central place would be so much more convenient. I mean who--after say a month or six--will REMEMBER that the question about removing spaces from file names was in a 'what's going on in your neck of the woods' thread?

Quote:
so let me ask the first question. I download a file (graphic) from a website that puts its name in brackets along with the name of the file.

example
[www.somesite.com]fantasy (7).jpg

what would be the best way to rename the file without having to do a full rename of each and every file? for the sake of this example lets say ten files.
What would you want the files to be renamed to?
MoodyBlues is online now  
Reply With Quote
Old January 17th, 2013, 06:27 PM   #4 (permalink)
The TechnoFrog
 
argedion's Avatar
 
Join Date: Jun 2011
Location: The Severed Garden
Posts: 5,826
 
Device(s): Nexus 7 (2012)
Carrier: Not Provided

Thanks: 6,006
Thanked 5,575 Times in 2,572 Posts
Default

Quote:
Originally Posted by MoodyBlues View Post
Let's hope it takes off. When I realized that questions like the 'spaces in file names' one were popping up in threads that had NOTHING to do with computing, let alone Linux, it just seemed like having a central place would be so much more convenient. I mean who--after say a month or six--will REMEMBER that the question about removing spaces from file names was in a 'what's going on in your neck of the woods' thread?


What would you want the files to be renamed to?
as in the example just Fantasy_7.jpg
argedion is online now  
Reply With Quote
Old January 17th, 2013, 08:01 PM   #5 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

speaking of filename problems is there some means to get around certain glitches in Wine on a 64-Bit system/OS because a lot of times i had to install the 32-bit OS version because Wine cannot ever find it's 'program files' directory and gives me the 'returned empty string' error and segfaults/crashes. this is because the folder is called 'Program Files (x86)' and for some reason the () symbols are not valid in the syntax of starting or using Wine programs....does renaming the folder properly cause issues or is there another way?
__________________
"If you treat your system like a kiln, don't be surprised when a brick comes out the other side."
nickdalzell is offline  
Reply With Quote
Old January 17th, 2013, 08:03 PM   #6 (permalink)
Senior Member
 
9to5cynic's Avatar
 
Join Date: Feb 2011
Location: /home/
Posts: 4,858
 
Device(s): Galaxy S3 (Verizon) Evo 4G - retired/rooted
Carrier: Verizon

Thanks: 3,066
Thanked 1,763 Times in 1,189 Posts
Send a message via AIM to 9to5cynic
Default

Quote:
Originally Posted by MoodyBlues View Post
[high]#!/bin/bash

ls > /tmp/current_files
mv /tmp/current_files ./current_files
cat current_files | tr ' ' '_' > current_files_new
FileCount=$(wc -l current_files | awk '{print $1}')
count=1
while [ "$count" -le "$FileCount" ]
do ReadAwk="FNR=="$count
OldName=$(awk $ReadAwk current_files)
NewName=$(awk $ReadAwk current_files_new)
mv "$OldName" "$NewName" > /dev/null 2>&1
count=$(($count+1))
done
rm current_files
rm current_files_new
exit 0[/high]
I'm a bit of a scripting newb, but can I try to decipher this and see if I'm right?
I'll do comments below for visibility...

Code:
ls > /tmp/current_files
mv /tmp/current_files ./current_files 
#makes file consisting of this directories 
#contents (after moving it from /tmp)
cat current_files | tr ' ' '_' > current_files_new 
#actually does the 'replacing' and creates a
# new file for the underscore'd version....
FileCount=$(wc -l current_files | awk '{print $1}') 
#number of lines in original file... not sure what 
#awk is doing... that's the first argument right ($1) ??
count=1  
#looks like this whole part is just moving the original 
#file to the underscored file one at a time.... I like this part a lot :)
while   [ "$count" -le "$FileCount" ]
do 	ReadAwk="FNR=="$count  
#??? No clue what's happening here Setting FNR 
#to the current count level, but I don't know what FNR is?
	OldName=$(awk $ReadAwk current_files)
	NewName=$(awk $ReadAwk current_files_new)
	mv "$OldName" "$NewName" > /dev/null 2>&1
	count=$(($count+1))
done
# removes files created.
rm current_files
rm current_files_new
exit 0[/
MoodyBlues likes this.
9to5cynic is offline  
Reply With Quote
Old January 17th, 2013, 08:10 PM   #7 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

Hey Moody, this is a great idea to start a Linux only thread. And I'm no good with scripts either, so I will need some help. In fact, I need something to help me get going with doing a partition backup using fsarchiver.

Thnx.
__________________
If you don't stand for something, you'll fall for anything! - Sly Stone
saptech is offline  
Reply With Quote
Old January 17th, 2013, 08:46 PM   #8 (permalink)
Senior Member
 
9to5cynic's Avatar
 
Join Date: Feb 2011
Location: /home/
Posts: 4,858
 
Device(s): Galaxy S3 (Verizon) Evo 4G - retired/rooted
Carrier: Verizon

Thanks: 3,066
Thanked 1,763 Times in 1,189 Posts
Send a message via AIM to 9to5cynic
Default

Okay, I've got a question about bluetooth...

I'm in BT5r3, trying to add a keyboard via command line. With the GUI, I am almost able to get it to sync every time (I have to search, then setup using the 'proceed without pairing' option). Sometimes it just doesn't work, not sure why?

Well, I can't find anything command line that works. For some reason there are no bluez-* utilities (even though I installed everything from the repos related to bluez* last night).

using hcitool scan finds my device.
I just set it up with the gui, and using hcitool con reveals this:

Connections:
< ACL BT_ADDRESS handel 11 state 1 lm MASTER AUTH ENCRYPT

any ideas?

EDIT: In my LM live usb, I can set it up with a couple of commands by using bluez-*, but as that's not in BT, it won't work for this
9to5cynic is offline  
Last edited by 9to5cynic; January 17th, 2013 at 09:31 PM. Reason: double post
Reply With Quote
Old January 18th, 2013, 01:19 AM   #9 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by argedion View Post
so let me ask the first question. I download a file (graphic) from a website that puts its name in brackets along with the name of the file.

example
[www.somesite.com]fantasy (7).jpg

what would be the best way to rename the file without having to do a full rename of each and every file? for the sake of this example lets say ten files.
Quote:
Originally Posted by MoodyBlues View Post
What would you want the files to be renamed to?
Quote:
Originally Posted by argedion View Post
as in the example just Fantasy_7.jpg
As with all things Linux/UNIX, there are many ways to do what you're after. Ask 1,000 different people and you'll probably get 2,000 different answers! With that in mind, here's what I came up with; I'm showing it step by step for clarity, rather than just throwing it all into one script.

First, I ran the script posted earlier to replace spaces with underscores (this time I've added a little documentation! ). So I started out with 12 files named:

Code:
[www.somesite.com]fantasy (10).jpg
[www.somesite.com]fantasy (11).jpg
[www.somesite.com]fantasy (12).jpg
[www.somesite.com]fantasy (1).jpg
[www.somesite.com]fantasy (2).jpg
[www.somesite.com]fantasy (3).jpg
[www.somesite.com]fantasy (4).jpg
[www.somesite.com]fantasy (5).jpg
[www.somesite.com]fantasy (6).jpg
[www.somesite.com]fantasy (7).jpg
[www.somesite.com]fantasy (8).jpg
[www.somesite.com]fantasy (9).jpg
I ran this script:

[high]#!/bin/bash

# create a list of files that are in current directory, writing only
# their names, in /tmp/current_files
ls > /tmp/current_files

# move the list of file names to current directory
mv /tmp/current_files ./current_files

# run contents of list file through tr, changing spaces into;
# underscores; write modified results to new file
cat current_files | tr ' ' '_' > current_files_new

FileCount=$(wc -l current_files | awk '{print $1}')
count=1
while [ "$count" -le "$FileCount" ]
# this will get fed to awk for processing
do ReadAwk="FNR=="$count
OldName=$(awk $ReadAwk current_files)
NewName=$(awk $ReadAwk current_files_new)
# use quotes so files with spaces in their names are interpreted
# correctly; suppress any output
mv "$OldName" "$NewName" > /dev/null 2>&1
count=$(($count+1))
done

# clean up when done
rm current_files
rm current_files_new

exit 0[/high]

Now my files' names looked like this:

Code:
[www.somesite.com]fantasy_(10).jpg
[www.somesite.com]fantasy_(11).jpg
[www.somesite.com]fantasy_(12).jpg
[www.somesite.com]fantasy_(1).jpg
[www.somesite.com]fantasy_(2).jpg
[www.somesite.com]fantasy_(3).jpg
[www.somesite.com]fantasy_(4).jpg
[www.somesite.com]fantasy_(5).jpg
[www.somesite.com]fantasy_(6).jpg
[www.somesite.com]fantasy_(7).jpg
[www.somesite.com]fantasy_(8).jpg
[www.somesite.com]fantasy_(9).jpg
Next I typed this at a prompt to remove the [www.somesite.com] from each file's name:

Code:
for file in \[www.somesite.com\]fantasy*.jpg
do mv $file ${file#\[www.somesite.com\]}
done
My files now looked like this:

Code:
fantasy_(10).jpg
fantasy_(11).jpg
fantasy_(12).jpg
fantasy_(1).jpg
fantasy_(2).jpg
fantasy_(3).jpg
fantasy_(4).jpg
fantasy_(5).jpg
fantasy_(6).jpg
fantasy_(7).jpg
fantasy_(8).jpg
fantasy_(9).jpg
Next comes this, which strips the "(" from each file's name:

Code:
for file in *\(*.jpg
do mv ${file} ${file/\(/}
done
Yielding:

Code:
fantasy_10).jpg
fantasy_11).jpg
fantasy_12).jpg
fantasy_1).jpg
fantasy_2).jpg
fantasy_3).jpg
fantasy_4).jpg
fantasy_5).jpg
fantasy_6).jpg
fantasy_7).jpg
fantasy_8).jpg
fantasy_9).jpg
Then this, to strip the ")" from each file's name:

Code:
for file in *\)*.jpg
do mv ${file} ${file/\)/}
done
Yielding:

Code:
fantasy_10.jpg
fantasy_11.jpg
fantasy_12.jpg
fantasy_1.jpg
fantasy_2.jpg
fantasy_3.jpg
fantasy_4.jpg
fantasy_5.jpg
fantasy_6.jpg
fantasy_7.jpg
fantasy_8.jpg
fantasy_9.jpg
Done!

Please ask questions if you're not sure what/how/why something is being done in any of the above.

My caveat, as before, is to first try this in a dummy directory that contains *COPIES* of your files. That way, if something doesn't work right, or you make a typo, or whatever, you don't risk losing anything important. Once you're satisfied that it works as expected it, do it for real.
9to5cynic likes this.
MoodyBlues is online now  
Reply With Quote
The Following User Says Thank You to MoodyBlues For This Useful Post:
argedion (January 18th, 2013)
Old January 18th, 2013, 02:21 AM   #10 (permalink)
你好
 
mikedt's Avatar
 
Join Date: Sep 2010
Location: Xilinhot, China
Posts: 9,929
 
Device(s): Oppo Find 7a, Samsung Galaxy Win Duos(spare), Lenovo P700i(retired), KIRF Galaxy Note(deceased)
Carrier: China Mobile

Thanks: 3,431
Thanked 2,850 Times in 2,058 Posts
Send a message via Skype™ to mikedt
Default

Here's a question. What is everyone's favourite music player/management application? Myself, I like Rhythmbox. It seems to be reliable and does everything I need, it even syncs my 80GB Apple iPod Video. There's quite a few to choose from. I did try Banshee for a while, but did find a problem with it, which I've already discussed somewhere on the forums recently. For podcasts I use GPodder, although I've not tried any other podcast aggregators.
__________________
The People's Guide to Android in the People's Republic.
Honorary Grand Poobah Shenzhen University English Corner.
http://welcometomychina.tumblr.com/
There are nine million bicycles in Beijing.
There are nine million Androids in Shenzhen.
mikedt is online now  
Last edited by mikedt; January 18th, 2013 at 03:35 AM.
Reply With Quote
sponsored links
Old January 18th, 2013, 04:23 AM   #11 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

I use VLC the most for music & videos, but I do use others. My other lightweight favorites are MOC (Music On Console) & Audacious. I've been using these for years.
mikedt likes this.
saptech is offline  
Reply With Quote
The Following User Says Thank You to saptech For This Useful Post:
mikedt (January 18th, 2013)
Old January 18th, 2013, 05:19 AM   #12 (permalink)
你好
 
mikedt's Avatar
 
Join Date: Sep 2010
Location: Xilinhot, China
Posts: 9,929
 
Device(s): Oppo Find 7a, Samsung Galaxy Win Duos(spare), Lenovo P700i(retired), KIRF Galaxy Note(deceased)
Carrier: China Mobile

Thanks: 3,431
Thanked 2,850 Times in 2,058 Posts
Send a message via Skype™ to mikedt
Default

Quote:
Originally Posted by saptech View Post
I use VLC the most for music & videos, but I do use others. My other lightweight favorites are MOC (Music On Console) & Audacious. I've been using these for years.
I just tried that one, it works OK...it never occured to me to use the CLI for playing my music library. LOL. VLC is my default video player, and has been so for a long time.


[HIGH]┌┤...ker/Beethovens Symphonies Karajan├┐┌──────────────┤Playlist├──────────────┐
│22 Berliner Philharmoniker [ |MP3]││ │
│23 Berliner Philharmoniker [ |MP3]││ │
│24 Berliner Philharmoniker [ |MP3]││ │
│25 Berliner Philharmoniker [ |MP3]││ │
│26 Berliner Philharmoniker [ |MP3]││ │
│27 Berliner Philharmoniker [ |MP3]││ │
│28 Berliner Philharmoniker [ |MP3]││ │
│29 Berliner Philharmoniker [ |MP3]││ │
│30 Berliner Philharmoniker [ |MP3]││ │
│31 Berliner Philharmoniker [ |MP3]││ │
│32 Berliner Philharmoniker [ |MP3]││ │
│33 Berliner Philharmoniker [ |MP3]││ │
│34 Berliner Philharmoniker [15:31|MP3]││ │
│35 Berliner Philharmoniker [ |MP3]││ │
│36 Berliner Philharmoniker [ |MP3]││ │
│37 Berliner Philharmoniker [06:22|MP3]││ │
│38 Berliner Philharmoniker [ |MP3]││ │
├────┤Playing... ├──────────┤ Master 27% ├───┤>000:31:26├┤
│ > 37 Berliner Philharmoniker - Beethoven 09x04 (Beethovens Symphonies Karajan│
│00:46 05:36 [06:22] 44kHz 256kbps [STEREO] [NET] [SHUFFLE] [REPEAT] [NEXT] │
[/HIGH]
I've done browsing many times using the CLI, with Lynx. Sites usually load very quickly as well, which can be useful sometimes in bandwidth challanged China.
saptech likes this.
mikedt is online now  
Last edited by mikedt; January 18th, 2013 at 05:27 AM.
Reply With Quote
The Following User Says Thank You to mikedt For This Useful Post:
saptech (January 18th, 2013)
Old January 18th, 2013, 05:55 AM   #13 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

I've used Lynx before as well. I guess you can say I'm always behind the latest, greatest hardware, so using lightweight apps help keep my speed up to par when I had really old hardware.

That's one thing I really like about Linux, you can do just about everything from CLI if X ever crash and you can't get it going soon enough.
saptech is offline  
Reply With Quote
Old January 18th, 2013, 06:27 AM   #14 (permalink)
The TechnoFrog
 
argedion's Avatar
 
Join Date: Jun 2011
Location: The Severed Garden
Posts: 5,826
 
Device(s): Nexus 7 (2012)
Carrier: Not Provided

Thanks: 6,006
Thanked 5,575 Times in 2,572 Posts
Default Re: The "Linux questions (and other stuff)" thread

I also use vlc
argedion is online now  
Reply With Quote
Old January 18th, 2013, 09:35 AM   #15 (permalink)
Disabled
 
Join Date: Jul 2012
Posts: 2,033
 
Device(s):
Carrier: Sprint

Thanks: 541
Thanked 556 Times in 440 Posts
Default

VLC is a perennial favorite for me too.

I really like the layout and features in Amarok, and used it for a long time. But because I hand-edit the file metadata when I rip a CD using abcde, I don't care for apps that mess with the metadata. I don't want to have to be constantly fixing my music files to remove poor spelling and ID3 tags that contain some stranger's editorials!
Speed Daemon is offline  
Reply With Quote
Old January 18th, 2013, 12:07 PM   #16 (permalink)
Sunny Vacation Supporter!
 
palmtree5's Avatar
 
Join Date: May 2012
Location: USA
Gender: Male
Posts: 3,651
 
Device(s): HTC One SV, Samsung Galaxy Prevail (retired), Nexus 7 (Gen 1)
Carrier: Boost Mobile

Thanks: 2,392
Thanked 2,097 Times in 1,108 Posts
Default Re: The "Linux questions (and other stuff)" thread

Is there a good reason to use antivirus software in Linux? If so, recommendations? Also, what's the best way to do a system image backup?
__________________
Find a post helpful? Hit
See spam or something offensive? Hit
New to the site? Site Rules/Guidelines and Introductions
Not a member yet but want to join? Join here!
Want to chat with staff?Here
Want to chat with mods?Here
palmtree5 is online now  
Reply With Quote
Old January 18th, 2013, 12:35 PM   #17 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

why would Linux need anti-virus software?
heathenhawk likes this.
nickdalzell is offline  
Reply With Quote
Old January 18th, 2013, 01:27 PM   #18 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
speaking of filename problems is there some means to get around certain glitches in Wine on a 64-Bit system/OS because a lot of times i had to install the 32-bit OS version because Wine cannot ever find its 'program files' directory and gives me the 'returned empty string' error and segfaults/crashes. this is because the folder is called 'Program Files (x86)' and for some reason the () symbols are not valid in the syntax of starting or using Wine programs....does renaming the folder properly cause issues or is there another way?
I've never seen any of what you're describing, including the '(x86)' in the directory name, but I'd start by renaming 'Program Files (x86)' simply 'Program Files' and see if that does it.
MoodyBlues is online now  
Reply With Quote
Old January 18th, 2013, 01:30 PM   #19 (permalink)
Sunny Vacation Supporter!
 
palmtree5's Avatar
 
Join Date: May 2012
Location: USA
Gender: Male
Posts: 3,651
 
Device(s): HTC One SV, Samsung Galaxy Prevail (retired), Nexus 7 (Gen 1)
Carrier: Boost Mobile

Thanks: 2,392
Thanked 2,097 Times in 1,108 Posts
Default Re: The "Linux questions (and other stuff)" thread

Quote:
Originally Posted by nickdalzell View Post
why would Linux need anti-virus software?
That's what I figured but I thought I would ask
palmtree5 is online now  
Last edited by palmtree5; January 18th, 2013 at 03:25 PM. Reason: Apparently I can't spell when posting from my tablet
Reply With Quote
Old January 18th, 2013, 01:32 PM   #20 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by saptech View Post
Hey Moody, this is a great idea to start a Linux only thread.
Glad you like it!

Quote:
And I'm no good with scripts either, so I will need some help.
Believe it or not, I'm *SO* rusty on all aspects of programming, including bash scripting, so it's kind of fun trying to force my brain back into that mode. Hopefully, *I* won't be the only one contributing on script questions!

Quote:
In fact, I need something to help me get going with doing a partition backup using fsarchiver.
I've never used fsarchiver, in fact I can't even recall hearing of it before. Regardless, what is it you want to do?
saptech likes this.
MoodyBlues is online now  
Reply With Quote
sponsored links
Old January 18th, 2013, 03:03 PM   #21 (permalink)
AF Contributor
 
Join Date: Jul 2012
Location: The Shire
Posts: 838
 
Device(s): HTC Wildfire S x 2, Xperia U, Huawei Y300, N7, Generic Allwinner tab, Bluestacks
Carrier: Not Provided

Thanks: 99
Thanked 212 Times in 159 Posts
Default

VLC for videos/movies Clementine for audio, Audacity for audio editing & manipulation.
Davdi is offline  
Reply With Quote
Old January 18th, 2013, 03:28 PM   #22 (permalink)
Sunny Vacation Supporter!
 
palmtree5's Avatar
 
Join Date: May 2012
Location: USA
Gender: Male
Posts: 3,651
 
Device(s): HTC One SV, Samsung Galaxy Prevail (retired), Nexus 7 (Gen 1)
Carrier: Boost Mobile

Thanks: 2,392
Thanked 2,097 Times in 1,108 Posts
Default

Quote:
Originally Posted by MoodyBlues View Post
I've never used fsarchiver, in fact I can't even recall hearing of it before.
FSArchiver
saptech likes this.
palmtree5 is online now  
Reply With Quote
Old January 18th, 2013, 04:26 PM   #23 (permalink)
Senior Member
 
Bob Maxey's Avatar
 
Join Date: Sep 2010
Posts: 4,837
 
Device(s):
Carrier: Not Provided

Thanks: 381
Thanked 811 Times in 641 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
why would Linux need anti-virus software?
Clarify . . . are you saying that if I run Linux, there is absolutely no possible way I will suffer a virus?

I took a look and remember, I am not an expert.

Meet Linux Viruses | Unixmen
Bob Maxey is offline  
Reply With Quote
Old January 18th, 2013, 04:29 PM   #24 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

while Linux CAN get viruses, the chances of it happening are like 1,000,000 to 1
nickdalzell is offline  
Reply With Quote
Old January 18th, 2013, 05:30 PM   #25 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by Bob Maxey View Post
Clarify . . . are you saying that if I run Linux, there is absolutely no possible way I will suffer a virus?

I took a look and remember, I am not an expert.

Meet Linux Viruses | Unixmen
Let me put it this way--and please keep in mind that I've used *nix since 1985, okay? In *MY* experience, a properly configured, administered, and maintained *nix system will not have any type of security issue, including viruses. For the record, in 28 years, NONE of my UNIX/Linux computers and/or networks has ever been compromised.
argedion, saptech and Speed Daemon like this.
MoodyBlues is online now  
Reply With Quote
Old January 18th, 2013, 08:08 PM   #26 (permalink)
Disabled
 
Join Date: Jul 2012
Posts: 2,033
 
Device(s):
Carrier: Sprint

Thanks: 541
Thanked 556 Times in 440 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
why would Linux need anti-virus software?
One good reason is because not everyone uses Linux, so being able to scrub out malware in a relatively secure environment is a good practice. Linux powers many file and web servers that Windows and Macintosh computers connect to. I know that I wouldn't want to find out from an irate client that I gave them some malware!

While Linux itself is relatively secure (if you patch it religiously and practice good basic security protocols), there have been some Linux exploits. (The word "virus" is hopelessly out of date.) I'd rather have ClamAV scan my Linux machines' filesystems from time to time just in case.
Speed Daemon is offline  
Reply With Quote
Old January 18th, 2013, 08:11 PM   #27 (permalink)
Disabled
 
Join Date: Jul 2012
Posts: 2,033
 
Device(s):
Carrier: Sprint

Thanks: 541
Thanked 556 Times in 440 Posts
Default

Quote:
Originally Posted by MoodyBlues View Post
Let me put it this way--and please keep in mind that I've used *nix since 1985, okay? In *MY* experience, a properly configured, administered, and maintained *nix system will not have any type of security issue, including viruses. For the record, in 28 years, NONE of my UNIX/Linux computers and/or networks has ever been compromised.
By practicing the same basic security protocols on my Windows NT machines, I've never had any of those infected with any malware either. A little common sense can do a lot of good.
9to5cynic likes this.
Speed Daemon is offline  
Reply With Quote
Old January 18th, 2013, 08:18 PM   #28 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

Also if you're using linux desktop and connecting or trading files with Windows machine, it wouldn't hurt to have an antivirus program installed.

I've never had a virus on my linux machines since the mid 1990s, but I've never had one on my Windows machines either. Well once, my teenage son did get one visiting porn sites. I've never ran a virus scanner on linux but did try ClamAV just to see how it ran.
saptech is offline  
Reply With Quote
Old January 18th, 2013, 08:19 PM   #29 (permalink)
你好
 
mikedt's Avatar
 
Join Date: Sep 2010
Location: Xilinhot, China
Posts: 9,929
 
Device(s): Oppo Find 7a, Samsung Galaxy Win Duos(spare), Lenovo P700i(retired), KIRF Galaxy Note(deceased)
Carrier: China Mobile

Thanks: 3,431
Thanked 2,850 Times in 2,058 Posts
Send a message via Skype™ to mikedt
Default

Quote:
Originally Posted by Bob Maxey View Post
Clarify . . . are you saying that if I run Linux, there is absolutely no possible way I will suffer a virus?

I took a look and remember, I am not an expert.

Meet Linux Viruses | Unixmen
Most those seem to be experimental or proof of concepts from the late 90s. Or they involve the users doing something, like opening a malicious document, code injection. Hopefully no Linux users are running something like OpenOffice, or internet browser, or IM, or e-mail client with root privileges, e.g. "$ sudo openoffice" Which is something Windows does by default. all software runs with admin/root privileges. Although MS have tried to stop that.

As a teacher in China, I'm always opening potentially malicious and dangerous documents. I'm using Linux, but if LibreOffice or MS Office on Wine, suddenly asked for my root password, because of some document trying to do something to the system. I'd immediately know, something is wrong here.

This why logging in as root is always a bad idea. I've never had to do that. Login as root is sometimes hidden in certain distros, to protect novice users from themselves, and you don't need it anyway.
mikedt is online now  
Last edited by mikedt; January 18th, 2013 at 08:37 PM.
Reply With Quote
Old January 18th, 2013, 08:25 PM   #30 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by Speed Daemon View Post
By practicing the same basic security protocols on my Windows NT machines, I've never had any of those infected with any malware either. A little common sense can do a lot of good.
How does NT compare to *nix in terms of its inherent security, vis--vis its file system, permissions, user privileges, etc.?
MoodyBlues is online now  
Reply With Quote
sponsored links
Old January 18th, 2013, 09:08 PM   #31 (permalink)
你好
 
mikedt's Avatar
 
Join Date: Sep 2010
Location: Xilinhot, China
Posts: 9,929
 
Device(s): Oppo Find 7a, Samsung Galaxy Win Duos(spare), Lenovo P700i(retired), KIRF Galaxy Note(deceased)
Carrier: China Mobile

Thanks: 3,431
Thanked 2,850 Times in 2,058 Posts
Send a message via Skype™ to mikedt
Default

Quote:
Originally Posted by MoodyBlues View Post
How does NT compare to *nix in terms of its inherent security, vis--vis its file system, permissions, user privileges, etc.?
I'm not the expert. But I'm sure it's mostly file-system permissions and user privileges. In *NIX OSs the system wont try to run something if it isn't marked as "executable". You would never mark a JPG as "executable", so the system wouldn't try to run it. So even if there was malicious code inside a JPG, it wouldn't run.

Windows on the other hand, everything is executable, EXE, BMP, GIF, JPG, MP3, WAV, DOC, PPT, etc. This is why you get malicious BMPs, GIFs, MP3s, DOCs, that have code inside them, which can be executed by say a buffer-overflow vulnerability(code injection). And if the system is running as admin or root, as Windows does by default, it's pwned, as they say.
MoodyBlues likes this.
mikedt is online now  
Last edited by mikedt; January 18th, 2013 at 09:21 PM.
Reply With Quote
Old January 18th, 2013, 09:11 PM   #32 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

if i double click on a JPG in Ubuntu, it opens up whatever picture viewer is default, just like windows. i don't believe executable exists in Linux--everything is a file!

Now our college used and we were required to have our own version (trial) of WinNT 4 and Win2K and i do know the Guest account cannot even set the system time! much less change sensitive info. a 'user' in Linux (i do not recall there being sub-groups in *nix such as guest, power user, and so on just user and root) has more power. a 'user' can use his own user password (Ubuntu does not set a separate root password in its installer ) to sudo anything. there is no security when a person can simply use a generic user password to gain even temporary root priviledge, which can be dangerous in itself. but i don't see too many Linux users complaining about problems the way Windows does.
nickdalzell is offline  
Last edited by nickdalzell; January 18th, 2013 at 09:14 PM.
Reply With Quote
Old January 18th, 2013, 09:50 PM   #33 (permalink)
你好
 
mikedt's Avatar
 
Join Date: Sep 2010
Location: Xilinhot, China
Posts: 9,929
 
Device(s): Oppo Find 7a, Samsung Galaxy Win Duos(spare), Lenovo P700i(retired), KIRF Galaxy Note(deceased)
Carrier: China Mobile

Thanks: 3,431
Thanked 2,850 Times in 2,058 Posts
Send a message via Skype™ to mikedt
Default

Quote:
Originally Posted by nickdalzell View Post
if i double click on a JPG in Ubuntu, it opens up whatever picture viewer is default, just like windows. i don't believe executable exists in Linux--everything is a file!
Oh it definitely does. Appications are certainly executable on Linux, e.g. Chrome. Just that they don't usually have any file suffix. .bin might be used sometimes, to indicate a binary/executable file.

Here's the file permissions for a JPG, it's actually my AF avatar. This is on Mint, which is Ubuntu based.


Everyone can open it and look at it, but they can't change or modify it, or change the file permissions. The only users who can do that are "michael" (me) and root. Note that "make the file executable" is unchecked. The OS would never try to run it, even if there was code hidden inside.


Quote:
Originally Posted by nickdalzell View Post
Now our college used and we were required to have our own version (trial) of WinNT 4 and Win2K and i do know the Guest account cannot even set the system time! much less change sensitive info. a 'user' in Linux (i do not recall there being sub-groups in *nix such as guest, power user, and so on just user and root) has more power. a 'user' can use his own user password (Ubuntu does not set a separate root password in its installer ) to sudo anything. there is no security when a person can simply use a generic user password to gain even temporary root priviledge, which can be dangerous in itself. but i don't see too many Linux users complaining about problems the way Windows does.
You are the "administrator" for your own system, in the absence of a corporate sysadmin. And so the user password is the sudo and root password for your own system. You can set a seperate, password and admin/root account if you want for Ubuntu. There's nothing stopping you from doing that. Which is what enterprise users would do.
mikedt is online now  
Last edited by mikedt; January 18th, 2013 at 09:56 PM.
Reply With Quote
Old January 18th, 2013, 09:52 PM   #34 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
if i double click on a JPG in Ubuntu, it opens up whatever picture viewer is default, just like windows.
That's not what mikedt is referring to. Automatically opening a JPEG in the default image viewer is not the same thing as executing a JPEG. It's the image viewer that's being executed in this scenario, not the image FILE.

Quote:
i don't believe executable exists in Linux--everything is a file!
Nope! Want a quick, very brief, and not all-inclusive lesson on Linux file attributes?

Every file--and this includes directories, because they're files, too--can have three types of permissions, for three sets of users: read/write/execute for user/group/others. So let's say you have a bash script saved as a file named do_this in your home directory, and its permissions look like this:

Code:
-rwxr-xr-x 1 nick users 248600 2013-01-17 22:45 do_this
See the rwx? Those are the permissions for you (user), and they signify read, write, and execute. Then see the two r-xs? Those are for group and others, and they signify read and execute permission only. You can do anything you want to this file, including editing it or deleting it, while everyone else can look at its contents and can execute it, but they can't modify or delete it.

Quote:
Now our college used and we were required to have our own version (trial) of WinNT 4 and Win2K and i do know the Guest account cannot even set the system time! much less change sensitive info.
Just keep in mind that [just about] anything micro$oft has is [probably] a rip-off, and [usually] a very POOR implementation, of something that originated in *nix.

Quote:
a 'user' in Linux (i do not recall there being sub-groups in *nix such as guest, power user, and so on just user and root)
*nix has always...always provided for different levels of authority, everything from who could write to tape drives to who could log in only on a terminal and not the server. Again, anything m$ has likely originated in UNIX.

Quote:
has more power. a 'user' can use his own user password (Ubuntu does not set a separate root password in its installer ) to sudo anything. there is no security when a person can simply use a generic user password to gain even temporary root priviledge, which can be dangerous in itself. but i don't see too many Linux users complaining about problems the way Windows does.
No, that's not how it works. Only a user who has been granted the right to use sudo can use it. Typically, that person would be the one in charge of administering the system.

Ubuntu and its offspring decided that making it harder to enable a true root login would lead to less catastrophe from windows converts. While I certainly see their point, I still think it's a stupid, unnecessary step. As I've said elsewhere, as soon as I install any *buntu or derivative on a new computer, I give root a password AND I enable root logins. I'm a big girl. I don't need hand holding at this point!
mikedt likes this.
MoodyBlues is online now  
Last edited by MoodyBlues; January 18th, 2013 at 09:54 PM.
Reply With Quote
Old January 18th, 2013, 09:52 PM   #35 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

and what if that user tried to use the sudo command and entered his/her own password? same problem
nickdalzell is offline  
Reply With Quote
Old January 18th, 2013, 09:57 PM   #36 (permalink)
Sunny Vacation Supporter!
 
palmtree5's Avatar
 
Join Date: May 2012
Location: USA
Gender: Male
Posts: 3,651
 
Device(s): HTC One SV, Samsung Galaxy Prevail (retired), Nexus 7 (Gen 1)
Carrier: Boost Mobile

Thanks: 2,392
Thanked 2,097 Times in 1,108 Posts
Default Re: The "Linux questions (and other stuff)" thread

Quote:
Originally Posted by nickdalzell View Post
and what if that user tried to use the sudo command and entered his/her own password? same problem
If they just typed sudo, they would get usage instructions
MoodyBlues likes this.
palmtree5 is online now  
Reply With Quote
Old January 18th, 2013, 09:59 PM   #37 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
and what if that user tried to use the sudo command and entered his/her own password? same problem
No, that's not how it works. As I said, a user has to be granted the right to use sudo in order to use it. If they're not in the sudoers file, they can't use the command.
mikedt and palmtree5 like this.
MoodyBlues is online now  
Reply With Quote
The Following User Says Thank You to MoodyBlues For This Useful Post:
palmtree5 (January 18th, 2013)
Old January 18th, 2013, 10:44 PM   #38 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

BTW Moody how is this thread going to work when it has like three different subjects going at once? how do you sort it in one thread?
nickdalzell is offline  
Reply With Quote
Old January 18th, 2013, 10:48 PM   #39 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

Quote:
Originally Posted by MoodyBlues View Post
I'm a big girl. I don't need hand holding at this point!
You're a female and know a great deal about Linux??? Wow, I'm in luv!
MoodyBlues likes this.
saptech is offline  
Reply With Quote
Old January 18th, 2013, 10:51 PM   #40 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
BTW Moody how is this thread going to work when it has like three different subjects going at once? how do you sort it in one thread?
Good question! Unfortunately, I don't have a good answer. In fact, I don't have ANY answer. I guess people who either have a question about, or think they can answer questions about, Linux will pop in here and see what's up.
MoodyBlues is online now  
Reply With Quote
sponsored links
Old January 18th, 2013, 11:07 PM   #41 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

It is a cli command to backup partitions to another device or partition.

http://www.fsarchiver.org/QuickStart

example command:

Quote:
fsarchiver savefs /mnt/backup/gentoo-rootfs.fsa /dev/sda1

The example show the command, create a backup using savefs, save it to the destination, and backup source partition.


To restore it I would use a command like this:

fsarchiver restfs /mnt/backup/gentoo-rootfs.fsa id=0,dest=/dev/sda1

What I would like is a script to use it as such:

when I run the script, it will check for an external device and/or a disc in the cd/dvd drive before starting.

the command also can use options if I was to backup to a cd/dvd disc, such as this:

fsarchiver savefs -s 4300 /data/backup-rhel-5.2-fsa033.fsa /dev/sda1

For instance, if the size of your backup is 8GB and you want to save it on DVD+RW discs, it may be useful to split the archive into volumes of 4.3GB.

The -s 4300 is the option for that.

This is basically what I would like. But if you can just get me started on the basic I should be able to add whatever else I may want it to do.
Thnx.
saptech is offline  
Reply With Quote
Old January 18th, 2013, 11:14 PM   #42 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

Quote:
Originally Posted by nickdalzell View Post
BTW Moody how is this thread going to work when it has like three different subjects going at once? how do you sort it in one thread?
Can it be a subfolder under the Lounge folder like the others there? Then when someone have a certain question, they can create a new Thread. Similar to how the Politics, Computer & IT, and the others are designed.

Just a thought!
saptech is offline  
Reply With Quote
Old January 18th, 2013, 11:32 PM   #43 (permalink)
Resident Linux Nutcase
 
Prinny's Avatar
 
Join Date: Apr 2012
Location: Greenville, SC
Gender: Male
Posts: 3,591
 
Device(s): Samsung Galaxy S3
Carrier: T-Mobile

Thanks: 660
Thanked 1,065 Times in 739 Posts
Default

Posting in this so I can keep up with it on TT

I do have a question though. This is more generic than having to do with bash and whatnot. Well sort of. Anyway!

Source based distros (Gentoo, Sourcery, etc.) Do you think that they are better than distros such as Ubuntu? I understand that Gentoo and the like are not for your average/novice Linux user. I tried Gentoo, and I for the life of me could not get it to work.

Regardless. Which do you think is better for the most part? Or is it one of those "case to case" things?
Prinny is offline  
Reply With Quote
Old January 18th, 2013, 11:38 PM   #44 (permalink)
你好
 
mikedt's Avatar
 
Join Date: Sep 2010
Location: Xilinhot, China
Posts: 9,929
 
Device(s): Oppo Find 7a, Samsung Galaxy Win Duos(spare), Lenovo P700i(retired), KIRF Galaxy Note(deceased)
Carrier: China Mobile

Thanks: 3,431
Thanked 2,850 Times in 2,058 Posts
Send a message via Skype™ to mikedt
Default

Quote:
Originally Posted by nickdalzell View Post
BTW Moody how is this thread going to work when it has like three different subjects going at once? how do you sort it in one thread?
This why we "quote" whom we're responding to. So everyone can follow a particular subject or conversation. If not, I'd just assume it's a response to the OP, or the post above, or it's just a general comment for the thread. It's something we've always done for usenet and mailing lists, and forums are not really any different.

Your post mentioned Moody, but I felt it needed an answer that I could give.
9to5cynic likes this.
mikedt is online now  
Last edited by mikedt; January 18th, 2013 at 11:43 PM.
Reply With Quote
Old January 18th, 2013, 11:43 PM   #45 (permalink)
Senior Member
 
saptech's Avatar
 
Join Date: Dec 2011
Location: Third Stone from the Sun
Posts: 3,667
 
Device(s): Motorola Moto G, Samsung Stratosphere, Galaxy Tab 2 SE.
Carrier: T-Mobile

Thanks: 606
Thanked 797 Times in 636 Posts
Default

Quote:
Originally Posted by Prinny View Post
Posting in this so I can keep up with it on TT

I do have a question though. This is more generic than having to do with bash and whatnot. Well sort of. Anyway!

Source based distros (Gentoo, Sourcery, etc.) Do you think that they are better than distros such as Ubuntu? I understand that Gentoo and the like are not for your average/novice Linux user. I tried Gentoo, and I for the life of me could not get it to work.

Regardless. Which do you think is better for the most part? Or is it one of those "case to case" things?
I think Source based distros are relevant to those that only want to install what they need. In a server operation this could work out for the benefit if you need specific compilation on the hardware you're using.

The average users really don't need it, plus with newer hardware may not be worth it.

Sourcemage is my favorite SBD, but I haven't messed with it a couple of years.
saptech is offline  
Reply With Quote
Old January 19th, 2013, 12:07 AM   #46 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by saptech View Post
You're a female and know a great deal about Linux??? Wow, I'm in luv!
Yep, last time I looked, I was female! And I've been a *nix-ster since 1985. I actually switched career paths because of UNIX. Long story, but I needed a break before starting medical school, one thing led to another, and I ended up in a created-just-for-me position at the furniture store chain where I worked [doing data entry] while in college. I transitioned them off their IBM System/3s, creating a multi-location and, of course, multi-user UNIX system. I did everything--installing hardware, administering the system, programming, all of it. That was my favorite job ever.

I occasionally ruminate over the fact that I always intended to be a physician, and I essentially blew 5 years of hard work [A student, with honors] in pre-med, but for the most part I'm fine with it. When something comes up, like the brain tumor I had, I do find myself wishing I had gone on with med school so I could be more involved in my care, but those thoughts are few and far between.
OutofDate1980 and saptech like this.
MoodyBlues is online now  
Reply With Quote
The Following User Says Thank You to MoodyBlues For This Useful Post:
saptech (January 19th, 2013)
Old January 19th, 2013, 12:33 AM   #47 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

i started when i was in college, heard about this 'Free' OS for awhile and found linux.org (site seems to have changed owners and looks completely different now) and downloaded Basiclinux, my first distro--had to compile everything. X windows actually booting up without a WM or DE was at the time something to be proud of at least for me, and using the links browser in frame buffer graphics mode was a feat in engineering in BL. but unfortunately it was not ready to replace Windows. that did not end up happening 100% until a few days ago. but i did distro hop in and out of Windows space a bit, i bought the complete Red Hat 7 set, six discs with a couple for source code, every app that was available in the repos at time of release. wow. but eventually Netscape couldn't keep up so back to Windows i went. also, RH 7 wouldn't run Bearshare--it would load the app but it would not connect. and that was a heavy used app at the time. also, my CD Burner refused to play nice with the old software it had. suddenly having every app released at the time of the disc set was not as impressive as it was when i bought it. i later burned the first Ubuntu, of course being stupid, as a deer lover myself i liked the name Feisty Fawn. but it really had zero support for a very used Compaq 1200 series. no support for PCMCIA, USB wifi, or anything i used. but it did have sound and the video going. but without internet was essentially useless. back to Windows. then came Mandriva. hard disc decided to go into an infinite activity loop and the distro refused to boot, couldn't fsck either as it woule auto reboot when entering root password. back to Windows. well you can see what ended up happening by my past threads here.
OutofDate1980 likes this.
nickdalzell is offline  
Reply With Quote
Old January 19th, 2013, 01:45 PM   #48 (permalink)
The TechnoFrog
 
argedion's Avatar
 
Join Date: Jun 2011
Location: The Severed Garden
Posts: 5,826
 
Device(s): Nexus 7 (2012)
Carrier: Not Provided

Thanks: 6,006
Thanked 5,575 Times in 2,572 Posts
Default

recently working on a project that called to find out if a file existed or not I had no idea of how to do this in Linux. Not being always the sharpest tool in the shed I tried several ways and failed miserably. I searched a little but since I suck at searching (never know really what to ask) somehow though i seemed to have found my way and its really simple.

here is a test condition to find if a file exist or not using bash

if [[ -e "filename" ]] ; then
true
else
false
fi

just thought I would share for those who didn't know
argedion is online now  
Reply With Quote
Old January 19th, 2013, 02:01 PM   #49 (permalink)
AF Contributor
 
nickdalzell's Avatar
 
Join Date: Jun 2011
Location: Owensboro, KY
Posts: 4,010
 
Device(s): Nexus 10, Nexus 7, Galaxy S3, Galaxy Tab 3's
Carrier: Verizon

Thanks: 96
Thanked 625 Times in 500 Posts
Default

there is also the 'whereis' command that is a lot less complicated:

$>whereis startx

bash: /usr/X11/startx

if the file did not exist it would be like:

$>whereis foo

bash: no such file or directory
nickdalzell is offline  
Reply With Quote
Old January 19th, 2013, 02:24 PM   #50 (permalink)
- Crazy peacock person -
Thread Author (OP)
 
MoodyBlues's Avatar
 
Join Date: Jan 2011
Location: /home/LosAngeles
Posts: 3,229
 
Device(s): Kindle Fire HD 8.9" (rooted), Motorola Atrix 2, Motorola Atrix 4G (retired), Motorola Bravo (retired
Carrier: AT&T

Thanks: 1,067
Thanked 1,531 Times in 937 Posts
Default

Quote:
Originally Posted by argedion View Post
recently working on a project that called to find out if a file existed or not I had no idea of how to do this in Linux. Not being always the sharpest tool in the shed I tried several ways and failed miserably. I searched a little but since I suck at searching (never know really what to ask) somehow though i seemed to have found my way and its really simple.

here is a test condition to find if a file exist or not using bash

if [[ -e "filename" ]] ; then
true
else
false
fi

just thought I would share for those who didn't know
Is it okay if I post the contents of your PM here? Do you even still need help with it? Putting it here will benefit others, too, plus someone besides me can chime in!
MoodyBlues is online now  
Reply With Quote
Reply
Tags
bash, bash script, bash shell, linux, linux questions, linux scripting


Go Back   Android Forums > Android Forums Community > The Lounge > Computers & IT
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:03 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.