Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need some command line commands...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
o'bogamol
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2009
Posts: 91
Location: Detroit, Michigan - The Home of Rock and Roll

PostPosted: Thu Jan 07, 2010 7:17 pm    Post subject: Need some command line commands... Reply with quote

First, when I use the command 'make menuconfig' it makes a file called '/somewhere/on/the/system/config.' .
If I used the Gentoo install disk and followed the Gentoo Handbook, then where would it be, and more importantly what command can I use to find files?

Also, I'd like to be able to run a command and save it's output to a file that I can later access. ...For example, 'lsmod' or 'lspci'

Finally, If I plug a flash disk into the usb (or in my case, a blackberry phone with a 2GB HD) where would I find it, so I can save the files via 'cp'

I have a functioning Gentoo Kernel installed but it's very basic and I'd like to post everything like that so that I can have the experts on the forum critique my installation. :D

Thanks in advance for your help!

Rob
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Thu Jan 07, 2010 7:40 pm    Post subject: Reply with quote

bogamol,

Your kernel .config file is found in /usr/src/<kernel-name>/.config
You are usually only interested on one kernel and its normal to have a symbolic link that points to it.
The link is always called /usr/src/linux, regardless of which kernel it points to,

Note that the filename .config starts with a dot, so it will not normally appear in listings. You must use
Code:
ls -a
to see it.

You use the
Code:
find
command to find files. That can be very slow if it needs to search your entire filesystem.
There is also
Code:
locate
and
Code:
whereis
locate uses a database, so its only as good as the most recent database update.
I think whereis searches the path ... its the one I use most.

You redirect the output from a command the
Code:
>
redirect operator. Try
Code:
lspci > lspci.txt

To put things directy on the web, use wgetpast. You need to emerge that before your use it.
Code:
lspci | wgetpaste
returns a URL where your lspci output can be found
Code:
wgetpaste /some/file
does the same thing for the contents of a file.

Your flash disk will appear as /dev/sd... to find out what, look at the end of the output of the
Code:
dmesg
command.
It may or may not show partitions - flash drives are made in two sorts. Mount the partition if it has one, otherwise mount the whole device. Flash drives are usually formated with the vfat filesystem, so you need vfat support available to your kernel
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10590
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Jan 07, 2010 7:43 pm    Post subject: Re: Need some command line commands... Reply with quote

bogamol wrote:
First, when I use the command 'make menuconfig' it makes a file called '/somewhere/on/the/system/config.' . If I used the Gentoo install disk and followed the Gentoo Handbook, then where would it be, and more importantly what command can I use to find files?
That would be in your kernel source directory, typically "/usr/src/linux", and the name is ".config", not "config.". Use "ls". Type "man ls" to see all of the options. Note that file names that start with a period are not normally listed by ls. Use "ls -a" to see all files, includiung those.
bogamol wrote:
Also, I'd like to be able to run a command and save it's output to a file that I can later access. ...For example, 'lsmod' or 'lspci'
Use the ">" redirection operator, like so:
Code:
lspci >myfile.txt
bogamol wrote:
Finally, If I plug a flash disk into the usb (or in my case, a blackberry phone with a 2GB HD) where would I find it, so I can save the files via 'cp'
If the USB drivers are properly part of your kernel, you'll see the USB stick as another SATA drive in /dev, such as "/dev/sdb1". If your install is in a very early stage of maturity, you won't have an automounter working yet and you'll need to mount it before you can access it, like so:
Code:
mkdir -p /mnt/usb
mount /dev/sdb1 /mnt/usb
You can then copy files to it with cp as you would expect:
Code:
cp myfile.txt /mnt/usb
but you need to explicitly unmount it to ensure that all writes have finished:
Code:
umount /mnt/usb

Makes sense?

- John

Edit: Neddy's fast! :D
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Jan 07, 2010 7:55 pm    Post subject: Reply with quote

First, when I use the command 'make menuconfig' it makes a file called '/somewhere/on/the/system/config.' .
/usr/src/linux/.config
If I used the Gentoo install disk and followed the Gentoo Handbook, then where would it be, and more importantly what command can I use to find files?
/usr/src/linux/.config
Code:

find  /                      filename
find 'startdirectory' 'filename'

run
Code:
man find
for more info
Also, I'd like to be able to run a command and save it's output to a file that I can later access. ...For example, 'lsmod' or 'lspci'
Code:
lsmod > /lsmodoutputfile
will make if needed, replace if not /lsmodoutputfile with the output of lsmod
Code:
lsmod >> /lsmodoutputfile
will append the output of lsmod to /lsmodoutputfile
Finally, If I plug a flash disk into the usb (or in my case, a blackberry phone with a 2GB HD) where would I find it, so I can save the files via 'cp'
Assuming you have only one other disk type device:
Code:
mkdir /mnt/<clever mount point name>
mount /dev/sdb1 /mnt/<clever mount point name>


Run google for linux commands and you will get a ton of free reference material
Back to top
View user's profile Send private message
o'bogamol
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2009
Posts: 91
Location: Detroit, Michigan - The Home of Rock and Roll

PostPosted: Thu Jan 07, 2010 8:29 pm    Post subject: Reply with quote

Awesome, Thanks!
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Jan 07, 2010 9:15 pm    Post subject: Reply with quote

BTW,
if you emerged slocate:
slocate 'file name' runs a lot faster than find
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Thu Jan 07, 2010 9:27 pm    Post subject: Reply with quote

In fact, and when you update your box, you can run this after that :

Code:

# updatedb


This will update the database of slocate :P
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Thu Jan 07, 2010 10:25 pm    Post subject: Reply with quote

... and mlocate updates faster than slocate. :P
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Fri Jan 08, 2010 2:14 am    Post subject: Reply with quote

Never tried that one, but wgetpaste can safe your butt when you are in the dirt big time :P
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Jan 08, 2010 5:51 am    Post subject: Reply with quote

Well we know from the dupe responses NeddySeagoon types the fastest :P
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Fri Jan 08, 2010 12:58 pm    Post subject: Reply with quote

In fact, he is too fast, it's not fair :P
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Fri Jan 08, 2010 4:43 pm    Post subject: Reply with quote

But, not as fast as Bracame :lol:
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sat Jan 09, 2010 3:31 am    Post subject: Reply with quote

In fact, a php bug :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum