hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Dedicated Server : Operating inside SSH
Reply

Forum Jump

Operating inside SSH

Reply Post New Thread In Dedicated Server Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-05-2005, 05:21 PM
M4N-N4N M4N-N4N is offline
Junior Guru Wannabe
 
Join Date: Oct 2005
Posts: 57
Question

Operating inside SSH


Ok, I am a relatively new dedicated server owner and one of my new challenges has been learning to operate on my server within SSH (secure Shell).

One of my questions:

when I list directories in SSH it lists all teh files, but it does not display the file size. What command do I enter to list a directory that shows the files as well as their size in bytes or kb>?


ALSO- post your handy SSH commands below!



Sponsored Links
  #2  
Old 11-05-2005, 06:05 PM
Chris_M Chris_M is offline
Community Liaison
 
Join Date: Oct 2004
Location: Ohio
Posts: 1,595
Try ls -la. It should show you what you want.

  #3  
Old 11-05-2005, 06:17 PM
M4N-N4N M4N-N4N is offline
Junior Guru Wannabe
 
Join Date: Oct 2005
Posts: 57
Thanks! Thats just what I was looking for! Also, I have one further question. I am not sure if this is possible, and I have a feeling it may not be a command, but I will ask in case. Is there a command to find a file? For example....say I am in the root directory and I want to find a file called php.ini or something like that and I know its in one of the hundreds of subfolders, but not sure which one. Is there a command something like:

find php.ini

or something similar that will help me to located this file?

Sponsored Links
  #4  
Old 11-05-2005, 06:18 PM
layer0 layer0 is offline
Performance Specialist
 
Join Date: Dec 2004
Location: New York, NY
Posts: 10,380
Quote:
Originally Posted by M4N-N4N
Thanks! Thats just what I was looking for! Also, I have one further question. I am not sure if this is possible, and I have a feeling it may not be a command, but I will ask in case. Is there a command to find a file? For example....say I am in the root directory and I want to find a file called php.ini or something like that and I know its in one of the hundreds of subfolders, but not sure which one. Is there a command something like:

find php.ini

or something similar that will help me to located this file?
try:

whereis php

Usually you can find it in /usr/local/lib/php.ini.

__________________
MediaLayer, LLC - Lightning fast web hosting since 2005. Ask about our new pure SSD storage platform!
First and leading provider of LiteSpeed based hosting combined with enterprise grade hardware.
Free Account Migrations, Custom Solutions, and Servers in US, EU, and Asia
Our Application Hosting plans outperform the typical VPS. Ask us about special offers on yearly plans!

  #5  
Old 11-05-2005, 06:29 PM
M4N-N4N M4N-N4N is offline
Junior Guru Wannabe
 
Join Date: Oct 2005
Posts: 57
Wow this is fantastic! These are some great commands! Ok, so while we are on this topic....would any SSH pro's on here like to share their most handy command?

Perhaps something that you use sometimes that is really not well known as a command, but VERY helpful.

  #6  
Old 11-05-2005, 06:40 PM
swei swei is offline
Web Hosting Master
 
Join Date: Dec 2001
Location: NYC
Posts: 1,902
You can also try:

locate php.ini
or
find / -name php.ini

to search for php.ini on your system.

man locate and man find should give you more info on that. Press 'q' to quit when you're done viewing the man page.

Here's a few links to help:

http://www.tjhsst.edu/~dhyatt/superap/unixcmd.html
http://www.articlealley.com/article_7274_16.html
http://www.webhostgear.com/35.html

Some info might overlap, I didn't check.

  #7  
Old 11-05-2005, 06:44 PM
layer0 layer0 is offline
Performance Specialist
 
Join Date: Dec 2004
Location: New York, NY
Posts: 10,380
Quote:
Originally Posted by M4N-N4N
Wow this is fantastic! These are some great commands! Ok, so while we are on this topic....would any SSH pro's on here like to share their most handy command?

Perhaps something that you use sometimes that is really not well known as a command, but VERY helpful.
Here's a list I have saved on my computer of some of the most popular commands...

ls Displays everything in the current directory
ls -a Displays all files, including hidden
ls -l Displays all files, along with the size and timestamp
tar -zxpf <file.tar.gz> Uncompresses tar.gz files
tar -xpf <file.tar.gz> Uncompresses .tar files
gunzip <file> Uncompresses .gz files
cp <file> Copies a file to a new file
mv <file> Moves a file to a new file, or rename
mkdir <dir> Creates a directory
rmdir <dir> Deletes a directory
rm <file> Deletes a file
rm -rf <dir> Deletes a directory
cd <dir> Moves to a directory
cd .. Moves to a lower directory
cd ~ Moves to your home directory
cd - Moves to the previous directory
pwd Displays the current directory
pico <file> Edits a file
ftp <site> Connect to a FTP server
lynx <site> View a webpage
df Displays the hard drive stats
quota Displays your quota
uptime Displays the uptime of the server
uname -a Displays the operating system stats
whoami Displays your info
who Displays others connected to the server
last Displays the last login
whereis <file> Tells where a file is located
ps -x Displays processes your running
ps -a Displays all processes running
ps -ux Displays running processes, with CPU/Memory usage
kill <pid> Kills a process
kill -9 <pid> Kills an eggdrop process
killall <program> Kills all running process of the same type
whatis <command> Description of commands
man <command> Displays help on the command
nano <file> editor that's similar to pico
Top gives an overall view of what is going on with the server including memory usage, server load and running processes "q" to exit top
sar -q gives a report of the process list, 1 minute and 5 minute average load every 10 minutes since midnight server time
tar -zcf filename.tar.gz file Tars up the file or directory of your choice, replace filename.tar.gz with the name you want your tar file to have...with the tar.gz extension on the end and replace file with the file or directory you want to tar up. You can also use a path/to/file for both.
updatedb Updates the locate/search DB.
find / -user <username> Finds all files that belong to a specific username.
/scripts/pkgacct2 <username> Creates a full backup of a certain cPanel account.
/scripts/restorepkg <username> Restores a full backup which must be located in /home.
crontab -e Allows you to edit the crontab and also look to see what is in there.

