How to remove a file using inode number + linux

ARUN Posted in LINUX COMMANDS
0

Solution :

http://admin.webhostingdevelopment.com/viewtopic.php?f=110&t=122

Recursively change permission

ARUN Posted in LINUX COMMANDS
0

cd /home/username/

chown USER:USER -R public_html/

Yum Local install

ARUN Posted in LINUX COMMANDS, YUM
0

yum localinstall name.rpm

YUM command

ARUN Posted in LINUX COMMANDS
0

yum update

yum-complete-transaction

[  yum-complete-transaction --cleanup  ]

yum check-updates

How to cut few lines from a big file using sed

ARUN Posted in LINUX COMMANDS
0

Below command will cut lines 90 to 154 from  file.txt  and copy that to cut_file.txt

sed -n ’90,154p’ file.txt > cut_file.txt

 

Command to change the date on linux server

ARUN Posted in LINUX COMMANDS
0

[   date --set="10 Jan 2012 21:08:50"    ]

Command sed

ARUN Posted in LINUX COMMANDS
0

How to replace a string using sed command.

cd /folder/

sed -i ‘s/string_to_be_replaced/new string/g’ *               —> Without SPACES in between.

cd /var/named/

sed -i ‘s/86400/300/g’ *.db

Clear /tmp when a particular user is occupying files

ARUN Posted in DISK RELATED, LINUX COMMANDS
0

When /tmp is full and we cant find a specific pattern to delete the files and when a specific user with username “USERNAME” is occupying the most disk space

find /tmp -user USERNAME  -exec rm -rf {} \;

OR

for i in `find /tmp -user USERNAME`; do rm -f $i;done

OR

find /tmp/ -type f -user USERNAME | xargs rm -f

Command to delete files older that N days

ARUN Posted in LINUX COMMANDS, SCRIPTS
0

[    find /home/username/ -mtime +N -exec ls -l {} \;    ]

eg :   [    find /home/username/ -mtime +75 -exec ls -l {} \;    ]

Customized ping

ARUN Posted in LINUX COMMANDS
0

ping -i 20 -s .1 IP_ADDRESS

 

8 bytes from IP_ADDRESS: icmp_seq=1 ttl=49

How to use wget when password authentication is set.

ARUN Posted in LINUX COMMANDS
0

wget –user=username –password=’mypassword*-’ http://domain.com/index.php

Find running mailserver in plesk

ARUN Posted in LINUX COMMANDS, PLESK BACKEND
0

[  /usr/local/psa/admin/sbin/mailmng --features | grep SMTP_Server     –> Will show the running MTA   ]

How to find the httpd uptime

ARUN Posted in HTTPD, LINUX COMMANDS
0

FIND files owned by a user

ARUN Posted in FILE PERMISSIONS, LINUX COMMANDS
0

find . -type d -user username

find . -type f -user username

How to password protect a directory

ARUN Posted in LINUX COMMANDS, Uncategorized
0

To add a new user ssh to the server and go to the directory /var/www/vhosts/domain.com/subdomains/subdomainname/httpdocs and execute the following command

htpasswd -mcb .htpasswd <username> <password>