running process's
$ ps -ef
Kill process's
ps -ef | grep tomcat
kill -HUP 36900
running process's
$ ps -ef
Kill process's
ps -ef | grep tomcat
kill -HUP 36900
Any file in unix that starts with a ".", like .profile, is a hidden file. That's how that works
to include these files in your find:
ls -a
find txt in file
$ find . -name "*.log" -exec grep -l "addQuickDepositAccounts" {} \;
find file by name
$ find . -name "rc.conf" -print
$ find . -name "event*.jar"
Fine a filename that contains properties
$ find . -print | grep properties
Find a string in all directories for a string.
$ find . -exec grep "string" {} /dev/null \;
extract a tar file to current dir
tar -xvwf myfile.tar
create a tar file to current dir
tar -cvwf file.tar myfile.txt
tar -zxvf yourfile.tar to extract the file to the current directory.
tar -C /myfolder -zxvf yourfile.tar to extract to /myfolder directory.
Make sure you have done this:
Visual CRONTAB: http://www.corntab.com/pages/crontab-gui
===========================
===========================
http://www.pantz.org/software/cron/croninfo.html
# backup will run on 7th day of the month
0 0 7 * * cp -r -u -f /media/shares/ /media/backup/shares/ >>/var/log/cronrun
/root/backup.sh
#!/bin/sh #################################### # # Backup to NFS mount script. # #################################### # What to backup. #backup_files="/root /srv /home /var/spool/mail /etc /boot /opt" backup_files="/root /srv /home /var/spool/mail /etc /boot /opt"
read this: http://www.thegeekstuff.com/2010/09/rsync-command-examples/
shutdown command
shutdown arranges for the system to be brought down in a safe way. All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented. The shutdown utility provides an automated shutdown procedure for supersers to nicely notify users when the system is shutting down, saving them from system administrators, hackers, and gurus, who would otherwise not bother with such niceties.
The shutdown command can be used to turn off or reboot a computer.
How do I use shutdown command?
Type the command as follows to shutdown server / computer immediately:
$ sudo shutdown -h now
OR
$ sudo shutdown -h 0
How do I shutdown compute at specific time?
To shutdown computer at 6:45pm, enter:
$ sudo shutdown -h 18:45 "Server is going down for maintenance"
At 6:30pm message will go out to all user and 6:45 system will shutdown.
halt or poweroff or reboot command for stopping and restarting the system:
$ sudo halt
OR
$ sudo poweroff
Simply use reboot command:
$ sudo reboot
OR
$ sudo shutdown -r 0
Helpful info: http://www.codecoffee.com/tipsforlinux/articles/22.html
http://www.makeuseof.com/tag/how-to-analyze-your-disk-usage-pattern-in-linux/
If you are geeky enough, the easiest and fastest way is to use the ‘df’ command in your terminal. Simply type
$ df -h
in the terminal and it will show the disk usage percentage of your hard disk.
$ du -a -m /app 2>/dev/null | egrep '.*[123456789]{3}\.[123456789]{2}.*/.*' | less
output
118.69 /app/Apache22/0/logs
162.93 /app/Apache22/0
162.93 /app/Apache22
114.83 /app/Tomcat55/0/reference
367.62 /app/Tomcat55/0
367.62 /app/Tomcat55
114.82 /app/vpc/activemq-4.1.1/activemq-data
136.45 /app/vpc/activemq-4.1.1
4894.78 /app/vpc/event-normalizer-service/nohup.out
739.71 /app/vpc/sxg-event-normalizer-service-delete-me/lib
739.71 /app/vpc/sxg-event-normalizer-service-delete-me
6612.81 /app
Java 7 provicdes a solution:
http://stackoverflow.com/questions/1051295/how-to-find-how-much-disk-space-is-left-using-java
NumberFormat nf = NumberFormat.getNumberInstance();
for (Path root : FileSystems.getDefault().getRootDirectories())
{
System.out.print(root + ": ");
try
{
FileStore store = Files.getFileStore(root);
System.out.println("available=" + nf.format(store.getUsableSpace()) + ", total=" + nf.format(store.getTotalSpace()));
}
catch (FileSystemException e)
{
System.out.println("error querying space: " + e.toString());
}
}
Two options:
davidq root tomcat6
12:51:40 up 3 days, 20:49, 3 users, load average: 0.00, 0.05, 0.08
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 10.129.42.213 12:51 0.00s 0.02s 0.00s w
davidq pts/1 172.29.255.151 11:43 48:14 1:13 0.03s bash
tomcat6 pts/2 172.29.255.151 11:50 39:28 0.07s 0.06s bash
Good QBW PDF — here.
Cheat sheet — here.
Linux for DOS users — here.
# http://www.freeos.com/guides/lsst/
# http://af-design.com/blog/2009/07/07/loading-data-into-bash-variables/
Make it executable:
sudo chmod +x filename
$ wget \
–recursive \
–no-clobber \
–page-requisites \
–html-extension \
–convert-links \
–restrict-file-names=windows \
–domains website.org \
–no-parent \
www.website.org/tutorials/html/
Info found at: http://www.linuxjournal.com/content/downloading-entire-web-site-wget