__________________
MediaLayer, LLC - Lightning fast web hosting since 2005. Ask about our new pure SSD storage platform!
First and leading provider of LiteSpeed based hosting combined with enterprise grade hardware.
Free Account Migrations, Custom Solutions, and Servers in US, EU, and Asia
Our Application Hosting plans outperform the typical VPS. Ask us about special offers on yearly plans!

  #8  
Old 11-05-2005, 06:50 PM
M4N-N4N M4N-N4N is offline
Junior Guru Wannabe
 
Join Date: Oct 2005
Posts: 57
Ya I already use a lot of those more popular ones, but I also see a few in there that I am not currently using that could be quite useful- NICE!

  #9  
Old 11-05-2005, 07:04 PM
layer0 layer0 is offline
Performance Specialist
 
Join Date: Dec 2004
Location: New York, NY
Posts: 10,380
Just something that may be useful....you can combine commands..for example:

ps -A | grep httpd | wc -l

That will show the amount of httpd processes.

ps -A | grep httpd

That will show the httpd processes themselves.

Grep is VERY useful.

__________________
MediaLayer, LLC - Lightning fast web hosting since 2005. Ask about our new pure SSD storage platform!
First and leading provider of LiteSpeed based hosting combined with enterprise grade hardware.
Free Account Migrations, Custom Solutions, and Servers in US, EU, and Asia
Our Application Hosting plans outperform the typical VPS. Ask us about special offers on yearly plans!

  #10  
Old 11-05-2005, 07:21 PM
M4N-N4N M4N-N4N is offline
Junior Guru Wannabe
 
Join Date: Oct 2005
Posts: 57
I didnt know you could do that. I am going to try that out!!! THanks!

  #11  
Old 11-06-2005, 09:39 AM
layer0 layer0 is offline
Performance Specialist
 
Join Date: Dec 2004
Location: New York, NY
Posts: 10,380
Oh and one more thing I forgot to mention.

For a lot (basically every) command you can put --help at the end to show all the possible ways of using.

Ex.

ls --help
rm --help
ps --help

HTH


__________________
MediaLayer, LLC - Lightning fast web hosting since 2005. Ask about our new pure SSD storage platform!
First and leading provider of LiteSpeed based hosting combined with enterprise grade hardware.
Free Account Migrations, Custom Solutions, and Servers in US, EU, and Asia
Our Application Hosting plans outperform the typical VPS. Ask us about special offers on yearly plans!

  #12  
Old 11-06-2005, 11:08 AM
alias_willsmith alias_willsmith is offline
Junior Guru Wannabe
 
Join Date: Aug 2005
Location: Bay Area
Posts: 60
Did we all forget the ever so wonderful "man" command?! To those unfamiliar with man type:

man man

__________________
OneZero We're a perfect 10 when it comes to your hosting and Internet needs!
To us every last customer and every server also rates a perfect ten!
http://onezerohosting.com, sales@onezerohosting.com

  #13  
Old 11-07-2005, 04:22 PM
morcego morcego is offline
Web Hosting Guru
 
Join Date: May 2005
Posts: 280
Just one further advice.
Avoid connecting directly as 'root' on your server.
It is a better idea, securitywise, to connect as a regular, unprivileged user, and then use 'su -' to switch to root.

Also, check about using digital keys (RSA or DSA, check 'man ssh' and 'man sshd'). They are much more secure than using plain text authentication.

  #14  
Old 11-10-2005, 10:14 AM
parsmizban parsmizban is offline
Newbie
 
Join Date: Jan 2005
Location: iran
Posts: 5
thanks for this great post >elix

  #15  
Old 11-10-2005, 10:39 AM
Cool Surfer Cool Surfer is offline
Aspiring Evangelist
 
Join Date: Jun 2005
Location: Internet
Posts: 448
do these commands work on all distros of linux ?
eg will su work in debian or ubuntu?

__________________
www.xpindia.com hosting.

Reply

Related posts from TheWhir.com
Title Type Date Posted
Microsoft Will Use Fuel Cells to Create Self-Powered Racks Web Hosting News 2013-11-18 11:14:46
Equinix Expands AWS Direct Connect Availability to Seattle Data Centers Web Hosting News 2013-05-10 11:32:28
SingleHop Launches VMware Based Public Cloud Service Web Hosting News 2013-02-19 14:35:10
Web Host BroadCloud Adds Piston Private Cloud OS to its Managed Services Web Hosting News 2012-05-04 16:31:29
Joseph B. George Discusses Dell's OpenStack-Powered Cloud Solution Whir Tv 2013-10-05 06:25:19


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?