What *nix commands do you want to know more about?

Page 5 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
I've never found much use in xargs. I'd do the find delete thing with:

find . -name "*.tmp" -exec rm {} \;
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: n0cmonkey
I've never found much use in xargs. I'd do the find delete thing with:

find . -name "*.tmp" -exec rm {} \;

Well, it can do more than delete things with find ;)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Sunner
Originally posted by: n0cmonkey
I've never found much use in xargs. I'd do the find delete thing with:

find . -name "*.tmp" -exec rm {} \;

Well, it can do more than delete things with find ;)

I know that. :p

Any other examples? I'm probably thinking too small, but it's tough to come up with one that makes me go "oh yeah, I can use that!" :p
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: n0cmonkey
Originally posted by: Sunner
Originally posted by: n0cmonkey
I've never found much use in xargs. I'd do the find delete thing with:

find . -name "*.tmp" -exec rm {} \;

Well, it can do more than delete things with find ;)

I know that. :p

Any other examples? I'm probably thinking too small, but it's tough to come up with one that makes me go "oh yeah, I can use that!" :p

Well, no specific "big ones" really, most of my use is just little things that I forget after I'm done. ;)
Though one handy use is on older systems that don't have pkill, killall, or anything similar, you can always do stuff like ps aux|grep foobar|awk '{print $2}'|xargs kill, of course you could just do that by constructing the kill command with awk and piping it to bash/bourne, but for whatever reason I find the xargs solution nicer.

Not trying to say xargs will save your life, but if you're used to using it, it can really come in handy with the little things sometimes, and we all know it's the little things that matter, hence making it a big help in the big picture of little things.
:confused:
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Generically case works as a much more intuitive process over nested if/else/then statements. It facilitates a more streamlined script in respect to both writing and reading. I personally use case over nest if/else/then statements.


freeos explaination.
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: TGS
Generically case works as a much more intuitive process over nested if/else/then statements. It facilitates a more streamlined script in respect to both writing and reading. I personally use case over nest if/else/then statements.


freeos explaination.

Yeah, case rocks.
Use it all the time in start scripts and such.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: topdoubledigit
what is a *nix command anyways?

which is a *nix command, what as far as I can tell is not.

;)

A command that works on unix and unix-like operating systems.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: xtknight
What does modprobe do?

How do you 'associate' a driver with a device?

How would I get my USB TV tuner (ATI USB Wonder 2.0) to work with 64-bit Linux? Do I tell /dev/usb0 (or something like that) to use tvtuner.o? How would I do it? ATI doesn't offer Linux drivers but I've had my tuner working under Fedora Core 4 32-bit (but it automatically did). I can only assume that means it's possible under SUSE 10 64-bit too? I see ATI USB TV Wonder 2.0N in the USB devices list in SUSE 10 64-bit, but how do I 'make' it a tuner or capture device? I don't know what tuner or video processor my TV Wonder uses. It is an analog TV device.

These sound like Linux issues. Maybe you should start a thread on them.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Originally posted by: xtknight
Difference between modprobe/insmod?

How do you 'associate' a driver with a device?

Well, this probably should be in another thread, but I'll answer it anyway.

insmod and modprobe differ by a level of abstraction. insmod takes as an argument the filename of a module and has no capabilities to resolve module dependencies, modprobe takes the module name and can resolve dependencies.

As for associating a driver with a device: A driver communicates with any device file that matches, as programmed into the driver, the three characteristics of device type (block or character), major number, and minor number. You can see this for any given device file by running ls -l on it; the first character will be 'b' or 'c', and in place of the file size, you will see "major#, minor#". In this way, a device file can be anywhere in the file hierarchy and be named anything.

mknod(8) will create individual device files with specified characteristics, but for the automated creation of device files, we layer udev on top (though there are still numerous devfs supporters---udev vs. devfs is a shortcut to a flamewar on LKML :D).
 

Tarrant64

Diamond Member
Sep 20, 2004
3,203
0
76
Maybe someone here can help. I am trying to move text from one file to another using vi/vim.

