- Details
- Category: Terminal Window
- Hits: 2956
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
- Details
- Category: Terminal Window
- Hits: 610
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
locate
terminal example finding my.cnf for mysql
xxx@xxxxxxxxx:~$ locate my.cnf
/etc/mysql/my.cnf
/home/tom/my.cnf
/home/tom/.kde/share/apps/amarok/my.cnf
/opt/lampp/etc/my.cnf
DESCRIPTION
This manual page documents the GNU version of locate. For each given
pattern, locate searches one or more databases of file names and
displays the file names that contain the pattern. Patterns can contain
shell-style metacharacters: `*', `?', and `[]'. The metacharacters do
not treat `/' or `.' specially. Therefore, a pattern `foo*bar' can
match a file name that contains `foo3/bar', and a pattern `*duck*' can
match a file name that contains `lake/.ducky'. Patterns that contain
metacharacters should be quoted to protect them from expansion by the
shell.
If a pattern is a plain string -- it contains no metacharacters --
locate displays all file names in the database that contain that string
anywhere. If a pattern does contain metacharacters, locate only
displays file names that match the pattern exactly. As a result,
patterns that contain metacharacters should usually begin with a `*',
and will most often end with one as well. The exceptions are patterns
that are intended to explicitly match the beginning or end of a file
name.
The file name databases contain lists of files that were on the system
when the databases were last updated. The system administrator can
choose the file name of the default database, the frequency with which
the databases are updated, and the directories for which they contain
entries; see updatedb(1).
If locate's output is going to a terminal, unusual characters in the
output are escaped in the same way as for the -print action of the find
command. If the output is not going to a terminal, file names are
printed exactly as-is.
OPTIONS
-0, --null
Use ASCII NUL as a separator, instead of newline.
-A, --all
Print only names which match all non-option arguments, not those
matching one or more non-option arguments.
-b, --basename
Results are considered to match if the pattern specified matches
the final component of the name of a file as listed in the
database. This final component is usually referred to as the
`base name'.
-c, --count
Instead of printing the matched filenames, just print the total
number of matches we found, unless --print (-p) is also present.
-d path, --database=path
Instead of searching the default file name database, search the
file name databases in path, which is a colon-separated list of
database file names. You can also use the environment variable
LOCATE_PATH to set the list of database files to search. The
option overrides the environment variable if both are used.
Empty elements in the path are taken to be synonyms for the file
name of the default database. A database can be supplied on
stdin, using `-' as an element of path. If more than one element
of path is `-', later instances are ignored (and a warning
message is printed).
The file name database format changed starting with GNU find and
locate version 4.0 to allow machines with different byte
orderings to share the databases. This version of locate can
automatically recognize and read databases produced for older
versions of GNU locate or Unix versions of locate or find.
Support for the old locate database format will be discontinued
in a future release.
-e, --existing
Only print out such names that currently exist (instead of such
names that existed when the database was created). Note that
this may slow down the program a lot, if there are many matches
in the database. If you are using this option within a program,
please note that it is possible for the file to be deleted after
locate has checked that it exists, but before you use it.
-E, --non-existing
Only print out such names that currently do not exist (instead
of such names that existed when the database was created). Note
that this may slow down the program a lot, if there are many
matches in the database.
--help Print a summary of the options to locate and exit.
-i, --ignore-case
Ignore case distinctions in both the pattern and the file names.
-l N, --limit=N
Limit the number of matches to N. If a limit is set via this
option, the number of results printed for the -c option will
never be larger than this number.
-L, --follow
If testing for the existence of files (with the -e or -E
options), consider broken symbolic links to be non-existing.
This is the default.
--max-database-age D
Normally, locate will issue a warning message when it searches a
database which is more than 8 days old. This option changes
that value to something other than 8. The effect of specifying
a negative value is undefined.
-m, --mmap
Accepted but does nothing, for compatibility with BSD locate.
-P, -H, --nofollow
If testing for the existence of files (with the -e or -E
options), treat broken symbolic links as if they were existing
files. The -H form of this option is provided purely for
similarity with find; the use of -P is recommended over -H.
-p, --print
Print search results when they normally would not, because of
the presence of --statistics (-S) or --count (-c).
-r, --regex
The pattern specified on the command line is understood to be a
regular expression, as opposed to a glob pattern. The Regular
expressions work in the same was as in emacs and find, except
for the fact that "." will match a newline. Filenames whose
full paths match the specified regular expression are printed
(or, in the case of the -c option, counted). If you wish to
anchor your regular expression at the ends of the full path
name, then as is usual with regular expressions, you should use
the characters ^ and $ to signify this.
-s, --stdio
Accepted but does nothing, for compatibility with BSD locate.
-S, --statistics
Print various statistics about each locate database and then
exit without performing a search, unless non-option arguments
are given. For compatibility with BSD, -S is accepted as a
synonym for --statistics. However, the ouptut of locate -S is
different for the GNU and BSD implementations of locate.
--version
Print the version number of locate and exit.
-w, --wholename
Match against the whole name of the file as listed in the
database. This is the default.
- Details
- Category: Terminal Window
- Hits: 455
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Command line options available for the mount command:
-V Output version.
-h Print a help message.
-v Verbose mode.
-a Mount all filesystems (of the given types) mentioned in fstab.
FILES
/etc/fstab file system table
/etc/mtab table of mounted file systems
/etc/mtab~ lock file
/etc/mtab.tmp temporary file
/etc/filesystems a list of filesystem types to try
- Details
- Category: Terminal Window
- Hits: 451
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Xkill
A terminal command to kill running windows and applications in ubuntu.
NAME
xkill - kill a client by its X resource
SYNOPSIS
xkill [-display displayname] [-id resource] [-button number] [-frame]
[-all]
DESCRIPTION
Xkill is a utility for forcing the X server to close connections to
clients. This program is very dangerous, but is useful for aborting
programs that have displayed undesired windows on a user's screen. If
no resource identifier is given with -id, xkill will display a special
cursor as a prompt for the user to select a window to be killed. If a
pointer button is pressed over a non-root window, the server will close
its connection to the client that created the window.
OPTIONS
-display displayname
This option specifies the name of the X server to contact.
-id resource
This option specifies the X identifier for the resource whose
creator is to be aborted. If no resource is specified, xkill
will display a special cursor with which you should select a
window to be kill.
-button number
This option specifies the number of pointer button that should
be used in selecting a window to kill. If the word "any" is
specified, any button on the pointer may be used. By default,
the first button in the pointer map (which is usually the
leftmost button) is used.
-all This option indicates that all clients with top-level windows
on the screen should be killed. Xkill will ask you to select
the root window with each of the currently defined buttons to
give you several chances to abort. Use of this option is
highly discouraged.
-frame This option indicates that xkill should ignore the standard
conventions for finding top-level client windows (which are
typically nested inside a window manager window), and simply
believe that you want to kill direct children of the root.
CAVEATS
This command does not provide any warranty that the application whose
connection to the X server is closed will abort nicely, or even abort
at all. All this command does is to close the connection to the X
server. Many existing applications do indeed abort when their
connection to the X server is closed, but some can choose to continue.
XDEFAULTS
Button Specifies a specific pointer button number or the word "any" to
use when selecting windows.
SEE ALSO
X(7), xwininfo(1), XKillClient and XGetPointerMapping in the Xlib
Programmers Manual, KillClient in the X Protocol Specification
AUTHOR
Jim Fulton, MIT X Consortium
Dana Chee, Bellcore
- Details
- Category: Terminal Window
- Hits: 471
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Repositories/CommandLine
Reference to good raring repositories http://ubuntuforums.org/showthread.php?t=2182288
Ubuntu uses apt for package management. Apt stores a list of repositories or software channels in the file
/etc/apt/sources.list
By editing this file from the command line, we can add, remove, or temporarily disable software repositories.
Note: It's always a good idea to backup a configuration file like sources.list before you edit it. To do so, issue the following command:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
- Details
- Category: Terminal Window
- Hits: 460
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Disable apache2 services on boot........
###########################################
Terminal
###########################################
disabled using terminal
sudo update-rc.d -f apache2 disable
###########################################
graphical frontend
###########################################
Boot-Up Manager BUM
Are use a Boot-Up Manager http://www.marzocca.net/linux/bum.html.......BUM
apt-get install bum
You can find it in synaptic
Mark for installation
bum
###################
jobs-admin
jobs-admin https://launchpad.net/jobsadmin
jobs-admin is a graphical frontend to allow for easy job/service administration. It uses jobservice as its backend.
You can find it in synaptic
Mark for installation
jobs-admin
will also install
jobservice
- Details
- Category: Terminal Window
- Hits: 441
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Disable services on boot – mySQL
comment out the following line in the config file
sudo gedit /etc/init/mysql.conf
#start on runlevel [2345]
- Details
- Category: Terminal Window
- Hits: 440
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Handling (Tar/GZip) and (Tar/Bzip2) archives
To extract:
tar xvf packagename.tar.gz
Note: tar is an application which can extract files from an archive, decompressing if necessary.
-x means extract.
-v means verbose (list what it is extracting).
-f specifies the file to use.
Decompressing ".gz" files
gunzip file.gz
Decompressing ".bz2" files
bunzip2 file.bz2
Note: You can also decompress a package first by using the command gunzip (for .gz) or bunzip2 (for .bz2), leaving the .tar file. You would then use tar to extract it.
To create a .gz archive:
tar cvfz packagename.tar.gz folder
To create a .bz2 archive:
tar cvfj packagename.tar.bz2 folder
- Details
- Category: Terminal Window
- Hits: 453
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Ubuntu documentation
Search commands
-
apt-cache search <search_term>
This command will find packages that include <search_term>.
-
dpkg -l *<search_term>*
This will find packages whose names contain <search_term>. Similar to apt-cache search, but also shows whether a package is installed on your system by marking it with ii (installed) and un (not installed).
-
apt-cache show <package_name>
This command shows the description of package <package_name> and other relevant information including version, size, dependencies and conflicts.
-
dpkg --print-avail <package_name>
This command is similar to "apt-cache show". -
dpkg -L <package_name>
This command will list files in package <package_name>.
-
dpkg -c foo.deb
This command lists files in the package "foo.deb". Note that foo.deb is a pathname. Use this command on .deb packages that you have manually downloaded.
-
dlocate <package_name>
This command determines which installed package owns <package_name>. It shows files from installed packages that match <package_name>, with the name of the package they came from. Consider this to be a "reverse lookup" utility.
In order to use this command, the package dlocate must be installed on your system.
-
dpkg -S <package_name>
This command does the same as dlocate, but does not require the installation of any additional packages. It is slower than dlocate but has the advantage of being installed by default on all Debian and Ubuntu systems.
-
apt-file search <package_name>
This command acts like dlocate and dpkg -S, but searches all available packages. It answers the question, "what package provides this file?".-
apt-file needs to be updated regularly like apt-get. Use the command:
apt-file update
In order to use this command, the package apt-file must be installed on your system.
-
-
apt-cache pkgnames
This command provides a listing of every package in the system -
A general note on searching: If searching for a generates a list that is too long, you can filter your results by piping them through the command grep. Examples:
-
apt-cache search filename | grep -w filename
will show only the files that contain filename as a whole word -
dpkg -L package | grep /usr/bin
will list files located in the directory /usr/bin, useful if you're looking for a particular executable.
-
For more information on apt-get, apt-cache and dpkg consult their manual pages by using the man command. These manuals will provide a wider scope of information in addition to all of the options that you can use with each program.
Example:
man apt-get
- Details
- Category: Terminal Window
- Hits: 430
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Removal commands
-
apt-get remove <package_name>
This command removes an installed package, leaving configuration files intact. -
apt-get purge <package_name>
This command completely removes a package and the associated configuration files. Configuration files residing in ~ are not usually affected by this command.- + operator
-
If you want to remove package1 and install package2 in one step:
apt-get remove <package1> <package2>+
.
-
- + operator
-
apt-get autoremove
This command removes packages that were installed by other packages and are no longer needed.-
apt-get autoremove <package_name>
This command removes an installed package and dependencies.
-
-
While there is no built in way to remove all of your configuration information from your removed packages you can remove all configuration data from every removed package with the following command.
dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge
- Details
- Category: Terminal Window
- Hits: 437
{eks}catid=87|keyword=terminal|teaser|alpha{/eks}
Ubuntu documentation
apt-get Maintenance commands
-
apt-get update
Run this command after changing /etc/apt/sources.list or /etc/apt/preferences . For information regarding /etc/apt/preferences, see PinningHowto. Run this command periodically to make sure your source list is up-to-date. This is the equivalent of "Reload" in Synaptic or "Fetch updates" in Adept.
-
apt-get upgrade
This command upgrades all installed packages. This is the equivalent of "Mark all upgrades" in Synaptic. -
apt-get dist-upgrade
The same as the above, except add the "smart upgrade" checkbox. It tells APT to use "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary."apt-get dist-upgrade" does not perform distribution upgrade. See [http://www.ubuntu.com/getubuntu/upgrading upgrading] for more information.
-
apt-get check
This command is a diagnostic tool. It does an update of the package lists and checks for broken dependencies. -
apt-get -f install
This command does the same thing as Edit->Fix Broken Packages in Synaptic. Do this if you get complaints about packages with "unmet dependences".
-
apt-get autoclean
This command removes .deb files for packages that are no longer installed on your system. Depending on your installation habits, removing these files from /var/cache/apt/archives may regain a significant amount of diskspace.
-
apt-get clean
The same as above, except it removes all packages from the package cache. This may not be desirable if you have a slow internet connection, since it will cause you to redownload any packages you need to install a program.
-
The package cache is in /var/cache/apt/archives . The command
du -sh /var/cache/apt/archives
will tell you how much space cached packages are consuming.
-
-
dpkg-reconfigure <package_name>
Reconfigure the named package. With many packages, you’ll be prompted with some configuration questions you may not have known were there.-
For example:
dpkg-reconfigure fontconfig-config
will present you with a "wizard" on configuring fonts in Ubuntu.
-
-
echo "<package_name> hold" | dpkg --set-selections
This command places the desired package on hold.
-
This command may have the unintended side effect of preventing upgrades to packages that depend on updated versions of the pinned package. apt-get dist-upgrade will override this, but will warn you first. If you want to use this command with sudo, you need to use echo "<package_name> hold" | sudo dpkg --set-selections not sudo echo "<package_name> hold" | dpkg --set-selections.
-
-
echo "<package_name> install" | dpkg --set-selections
This command removes the "hold" or "locked package" state set by the above command. The note above about sudo usage applies to this command.