View Single Post
  #1 (permalink)  
Old 2007-02-05, 01:35 AM
linuxguru linuxguru is offline
Junior Member
 
Join Date: Feb 2007
Posts: 2
linuxguru is on a distinguished road
Default Some useful commands of linux for beginners

Below mentioned are the few commands of Linux server to access it via shell:

Basic Linux Commands:

ls:

List files/directories in a directory; can compare to dir command in windows/dos.

ls –l:

Shows all files, directories, and details attributes for each file.

cd:

Change directory. For Eg > your current directory is: /home/abc/public_html and want to move to the directory /etc/apf, then the command would be:

root@server [/home/abc/public_html] # cd /etc/apf

cd .. :

Move one step up on from current directory.

cat:

Display the content of files.

Cat >> filename.htm

Create the filename.htm file at current location. You can write the content of the file and save it using the key ctrl + c

rm:

Delete a file.

rm filename.txt :

Delete filename.txt and ask if you really want to delete it. Need to press Y for Yes and N for No.

rm -f filename.txt:

Delete file name without asking Yes or No.

cp:

Copy the file.

cp filename1 filename123

It will copy the filename1 and create the file filename123 with the same content.

man:

Online Manual Help. You can place any command after man.
For Eg. > man ls (it will display the all option and how they work for ls command)

pwd:

Shows what directory you are in.

mv:

Rename the file. For E.g. mv file1 file2.htm (It will rename the file1 to file2.htm at current location. You can mention the path as well).

mkdir:

Create the directory. For E.g mkdir nancy (It will create the directy named ‘nancy’ at the current location. You can mentione the path where you want to create the directory.).

free:

How much memory is used & un-used.

top :

To view top Processes with PID (Process ID number)

kill -9 PID > PID means the process ID number which you have to provide

to kill the process

ps:

Show the process state of current user

ps –A:

Show the process state of all users

ps –aux:

Show the system processes running on the server

df -h:

Check disk space usage of hard disk drives on the server. It shows total disk space size, used disk space, available disk space, * percentage of disk space used.

fdisk -l :

To check the disk partition on the server:


du:

Disk usage for the current directory and all subdirectories

du –h:

Show results in human-readable form (kb & MB)

du -sh ./* :

view individual directory sizes of particular user/domain:

du -csh ./*:

Disk Space used for the particular domain


mount:

List all mounted file systems.


exim –bp:

To check the mail queue
__________________
Linuxguru

Linux based hosting
Reply With Quote