It's over 50 lines(probably roughly 370 or so), and it's a script i'm trying to edit into an html document. I basically want to move that whole file to a specific spot. I tried "yG" and "pp" but it just copied 50 lines(max buffer or something?). Eitherway, can someone help me?

VI/VIM, thanks!
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Originally posted by: Tarrant64
Maybe someone here can help. I am trying to move text from one file to another using vi/vim.

It's over 50 lines(probably roughly 370 or so), and it's a script i'm trying to edit into an html document. I basically want to move that whole file to a specific spot. I tried "yG" and "pp" but it just copied 50 lines(max buffer or something?). Eitherway, can someone help me?

VI/VIM, thanks!

:help :read

Originally posted by: Stiganator
apropos

How is it not explained by RTFMP? :confused:
 

Basie

Senior member
Feb 11, 2001
634
0
71
I am not really clear on adding a device driver as a module. In the past, a few of the Distro's
I tried did not have the sundance.ko driver I needed for my NIC. The driver does not come
ready to install like in WinXP. How do you prepare it and add it as a module?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Basie
I am not really clear on adding a device driver as a module. In the past, a few of the Distro's
I tried did not have the sundance.ko driver I needed for my NIC. The driver does not come
ready to install like in WinXP. How do you prepare it and add it as a module?

That sounds like a Linux question, not a unix command. Make your own thread. ;)
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Originally posted by: jndietz
What is LILO?

LILO is a bootloader. It used to be the standard one on Linux systems (reflected in the meaning of its acronym, LInux LOader), but GRUB has superceded it, partially because GRUB understands filesystems natively and does not need to rely on hard disk geometry to find a kernel to load. You can still use it to load other OSes besides Linux, but these OSes need to have a bootloader installed for themselves. That is another reason why GRUB is replacing LILO, as Linux and several of the BSDs now implement a standard called Multiboot, which defines a standard way for bootloaders to load kernels, making the parts interchangable.
 

cker

Member
Dec 19, 2005
175
0
0
Originally posted by: Tarrant64
Maybe someone here can help. I am trying to move text from one file to another using vi/vim.
It's over 50 lines(probably roughly 370 or so), and it's a script i'm trying to edit into an html document. I basically want to move that whole file to a specific spot. I tried "yG" and "pp" but it just copied 50 lines(max buffer or something?). Eitherway, can someone help me?
VI/VIM, thanks!
A little late, but in case anyone else wants to do this: Open the HTML file in vim. Move your insertion point to the place where you'd like to insert the other file. Then

:r myfile.txt

:r means to read in an external file. The contents of the file will be inserted at your cursor/insertion point.
 

OfficeLinebacker

Senior member
Mar 2, 2005
799
0
0
I think xargs is critical to know.

VERY useful in C shell (yes we stil used csh until about 6 months ago).

Good stuff on here.

sed
 

Pandamonium

Golden Member
Aug 19, 2001
1,628
0
76
I've been trying to find documentation for rm that works with my school's server. (Or my school's server is set up oddly...)

If I want to delete everything in my public_html folder, I try:
rm -r public_html
It asks me if I want to examine files in the directory, so I type "y". Then I am prompted with "remove blahblahblah" for EVERY file. I've tried responding with "a" and "all", to no avail. If I say no to examining files in the directory, the command doesn't seem to do anything.

I have >2000 files in >100 folders, and deleting them all for every new CMS test/implementation takes a god-awful long time in filezilla. I'd love ANY guidance at this point.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Pandamonium
I've been trying to find documentation for rm that works with my school's server. (Or my school's server is set up oddly...)

If I want to delete everything in my public_html folder, I try:
rm -r public_html
It asks me if I want to examine files in the directory, so I type "y". Then I am prompted with "remove blahblahblah" for EVERY file. I've tried responding with "a" and "all", to no avail. If I say no to examining files in the directory, the command doesn't seem to do anything.

I have >2000 files in >100 folders, and deleting them all for every new CMS test/implementation takes a god-awful long time in filezilla. I'd love ANY guidance at this point.

Maybe rm -rf ~/public_html/*

Look at the previous documentation for rm in the thread for what the options do.