Help - Search - Members - Calendar
Full Version: Can Someone Help Me With Few Commands
Linuxhelp > Support > Technical Support
INeedlinuxHelp
I have a few questions about what diffrent commands do in Linux, can someone plz help me unsure.gif

1. what does the commands "more" & "less" do and what is the diffrent between them ?

2. What is the different to use "find" & "locate" when u are looking for some file ?

3. What does the command tail -f syslog do ?

4. If I do the command "mv this that". what happent if the "this" file is in the map ?

5.How do u change your password ?

6.What is the basic different between the structure and work of DOS and LINUX ?

7.why is the command rm risky (as like rm -r /home) ?


Plz can someone help me with this sad.gif
Thx biggrin.gif
hughesjr
I am going to start this now ... I may need to run, but I'll finish later.
QUOTE
1. what does the commands "more" & "less" do and what is the diffrent between them ?

More and Less are text viewers that allow scrolling up and down into things that normally would scroll off the screen. They are great console tools. If you issue a command like ls -al that would normally roll off the screen, it will stop and allow you to page through the results.

the command would be:

ls -al | less

More was first, and based on vi search commands. Less came later and was based on More ... I personally use less, but both are good. Less uses things like the arrow keys (and pageup/pagedown) to move up and down ... and I think it is more intuitive.
hughesjr
QUOTE
2. What is the different to use "find" & "locate" when u are looking for some file ?


Find is a command that does a file search (much like dir in DOS).

Locate is a command that looks through a database, it doesn't really search the hard drive.

Find is always up to date, but slow.

Locate is only as up to date as the last time the updatedb command was run, but it is very fast. Most distros run the updatedb command in a cron ... RedHat based distros (and others) run it daily. If I am going to do a lot of file searches, I will run updatedb and use the locate command.
Corey
I'll help out a bit....

[quote]
3. What does the command tail -f syslog do ?
[/quote]

The 'tail' command by default prints the last 10 lines of the given file. When used with the '-f' parameter, it constantly updates it's output to display on the screen.

In your example, "tail -f syslog" will, at first, display the last 10 lines of the file 'syslog', and then pause, as more information is written to syslog, your output of tail will update.

This is useful for many reasons, my most common use is for watching my 'messages' output using "tail -f /var/log/messages".

[quote]
4. If I do the command "mv this that". what happent if the "this" file is in the map ?
[/quote]

I'm not quite sure what you mean by "this file is in the map".

By default, if you are in a directory and you have a file named "this" and you typed "mv this that", then your file will basically get renamed to "that". If "that" is a directory, then your file will get moved to the directory (still named "this"). Example:

I have a directory with the files "foo", "bar" and a directory called "temp". When i type "mv foo blah", the file "foo" gets renamed to "blah". When i type "mv bar temp", my file "bar" gets moved to the directory "temp".

[quote]
5.How do u change your password ?
[/quote]

You can change the current user's password with the command "passwd", just enter it in on the command line. If you are logged in as "root" and want to change a certain user's password, just enter "passwd duende" (or whatever the user's name is), and you will be allowed to change it.

[quote]
6.What is the basic different between the structure and work of DOS and LINUX ?
[/quote]

Well, there are numerous differences. Some of them include, DOS commands are included within the shell while LInux (or bash) commands are externel programs. Linux uses a filesystem that is based from the "root" file system (/) and all other directories, drives, periphrials and based from that root directory, while dos uses drive letters like C:, D:, etc. A lot of commands are very similar between Linux (bash) and DOS with sometimes only a few letters changed. For more information on this, you should check out the New users guides that are available on this site as well as others.

[quote]
7.why is the command rm risky (as like rm -r /home) ?
[/quote]

Because when working with the Linux command line, like in DOS, there is no recycling bin. So, once you delete a file, it's next to impossible to get it back (mostly impossible for most filesystem types, although I have heard of successes using ext2 on retrieving deleted data). If you execute a command such as "rm -rf /home", everything from /home onwards will be deleted without a prompt, and without an undo feature. Obviously this is VERY risky, I'm sure every linux user out there has at one time or another accidently deleted important stuff because they were in a wrong directory or accidently typed the wrong directory into the "rm" command.


These lines of questioning seems to be like a school assignment or something smile.gif
INeedlinuxHelp
QUOTE
These lines of questioning seems to be like a school assignment or something smile.gif

ha hmm hmmm cough cough what are u saying huh.gif biggrin.gif
yea it is unsure.gif

Thx 4 all the help, VERY nice to see quick repsonses
chrisw
you can send payment to them for their valuable resources...just ask for their prefered method.

i hope you flunk....HAHAHAHAHA
Jim
Hey, I have a java lab due next Tuesday. Any of you guys good with Java?
chrisw
i dont do java...sorry dude.....

i need help on perl....any advice...
i wish learning programming languages was like the part on
the first matrix movie....call a friend and they cram a billion
bytes of crap in your head and you know how to do
which ever program you want to learn...


trinity: tank, i need to learn how to program in assembler..

tank: ok, coming up.

wait...........

trinity to neo: ok, lets go...


wish it was that easy...do you agree..
Jim
Ya, college would be a hell of a lot cheaper.

Pop a few quaters into a machine, press E9 for a CSci degree. Plug yourself in, go home take a nap.

Yes, I have a degree in CSci from the machine on the corner of 5th and Jefferson.

That would be great.
Termina
Eh, would suck for those that spent countless years learning what anyone could learn in a few minutes. wink.gif

Ah well, they'd be old anyways. I could take em. *hits fist against open hand a few times*
Jim
Its all about us bright eyed youth to move those old timers out and make them obsolete with our new fancy degrees on cutting edge computer techniques. Thats what the apprentice system is all about.
Termina
Agreed!

Then we could have all the old people power our cities by making them run in giant hamster wheels. *gets a mad gleam in his eyes*
Jim
I don't think that plan would work. Old people can't run for very long. We wouldn't have power. We need to think of a new plan. I mean, I like where you are going with this, I understand, but the plan is just flawed.
hughesjr
If you expect me to do any running all bets are off laugh.gif

SEE ... the deal is, I'll make the computer generate electricity ... and I'll make it show a hologram of me running in a hampster wheel!
Jim
So you are saying you are going to make a machine that requires power to run generate power? Right, obviously its easy to plug a machine into the wall and have it produce even more power.

See, this is why the youth has to replace the work force, their minds are starting to slip.
Hemant
QUOTE
Hey, I have a java lab due next Tuesday. Any of you guys good with Java?

Yeah..i know a bit of java...you can mail me if you have any problem..
QUOTE
Pop a few quaters into a machine, press E9 for a CSci degree. Plug yourself in, go home take a nap.

..never mind...i will suggest learn chemical engineering...
Termina
Bah, my plans aren't flawd. Humaity is flawd! happy.gif

You see, there are alot of old people. True they couldn't run long, but the cumulative effect would generate alot of electricity. biggrin.gif

Those that stopped running would feed the young!

Electricity + Food + More computers = Joy!

*mutters about various organizations calling him mad for this idea*
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.