linux-commands

Mostly for Debian, some Arch

Packages

To see all the files the package installed onto your system, do this:
dpkg-query -L

To see the files a .deb file will install
dpkg-query -c <package_name.deb>

To see the files contained in a package NOT installed, do this once (if you haven’t installed apt-file already:
sudo apt-get install apt-file
sudo apt-file update

then
apt-file list ‘package_name’

to find a file:

1
2
3
4
5
$ find / -name 'program.c' 2>/dev/null
$ find / -name 'program.c' 2>errors.txt

#find -mtime -3 (last 3 days)
#du | less to see size of all directories
/ Start searching from the root directory (i.e / directory)}
-name Given search text is the filename rather than any other attribute of a file
‘program.c’ Search text that we have entered. Always enclose the filename in single quotes.. why to do this is complex.. so simply do so.

Package manager hierarchy on Debian:
dpkg –> apt-get, aptitude –> Synaptic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# dpkg -i DEB_PACKAGE
# dpkg -r PACKAGE_NAME

;;To List all Installed Packages
# dpkg -l *.deb | less

;;To Remove a Package and its Configuration files
# sudo dpkg -P {package_name}

;;To check Wether the package installed are not
# dpkg -l {package_name}

;;show the Location
# sudo dpkg -S {package_name}

# man dpkg

# dpkg -x {package_name} {location_were_to_extract}

Debian installation of a package

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

;;----install sources-----
;; Now, first get the source package:
apt-get source foo
;;and change to the source tree:
cd foo-*
;;Then install needed build-dependencies (if any):
sudo apt-get build-dep foo
;;Then create a dedicated version of your own build (so that you won't get confused later when Debian itself releases a new version)
dch -l local 'Blah blah blah'
;;And finally build your package
debuild -us -uc
;;If everything worked out fine, you should now be able to install your package by running
sudo dpkg -i ../*.deb



$ tar zxf file.tar.gz
$ tar zxf file.tgz
$ tar jxf file.tar.bz2
$ tar jxf file.tbz2
$ tar xf file.tar.xz

;;Now change directory
$ ls
$ cd path-to-software/
# ./configure
# make
# make install

dpkg-source -x foo_version-revision.dsc

will extract the package into a directory called foo-version.

If you want just to compile the package, you may cd into foo-version directory and issue the command

 dpkg-buildpackage -rfakeroot -b

to build the package (note that this also requires the fakeroot package), and then

 dpkg -i ../foo_version-revision_arch.deb

to install the newly-built package(s).

Mail

$mail

To delete message 21
& d 21

To delete messages 1-10
& d 1-10

Only works if you exit properly:

& quit OR
& q

Share