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:
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum