Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help first time putty user

Status
Not open for further replies.

sarit

Vendor
Apr 19, 2005
2
AU
Dear all,

Can someone help me please I am first time putty user, just read heaps on how to ocnfigure it but i cant seem to find much guides with images in terms of how to puti n commands etc?

my friend told me i need to type in ./ (command) do i need the. and /

Kindly help. I am learning to run drftpd company server where i can store religious hymes on the server. But new to this ssh. A guide on how to enter raw commands would be helpfull
 
Using Putty is like using Telnet.
Just put in a hostname to connect to and you're connected (with the correct username and password that is)
I think you require assistance on using the Unix Shell??
If your PATH does not have the current directory set, you have to you ./some_command to execute programs in your current directory.
If you want to change this, you can issue the command `export PATH=$PATH:.`



"If you always do what you've always done, you will always be where you've always been."
 
I think your asking what are commands that the system, you happen to be connecting to using PuTTY, has. There are a lot, so here are the basics.

Getting arround:
[red]ls[/red] - list files
[red]cd[/red] [green]<PATH>[/green]- change directory
[red]mv[/red] [green]<SOURCE> <DEST>[/green] - move from [green]<SOURCE>[/green] to [green]<DEST>[/green]
[red]cp[/red] [green]<SOURCE> <DEST>[/green] - make from [green]<SOURCE>[/green] to [green]<DEST>[/green]
[red]ln [/red][green]<SOURCE> <DEST>[/green] - make from [green]<SOURCE>[/green] to [green]<DEST>[/green]

Getting help:
[red]man[/red] [green]<COMMAND>[/green] - shows the manual for a command
When in doubt, RTFM -- Read the Frelling Manual.

file manipulation:
[red]vi [/red][green][<FILE>][/green] - a text editor
[red]cat [/red][green]<FILE> {<FILE>}[/green][red] > [/red][green]<OUT>[/green] - concatinates two or more [green]<FILE>[/green]s into [green]<OUT>[/green] (note the lone [red]>[/red] is litteral)

File Storage:
[red]tar -c [/red][green]<FILE> {<FILE>}[/green] [red]-f[/red] [green]<DEST>[/green] - archive tool
[red]gzip[/red] [green]<FILE>[/green] - compression tool

Time:
[red]date[/red] - tells the time and date
[red]cal [/red][green][[<MONTH>] <YEAR>][/green] - calendar Note the [green]<YEAR>[/green] is in YYYY format, so [red]cal 05[/red] means the year 5 A.D. not 2005 A.D.
Code:
stuff in            is 
[]         =      optional
<>         =      replaced with file or
                  options depending on application
{}         =      Optional repeat

[plug=shameless]
[/plug]
 
The "current directory" might be what is causing confusion.

When a command is given by itself, the $PATH environment variable is searched to find it. The first match is what runs. To see your path, type "echo $PATH" and you should see something like this (all on one line):

/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:\
/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:\
/root/bin

The reason that typing "echo $PATH" even works is because the "echo" command is located in /bin, which is in the path:

# which echo
/bin/echo

If /bin wasn't in the path, I'd have to type "/bin/echo $PATH" to get the same result.

As for the current directory, it's referenced by a single dot (two dots references the parent directory). So, if I'm not currently in one of the directories in the path, and I want to run a command, I have to give the full path. The dot is a convenient shortcut.

For example, if my current directory is /usr/local/myapp/bin, and I wish to run the "program" command in that directory, I can either type "/usr/local/myapp/bin/program" or "./program". Simply typing "program" won't work since my current directory isn't in the path.

As rzs0502 mentioned, you can add the "." to your path if you like, but it's usually not a good idea. There's a bit of a security benefit in ensuring that you know which program you're running. If a malicious user or program drops an executable into your home directory, you could accidentally execute it instead of what you thought you'd run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top