Logout dialog
gnome-session-save –logout-dialog
Logout without showing the dialog
gnome-session-save –logout
Shutdown dialog
gnome-session-save –shutdown-dialog
Logout dialog
gnome-session-save –logout-dialog
Logout without showing the dialog
gnome-session-save –logout
Shutdown dialog
gnome-session-save –shutdown-dialog
eject -t
Or
eject -t /dev/hdb
Or
eject -t /dev/sr0
badblocks -sv /dev/sda
-s shows the progress of the scan
-v Verbose mode
apt-get autoclean
will remove packages in the package cache (/var/cache/apt/archives) which are no longer available in the repository.
apt-get autoclean -s
simulation mode: display the files which will get erased from the cache
Extract
gunzip < /boot/initrd.img | cpio -i –make-directories
Repack
find ./ | cpio -H newc -o > initrd.cpio
gzip initrd.cpio
mv initrd.cpio.gz initrd.img
After searching for quite some time I got the solution to start/stop gdm & xorg in Fedora 13.
To stop gdm and Xorg
initctl stop prefdm
killall Xorg
To start Xorg and gdm
initctl start prefdm
To clear and build squid3 cache on Debian and Ubuntu.
/etc/init.d/squid3 stop; rm -Rf /var/spool/squid3/*; squid3 -z; /etc/init.d/squid3 start
If you want to know the total number of lines of files in a directory, execute the following line of script in your terminal. You can also save this command in a file and execute.
lines=0; for i in `find . -name “*.php”`; do line=`cat $i | wc -l`; let lines=$lines+$line; done; echo $lines
lines=0; for i in `find /var/www/wordpress -name “*.php”`; do line=`cat $i | wc -l`; let lines=$lines+$line; done; echo $lines
OR
find . -name “*.php” -print0 | xargs -0 wc -l | tail -n1
To know the count of files of a particular type in a directory
find . -name “*.png” | wc -l
find /usr/share/images/ “*.jpg” | wc -l