|
Download all files in a directory using WGET |
|
|
|
To download all files in the directory using WGET in Linux, the following command can be used
wget -H -r --level=1 -k -p http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/
-r, –recursive Specify recursive download. -l, –level=NUMBER Maximum recursion depth (inf or 0 for infinite). -k, –convert-links Make links in downloaded HTML point to local files. -p, –page-requisites Get all images, etc. needed to display HTML page. |
|
|
Space taken by a directory in Linux OS/Unix |
|
|
|
Get the space taken by directory for Linux OS/Unix
The following command can be used to get the space taken by directory
du -sh <path of the directory> [gaurav@home]$ du -sh /var/www/ 1.5G /var/www/ |
|
|
Shutdown Linux after pre-determined time |
|
|
This is an alternative for Cron
Issue the following command in terminal:
/sbin/shutdown -h +300
Command Details:
sudo : This is to execute the command as root, you will need the password here.
/sbin/shutdown : Command to shutdown the computer.
-h : This tell the shutdown command to power off i.e. halt.
+300 : The minutes before scheduled shutdown, here it is 300 minutes. Posted from nitinkamath.info |
|
|
Search and delete files in Unix |
|
|
This is a useful tip to find and remove some files by searching recursively in a directory and sub directories
This will list down all the *.tmp/*.log files find . -type f -name "*.tmp" -exec echo {} \; find . -type f -name "*.log" -exec echo {} \;
This will delete down all the *.tmp/*.log files find . -type f -name "*.tmp" -exec rm {} \; find . -type f -name "*.log" -exec rm {} \;
It will be better to list the files first and then delete them, so that we do not miss out any important file |
|
|
How to comment all lines in VI editor ? |
|
|
How to comment all lines in VI editor ?
This can be done with a using a command like 'search and replace'
1.Open the file in 'vi' editor. 2.Press Escape and type :1,$s/^/##/g 3.Press Enter
1,$s/^/##/g can be broken down as 1: To start from 1st line $s :To end at the last line /^ : Search for the start of the line /##:Replace with ## /g: Replace all occurrences
contributed by : Pratik Shah |
|
|
|
<< Start < Previous 1 2 3 4 5 6 7 8 9 10 Next > End >>
|
| Results 1 - 9 of 109 |