Useful Linux Utilities

This page is where I’m going to try to collect all the useful Command Line (CLI) and other useful linux utilities and tips/tricks that you just might someday find a need for. (And I might find a need for them again…. if they’re on this page it’s probably because I’ve needed it at least once.) More will be added as I come across/need/want to add items to the listing.

From the command line:

To return to the last directory you were in (before you just did a cd to somewhere else) type cd – (that’s cd space hyphen in case wordpress mangles that).

Want/need to adjust the datestamp on a file? touch is the program to do it…. touch -t 200901230000.00 filetobechanged would be enough to have the last modified stamp read January 23, 2009 – the extra zeros are probably space to play with the time as well.

Want to securely erase a program? use shred (type man shred for details) – it’s default is 25 passes over the file of random data, you can specify all zeros on the last pass. If your goal is to just wipe a partition (but leave the formatted file system intact and not have to repartition/format) then you might try dd if=/dev/zero of=/mnt/mypartition/newfile to create a newfile of zeros on the partition (you’ll need to have removed the files first.) Then you could go back over it with shred to be REALLY sure that everything is gone.

Debian based systems – package management is relatively easy from the gui or cli – apt-get can install or remove software – apt-cache can search the database of software (no need for root privileges to search). dpkg is useful as well. dpkg -l for instance lists all installed programs (which you could grep for specific items.) dpkg -l packagename gives some details about a single package – dpkg -L packagename gives a list of all the files that belong to a package. This last one is especially useful if 1) you think an important file has been deleted or 2) if you install something and have no idea what the executable file in the package is supposed to be.

   Send article as PDF   

Similar Posts