Applications and commando’s locations Debian Wheezy 7

Applications and commando’s locations Debian Wheezy 7.

When we search for applications and files available in our system you don’t see such directory like Programs Files.
Our programs, files and services are divided over many directories instead of other systems.
In a Windows system you’ll find your applications in the default folder C:\Programs.Files and C:\ProgramsFiles (x86).
Our applications, services and users are stored in the root directory.The root is the start of everything in our system.
Let’s see how this looks like.
Start your terminal and navigate into the / (directory root).
The bold text in this tutorial are commando’s and its last outputs are red.
We’re in our home directory when we open our terminal.
Type cd / + enter.
Verify with pwd and you’ll see your working directory is root /.
Execute ls that reveals the subdirectories of root.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ cd /
anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls
bin   etc         lib         mnt   root  selinux  tmp  vmlinuz
boot  home        lost+found  opt   run   srv      usr
dev   initrd.img  media       proc  sbin  sys      var
anne0001@beta:/$

We can see who’s the owner of the root directory as followed.
Type ls -l + enter.
Notice the whole directory is owned by the root user.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls -l
total 84
drwxr-xr-x   2 root root  4096 Nov 13 21:39 bin
drwxr-xr-x   3 root root  4096 Nov 13 21:51 boot
drwxr-xr-x  14 root root  3160 Nov 14 11:14 dev
drwxr-xr-x 132 root root 12288 Nov 14 11:14 etc
drwxr-xr-x   3 root root  4096 Nov 13 21:54 home
lrwxrwxrwx   1 root root    32 Nov 13 20:52 initrd.img -> /boot/initrd.img-3.2.0-4-686-pae
drwxr-xr-x  16 root root  4096 Nov 13 21:38 lib
drwx——   2 root root 16384 Nov 13 20:47 lost+found
drwxr-xr-x   3 root root  4096 Nov 13 20:47 media
drwxr-xr-x   2 root root  4096 Oct  7 17:25 mnt
drwxr-xr-x   2 root root  4096 Nov 13 20:48 opt
dr-xr-xr-x 135 root root     0 Nov 14 11:12 proc
drwx——   4 root root  4096 Nov 13 21:48 root
drwxr-xr-x  19 root root   840 Nov 14 11:15 run
drwxr-xr-x   2 root root  4096 Nov 13 21:57 sbin
drwxr-xr-x   2 root root  4096 Jun 10  2012 selinux
drwxr-xr-x   2 root root  4096 Nov 13 20:48 srv
drwxr-xr-x  13 root root     0 Nov 14 11:12 sys
drwxrwxrwt  11 root root  4096 Nov 14 15:34 tmp
drwxr-xr-x  10 root root  4096 Nov 13 20:48 usr
drwxr-xr-x  12 root root  4096 Nov 13 21:45 var
lrwxrwxrwx   1 root root    28 Nov 13 20:52 vmlinuz -> boot/vmlinuz-3.2.0-4-686-pae
anne0001@beta:/$

As we said our applications are divided over different directories and files.
A incomplete list of folders that contains application files and directories displayed below.
/bin
/sbin
/usr
/usr/bin
/usr/sbin
/usr/share
/usr/local
/usr/local/games
/usr/lib
etc……

Let’s take a small guide through some of them.
In the directory /sbin you’ll find subdirectories and files that contains many commando’s used by system configuration purposes.
Important commando’s like fdisk, iptables, ifconfig, iwconfig, shutdown, etc…
Let’s see what we get here.
Type ls sbin + enter.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls sbin
acpi_available       ip                 ntfsresize
agetty               ip6tables          ntfsundelete
apm_available        ip6tables-restore  on_ac_power
badblocks            ip6tables-save     osd_login
blkid                ipmaddr            pam_tally
blockdev             iptables           pam_tally2
capsh                iptables-restore   pccardctl
cfdisk               iptables-save      pivot_root
crda                 iptunnel           plipconfig
cryptsetup           isosize            poweroff
ctrlaltdel           iw                 rarp
debugfs              iwconfig           raw
depmod               iwevent            reboot
dhclient             iwgetid            regdbdump
dhclient-script      iwlist             resize2fs
discover             iwpriv             rmmod
discover-modprobe    iwspy              route
discover-pkginstall  kbdrate            rpcbind
dmsetup              killall5           rpc.statd
dosfsck              ldconfig           rtacct
dosfslabel           logsave            rtmon
dumpe2fs             losetup            runlevel
e2fsck               lsmod              setcap
e2image              lspcmcia           sfdisk
e2label              mii-tool           shadowconfig
e2undo               mkdosfs            showmount
fdisk                mke2fs             shutdown
findfs               mkfs               slattach
fsck                 mkfs.bfs           sm-notify
fsck.cramfs          mkfs.cramfs        startpar
fsck.ext2            mkfs.ext2          startpar-upstart-inject
fsck.ext3            mkfs.ext3          start-stop-daemon
fsck.ext4            mkfs.ext4          sulogin
fsck.ext4dev         mkfs.ext4dev       swaplabel
fsck.minix           mkfs.minix         swapoff
fsck.msdos           mkfs.msdos         swapon
fsck.nfs             mkfs.ntfs          switch_root
fsck.vfat            mkfs.vfat          sysctl
fsfreeze             mkhomedir_helper   tc
fstab-decode         mkntfs             telinit
fstrim               mkswap             tune2fs
getcap               modinfo            udevadm
getpcaps             modprobe           udevd
getty                mount.fuse         umount.nfs
halt                 mount.lowntfs-3g   umount.nfs4
hdparm               mount.nfs          umount.udisks
hwclock              mount.nfs4         unix_chkpwd
ifconfig             mount.ntfs         unix_update
ifdown               mount.ntfs-3g      wipefs
ifquery              mount.vboxsf       wpa_action
ifup                 nameif             wpa_cli
init                 nfnl_osf           wpa_supplicant
insmod               ntfsclone          xtables-multi
insserv              ntfscp
installkernel        ntfslabel
anne0001@beta:/$

This long list can be overwhelming and difficult to overview.
We can avoid this by using a argument.
Our command will look like, command + path directory you prefer + /argument + wild card.
We’re interested in subdirectories and files available started by the characters if.
Let’s see what list we get.
Type ls sbin/if* + enter.
Now we see our small list filtered by if

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls sbin/if*
sbin/ifconfig  sbin/ifdown  sbin/ifquery  sbin/ifup
anne0001@beta:/$

How many directories and files are available started by f?
Our argument must focus on f followed by *.
We’re only interested in those directories started by the characters f.
Type ls sbin/f* + enter.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls sbin/f*
sbin/fdisk        sbin/fsck.ext2     sbin/fsck.minix  sbin/fsfreeze
sbin/findfs       sbin/fsck.ext3     sbin/fsck.msdos  sbin/fstab-decode
sbin/fsck         sbin/fsck.ext4     sbin/fsck.nfs    sbin/fstrim
sbin/fsck.cramfs  sbin/fsck.ext4dev  sbin/fsck.vfat
anne0001@beta:/$

Hmm to much directories and files displayed here?
Well we’ll ad one more argument to reduce our list to a minimum displayed items.
Our command will look like, command + path directory you prefer + /first argument + * + second argument.
Let’s filter our directories started by f and ended by s.
You see a short list here.
Type ls sbin/f*s + enter.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls sbin/f*s
sbin/findfs  sbin/fsck.cramfs  sbin/fsck.msdos  sbin/fsck.nfs
anne0001@beta:/$

The directory bin contains user commando’s like, cp, chmod, less, open, dir, etc…
Command ls in this directory will produce a very long list of applications en files.
Just execute ls /bin + enter if you like.
We prefer the reduced list by using another manner.
In our command we’ll use a pipe followed by a second command followed by a argument.
Our command will look like command + path directory you prefer + pipe + second command + argument.
We’re interested in command en files that contains the characters nt.
Type ls bin | grep nt + enter.
This’ll display only those items containing nt.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls bin | grep nt
findmnt
fusermount
lowntfs-3g
mount
mountpoint
ntfs-3g
ntfs-3g.probe
ntfs-3g.secaudit
ntfs-3g.usermap
ntfscat
ntfsck
ntfscluster
ntfscmp
ntfsdump_logfile
ntfsfix
ntfsinfo
ntfsls
ntfsmftalloc
ntfsmove
ntfstruncate
ntfswipe
setfont
umount
anne0001@beta:/$

We have another directory that contains a very long list of subdirectories and files.
Directory usr/share contains applications like iceweasel, java, brasero, Libreoffice, nautilus, etc…
We’ll filter our list by using our command as above.
Display the items containing lib.
Type ls usr/share | grep lib + enter.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls usr/share | grep lib
glib-2.0
libaudio2
libc-bin
libexttextcat
libgksu
libgnomekbd
libgnome-media-profiles
libgphoto2
libgweather
liblouis
libnm-gtk
libquvi-scripts
librarian
libreoffice
libsensors4
libsocialweb
libthai
libvisual-plugins-0.4
libwacom
anne0001@beta:/$

Feel free and explore more.
A few examples we’ve executed showed below.
We’ve typed ls usr/share | grep gnome + enter.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls usr/share | grep gnome
gnome
gnome-2.0
gnome-applets
gnome-background-properties
gnome-bluetooth
gnome-color-manager
gnome-control-center
gnome-dictionary
gnome-documents
gnome-games
gnome-js
gnome-mag
gnome-nettool
gnome-packagekit
gnome-panel
gnome-power-manager
gnome-screenshot
gnome-session
gnome-settings-daemon
gnome-shell
gnome-sound-recorder
gnome-sudoku
gnome-system-log
gnome-system-monitor
gnome-terminal
gnome-tweak-tool
gnome-user-share
gnome-video-effects
libgnomekbd
libgnome-media-profiles
anne0001@beta:/$

And here we have executed ls usr/share/sy* + enter.
Notice path descriptions and its contents in this output.

anne0001@beta:/$ pwd
/
anne0001@beta:/$ ls usr/share/sy*
usr/share/synaptic:
gtkbuilder  html  pixmaps

usr/share/sysvinit:
inittab  update-rc.d

usr/share/sysv-rc:
saveconfig
anne0001@beta:/$

There are much more directories and files available we have not discussed yet like the applications libraries.
Feel free to explore them and you can review the examples above.
If you don’t know what a command or application does you can execute the whatis + naam command or application name.
We’ll see how we can get the location of applications.
There are many tools we can use like whereis, locate, find and which.
Let’s see what whereis, locate, find, and which stands for.
Start in your home directory.
Type whatis whereis + enter.
The whereis is used to find the executables, location and man pages.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ whatis whereis
whereis (1)          – locate the binary, source, and manual page files for a…
anne0001@beta:~$

Repeat this command with the argument locate, find and which.
We have just discovered that locate searches in files by names.
Find w’ll search files in our folder structure and which locates user commando’s.
That’s good to know while we’re searching the locations we prefer.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ whatis whereis
whereis (1)          – locate the binary, source, and manual page files for a…
anne0001@beta:~$ whatis locate
locate (1)           – find files by name
anne0001@beta:~$ whatis find
find (1)             – search for files in a directory hierarchy
anne0001@beta:~$ whatis which
which (1)            – locate a command
anne0001@beta:~$

Let’s start our application tour and get the location of it.
Where’s whereis located?
Which command will we use to know the location of commands?
We’ve seen the meaning of which showed above.
Type which whereis + enter.
Whereis location is /usr/bin/whereis.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ which whereis
/usr/bin/whereis
anne0001@beta:~$

We know there’s a nice program called gimp.
Gimp is used to pimp your pictures and other materials.
Where’s gimp located?
Now we’ll use whereis + name of our application we prefer.
Type whereis gimp + enter.
This application uses a lot of directories displayed below.
Notice the directory that contains the man1 page of gimp.
We think the executable of gimp is located in/usr/bin/gimp but we’ll discuss thisitem later on.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ whereis gimp
gimp: /usr/bin/gimp /etc/gimp /usr/lib/gimp /usr/bin/X11/gimp /usr/share/gimp /usr/share/man/man1/gimp.1.gz
anne0001@beta:~$

We were interested in the applications displayed below.
Type whereis followed by the name you prefer.
We used the applications tomboy, vim, synaptic and iceweasel.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ whereis tomboy
tomboy: /usr/bin/tomboy /usr/lib/tomboy /usr/bin/X11/tomboy /usr/share/tomboy /usr/share/man/man1/tomboy.1.gz
anne0001@beta:~$ whereis vim
vim: /usr/bin/vim.tiny /etc/vim /usr/bin/X11/vim.tiny /usr/share/vim /usr/share/man/man1/vim.1.gz
anne0001@beta:~$ whereis synaptic
synaptic: /usr/sbin/synaptic /usr/share/synaptic /usr/share/man/man8/synaptic.8.gz
anne0001@beta:~$ whereis iceweasel
iceweasel: /usr/bin/iceweasel /etc/iceweasel /usr/lib/iceweasel /usr/bin/X11/iceweasel /usr/share/iceweasel /usr/share/man/man1/iceweasel.1.gz
anne0001@beta:~$

We can discover which files applications use and we can see what kind of extensions they’ve.
This is useful for system administrators and advanced users who like to change the behavior of applications.
Let’s see which files is used by synaptic located in /usr/share/synaptic.
We know it’s location so we’ll use the find command followed by it’s path to see our files.
Type find synaptic + /usr/share/synaptic + enter.
Be aware, this can be a very very long list.
In our example you see 2 full paths displayed containing many files.
/usr/share/synaptic/gtkbuilder and /usr/share/synaptic/pixmaps.
( incomplete list displayed below ).

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ find /usr/share/synaptic
/usr/share/synaptic
/usr/share/synaptic/gtkbuilder
/usr/share/synaptic/gtkbuilder/stock_menu_about.png
/usr/share/synaptic/gtkbuilder/dialog_update_outdated.ui
/usr/share/synaptic/gtkbuilder/dialog_proposed_new_repositories.ui
/usr/share/synaptic/gtkbuilder/window_find.ui
/usr/share/synaptic/gtkbuilder/proceed_small.png
/usr/share/synaptic/gtkbuilder/druid_repository.ui
/usr/share/synaptic/gtkbuilder/dialog_quit.ui
/usr/share/synaptic/gtkbuilder/update_small.png
/usr/share/synaptic/gtkbuilder/window_main.ui
/usr/share/synaptic/gtkbuilder/dialog_disc_label.ui
/usr/share/synaptic/gtkbuilder/window_changes.ui
/usr/share/synaptic/gtkbuilder/window_filters.ui
/usr/share/synaptic/gtkbuilder/dialog_columns.ui
/usr/share/synaptic/gtkbuilder/stock_help-book.png
/usr/share/synaptic/gtkbuilder/window_tasks.ui
/usr/share/synaptic/gtkbuilder/dialog_new_repositroy.ui
/usr/share/synaptic/gtkbuilder/window_preferences.ui
/usr/share/synaptic/gtkbuilder/dialog_task_descr.ui
/usr/share/synaptic/gtkbuilder/window_logview.ui
/usr/share/synaptic/gtkbuilder/dialog_example.ui
/usr/share/synaptic/gtkbuilder/window_about.ui
/usr/share/synaptic/gtkbuilder/window_disc_name.ui
/usr/share/synaptic/gtkbuilder/dialog_changelog.ui
/usr/share/synaptic/gtkbuilder/logo.png
/usr/share/synaptic/gtkbuilder/pref_vpaned.xpm
/usr/share/synaptic/gtkbuilder/dialog_unmet.ui
/usr/share/synaptic/gtkbuilder/window_rginstall_progress.ui
/usr/share/synaptic/gtkbuilder/dialog_download_error.ui
/usr/share/synaptic/gtkbuilder/dialog_authentication.ui
/usr/share/synaptic/gtkbuilder/dialog_update_failed.ui
/usr/share/synaptic/gtkbuilder/dialog_change_version.ui
/usr/share/synaptic/gtkbuilder/stock_filter-data-by-criteria.png
/usr/share/synaptic/gtkbuilder/distupgrade_small.png
/usr/share/synaptic/gtkbuilder/stock_filter-navigator.png
/usr/share/synaptic/gtkbuilder/window_iconlegend.ui
/usr/share/synaptic/gtkbuilder/window_setopt.ui
/usr/share/synaptic/gtkbuilder/window_details.ui
/usr/share/synaptic/gtkbuilder/window_zvtinstallprogress.ui
/usr/share/synaptic/gtkbuilder/window_summary.ui
/usr/share/synaptic/gtkbuilder/window_install_progress.ui
/usr/share/synaptic/gtkbuilder/window_rgdebinstall_progress.ui
/usr/share/synaptic/gtkbuilder/window_repositories.ui
/usr/share/synaptic/gtkbuilder/dialog_upgrade.ui
/usr/share/synaptic/gtkbuilder/upgrade_small.png
/usr/share/synaptic/gtkbuilder/cnc.png
/usr/share/synaptic/gtkbuilder/dialog_conffile.ui
/usr/share/synaptic/gtkbuilder/deb.png
/usr/share/synaptic/gtkbuilder/window_procceed.ui
/usr/share/synaptic/gtkbuilder/synaptic.xpm
/usr/share/synaptic/gtkbuilder/synaptic_mini.xpm
/usr/share/synaptic/gtkbuilder/pref_hpaned.xpm
/usr/share/synaptic/gtkbuilder/dialog_welcome.ui
/usr/share/synaptic/gtkbuilder/window_fetch.ui
/usr/share/synaptic/gtkbuilder/window_rginstall_progress_msgs.ui
/usr/share/synaptic/pixmaps
/usr/share/synaptic/pixmaps/green.png
/usr/share/synaptic/pixmaps/synaptic_32x32.xpm
/usr/share/synaptic/pixmaps/yellow.png
/usr/share/synaptic/pixmaps/red.png

We can search files by name using locate.
This will reveal full paths that contains files used by applications and services.
Our home directory is also divided over many places.
Let’s see how it look like. It’s amazing how many files are in use by Dekstop.
Type locate Desktop + enter.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
anne0001@beta:~$ locate Desktop
/home/anne0001/Desktop
/usr/lib/girepository-1.0/GDesktopEnums-3.0.typelib
/usr/lib/libreoffice/program/wizards/common/Desktop.py
/usr/lib/pymodules/python2.6/xdg/DesktopEntry.py
/usr/lib/pymodules/python2.6/xdg/DesktopEntry.pyc
/usr/lib/pymodules/python2.7/xdg/DesktopEntry.py
/usr/lib/pymodules/python2.7/xdg/DesktopEntry.pyc
/usr/share/man/man3/File::DesktopEntry.3pm.gz
/usr/share/perl5/File/DesktopEntry.pm
/usr/share/pyshared/xdg/DesktopEntry.py
anne0001@beta:~$

We can make a journey through our system that never ends.
Play en enjoy the possibilities you get.
We have done more examples showed below.
Notice the contents that has been saved by the user like pictures and documents.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
anne0001@beta:~$ locate Documents
/home/anne0001/Documents
/usr/share/dbus-1/services/org.gnome.Documents.GDataMiner.service
/usr/share/dbus-1/services/org.gnome.Documents.SearchProvider.service
/usr/share/glib-2.0/schemas/org.gnome.Documents.enums.xml
anne0001@beta:~$ locate Downloads
/home/anne0001/Downloads
/home/anne0001/Downloads/.~lock.Application_Locations.odt#
/home/anne0001/Downloads/Application_Locations.odt
/home/anne0001/Downloads/Default_Programs_Debian_Wheezy_7.odt
/home/anne0001/Downloads/new article.zip
/usr/lib/iceweasel/components/DownloadsStartup.js
/usr/lib/iceweasel/components/DownloadsUI.js
/usr/share/iceweasel/modules/DownloadsCommon.jsm
anne0001@beta:~$ locate Music
/home/anne0001/Music
/usr/share/perl/5.14.2/unicore/lib/Blk/MusicalS.pl
anne0001@beta:~$ locate Pictures
/home/anne0001/Pictures
/home/anne0001/Pictures/1.png
anne0001@beta:~$

How to find our application executables?
We can use the file command that will reveal more specific file information.
At all it can by difficult to find them but don’t give up, you’ll find your way out.
Let’s look to some of them like gimp, synaptic, libreOffice, etc….
First of all we have to know where the application is located.
Use the whereis command followed by the name application you prefer.
Type file + path + enter.
In this example you’ll see the path /usr/bin/gimp is linked to gimp-2.8.
Now you have to find out where gimp-2.8 is located by the whereis command.
Than execute file + the given path of gimp-2.8 and you’ll see this is a executable file.

anne0001@beta:~$ pwd
/home/anne0001
anne0001@beta:~$ whereis gimp
gimp: /usr/bin/gimp /etc/gimp /usr/lib/gimp /usr/bin/X11/gimp /usr/share/gimp /usr/share/man/man1/gimp.1.gz
anne0001@beta:~$ file /usr/bin/gimp
/usr/bin/gimp: symbolic link to `gimp-2.8′
anne0001@beta:~$ whereis gimp-2.8
gimp-2: /usr/bin/gimp-2.8 /usr/bin/X11/gimp-2.8
anne0001@beta:~$ file /usr/bin/gimp-2.8
/usr/bin/gimp-2.8: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x4be6b5c0c3f262db1fdb5a9eca1ebc38b62934b9, stripped
anne0001@beta:~$

Let’s see some more executables files of our selected applications.
We have chosen for Synaptic, vim, tomboy. You’re free in your choices of applications.
By Synaptic we’re in lucky, the first path contains our executable file.
Type the bold text displayed here.

anne0001@beta:~$ whereis synaptic
synaptic: /usr/sbin/synaptic /usr/share/synaptic /usr/share/man/man8/synaptic.8.gz
anne0001@beta:~$ file /usr/sbin/synaptic
/usr/sbin/synaptic: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x1dbc721d9863f48b1e7f762848f289664abb946d, stripped
anne0001@beta:~$

Let’s look which location tomboy have.

anne0001@beta:~$ whereis tomboy
tomboy: /usr/bin/tomboy /usr/lib/tomboy /usr/bin/X11/tomboy /usr/share/tomboy /usr/share/man/man1/tomboy.1.gz
anne0001@beta:~$ file /usr/bin/tomboy
/usr/bin/tomboy: a /usr/bin/env bash script, ASCII text executable
anne0001@beta:~$ file /usr/lib/tomboy
/usr/lib/tomboy: directory
anne0001@beta:~$ file /usr/bin/X11/tomboy
/usr/bin/X11/tomboy: a /usr/bin/env bash script, ASCII text executable
anne0001@beta:~$ file /usr/share/tomboy
/usr/share/tomboy: directory
anne0001@beta:~$ file  /usr/share/man/man1/tomboy.1.gz
/usr/share/man/man1/tomboy.1.gz: gzip compressed data, from Unix, max compression
anne0001@beta:~$

Sometimes it’s handy to find locations of different applications at once.
In this example we’ll use synaptic and vim.
Our output shows two executable files of synaptic and vim.

anne0001@beta:~$ whereis synaptic
synaptic: /usr/sbin/synaptic /usr/share/synaptic /usr/share/man/man8/synaptic.8.gz
anne0001@beta:~$ whereis vim
vim: /usr/bin/vim.tiny /etc/vim /usr/bin/X11/vim.tiny /usr/share/vim /usr/share/man/man1/vim.1.gz
anne0001@beta:~$ file /usr/sbin/synaptic /usr/bin/vim.tiny
/usr/sbin/synaptic: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x1dbc721d9863f48b1e7f762848f289664abb946d, stripped
/usr/bin/vim.tiny:  ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x18ec027c27af8f3fdc812003fc46aaeaf4c28814, stripped
anne0001@beta:~$

Now we’ve a good idea about applications and it’s files locations.
Keep in mind that this tutorial showed a small amount of possibilities.
Next time we’ll show you how we can open applications using our terminal.

Some handy tips you can use while you’re on a journey through this fancy system.
For very long command use the copy and past feature available in your terminal.
You can review the previous tutorial “Directory and File Management using Terminal Debian.
(
https://gnubizz2.wordpress.com/2013/11/06/directory-and-file-management-using-terminal-debian/ ).

Need some more help about commands and how to use applications?
You can advise –help, man and info pages.
Visit our tutorial “Important built-in information in Debian Wheezy 7 system.”
(
https://gnubizz2.wordpress.com/2013/10/30/important-built-in-information-in-debian-wheezy-7-system/).

We hope you have enjoyed it.
If you have any doubts or questions you can leave a comment.
See you next time. 😉

 

Advertisements

Directory and File Management using Terminal Debian.

Directory & File Management using Terminal Debian.

Our system is built up with directories and files. We’ll focus this discussion in using our home directory.
Most users are working in this directory.
We like to have our own data, documents, pictures, video’s, favorites, etc….
Our system has created a default folder structure as our home directory. It’s look like this example below.
Type in you terminal the bold text during this tutorial.
First of all we must know where we’re working from. Let’s take a look.
Type pwd + enter.
You can see anne’s working directory /home/anne.
Type ls + enter.
The sub directories structure displayed here.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
anne@alfa:~$

In the past we discussed the cd command to navigate through our system.
If you like you can review “Terminal exploration in home directory Debian Wheezy 7” tutorial.
In our example we have already made files in /Documents. Let’s take a look.
Type cd Documents+ enter.
Which files contains the directory Documents?
Type ls -l + enter.
We have files in our directory /Documents.
Notice the extension of the files.
Sometimes it’s not clear to see the extension of files.
We can see the extension with the command file.
Type file + name of the file + enter.
The file is a OpenDocument Text extension displayed in our example.

anne@alfa:~$ cd Documents
anne@alfa:~/Documents$ ls -l
total 44
-rw-r–r– 1 anne anne 24809 Oct 29 19:22 AJourneyIntoTheHeartOfDebianWheezy7..odt
-rw-r–r– 1 anne anne 13496 Oct 25 12:40 TerminalExplorationInHomeDirectoryDebianWheezy7.odt
anne@alfa:~/Documents$ file AJourneyIntoTheHeartOfDebianWheezy7..odt
AJourneyIntoTheHeartOfDebianWheezy7..odt: OpenDocument Text
anne@alfa:~/Documents$

TIP:
Sometimes files can have long names You don’t need to type the whole name, just copy and past it into  your terminal.
You can’t use the ctrl + c and ctrl + v, they’ve other meanings in our terminal!
Highlight the name of the file you prefer and richt click on it, choice copy.
Than type your command + space + richt click and choice paste + enter.
Example displayed below.

Highlight file, right click and click copy.

Capture

Type file + space + right click on the cursor and click paste followed by enter.

Capture1

Here you’ll see the OpenDocument Text extension showed below.

Capture2

We’ve another ls combination to view submaps or files in our home directory at once.
Review the help or man pages for more ls combinations available.
Start from your home directory ~/ (/home/anne)
Type ls -lR + enter.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ ls -lR
.:
total 32
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Desktop
drwxr-xr-x 2 anne anne 4096 Nov  3 13:02 Documents
drwxr-xr-x 2 anne anne 4096 Oct 26 17:58 Downloads
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Music
drwxr-xr-x 2 anne anne 4096 Nov  2 01:02 Pictures
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Public
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Templates
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Videos

. /Desktop:
total 0

. /Documents:
total 68
-rw-r–r– 1 anne anne 24809 Oct 29 19:22 AJourneyIntoTheHeartOfDebianWheezy7..odt
-rw-r–r– 1 anne anne 23685 Nov  2 16:23 DirectoryFileManagementUseTerminalDebianWheezy7..odt
-rw-r–r– 1 anne anne 13496 Oct 25 12:40 TerminalExplorationInHomeDirectoryDebianWheezy7.odt

. /Downloads:
total 0

. /Music:
total 0

. /Pictures:
total 276
-rw-r–r– 1 anne anne  17006 Oct 24 23:00 command1.png
-rw-r–r– 1 anne anne 107714 Oct 18 20:15 debian.png
-rw-r–r– 1 anne anne 149384 Oct 29 19:15 TOP.png

. /Public:
total 0

. /Templates:
total 0

. /Videos:
total 0
anne@alfa:~$

Now we’ll start to create our own directories and files.
Pay attention while naming directories and files! Try to avoid spaces. This will give erro’s like “no such file or directory.”
Let’s say we’ll create a dircetory named gnubizz in our home directory.
For more info about mdir you can advice the man, –help pages.
If you’re not sure about your working directory use the pwd or ls command.
Our working directory must be /home/anne.
Type mkdir + name of directory + enter.
As we can see the new directory Gnubizz.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ mkdir Gnubizz
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$

We’ll make another directory in the Gnubizz.
Go to Gnubizz with the cd command ( cd Gnubizz ).
Create a directory named OpenSource.
Type mkdir + OpenSource + enter.
After that return to your home directory by the syntax cd ~.
To view our subdirectories in our home folder execute ls -lR.
Notice the directory Gnubizz contains the sub directory OpenSource.
The directory OpenSource is a child of the parent directory Gnubizz.

anne@alfa:~$ cd Gnubizz
anne@alfa:~/Gnubizz$ mkdir OpenSource
anne@alfa:~/Gnubizz$ ls
OpenSource
anne@alfa:~/Gnubizz$ cd ~
anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls -lR
.:
total 36
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Desktop
drwxr-xr-x 2 anne anne 4096 Nov  3 13:02 Documents
drwxr-xr-x 2 anne anne 4096 Oct 26 17:58 Downloads
drwxr-xr-x 3 anne anne 4096 Nov  3 14:59 Gnubizz
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Music
drwxr-xr-x 2 anne anne 4096 Nov  2 01:02 Pictures
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Public
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Templates
drwxr-xr-x 2 anne anne 4096 Oct 17 16:25 Videos

. /Desktop:
total 0

. /Documents:
total 68
-rw-r–r– 1 anne anne 24809 Oct 29 19:22 AJourneyIntoTheHeartOfDebianWheezy7..odt
-rw-r–r– 1 anne anne 23685 Nov  2 16:23 DirectoryFileManagementUseTerminalDebianWheezy7..odt
-rw-r–r– 1 anne anne 13496 Oct 25 12:40 TerminalExplorationInHomeDirectoryDebianWheezy7.odt

. /Downloads:
total 0

. /Gnubizz:
total 4
drwxr-xr-x 2 anne anne 4096 Nov  3 14:59 OpenSource

. /Gnubizz/OpenSource:
total 0

. /Music:
total 0

. /Pictures:
total 276
-rw-r–r– 1 anne anne  17006 Oct 24 23:00 command1.png
-rw-r–r– 1 anne anne 107714 Oct 18 20:15 debian.png
-rw-r–r– 1 anne anne 149384 Oct 29 19:15 TOP.png

. /Public:
total 0

. /Templates:
total 0

. /Videos:
total 0
anne@alfa:~$

We we’ll create more directories at once in our directory Gnubizz.
Create two directories named Gnubizz1 and Gnubizz2. Go to directory Gnubizz.
The working directory must by /home/anne/Gnubizz. By any doubts check it by pwd command.
Execute ls and you’ll see three directories Gnubizz1, Gnubizz2 and OpenSource displayed below
Type mkdir Gnubizz1 + space + Gnubizz2 + enter.

anne@alfa:~$ cd Gnubizz
anne@alfa:~/Gnubizz$ pwd
/home/anne/Gnubizz
anne@alfa:~/Gnubizz$ ls
OpenSource
anne@alfa:~/Gnubizz$ mkdir Gnubizz1 Gnubizz2
anne@alfa:~/Gnubizz$ ls
Gnubizz1  Gnubizz2  OpenSource
anne@alfa:~/Gnubizz$

We have seen how we create directories but sometimes we need to rename them.
We’ll rename the OpenSource to OpenSourceComputing.
We’re still in our Gnubizz directory that contains three maps, Gnubizz1  Gnubizz2  OpenSource.
Verify with ls and you w’ll see the name of the directory
OpenSource has changed into OpenSourceComputing.
Type mv + OpenSource + OpenSourceComputing + enter.

anne@alfa:~/Gnubizz$ pwd
/home/anne/Gnubizz
anne@alfa:~/Gnubizz$ ls
Gnubizz1  Gnubizz2  OpenSource
anne@alfa:~/Gnubizz$ mv OpenSource OpenSourceComputing
anne@alfa:~/Gnubizz$ ls
Gnubizz1  Gnubizz2  OpenSourceComputing
anne@alfa:~/Gnubizz$

We’re now able to make and change names of our directories.
Sometime we move them to another directory we like.
We’ll use the same command mv. We w’ll move directories Gnubizz1 and Gnubizz2 into our
OpenSourceComputing directory. First of all we need to known our path to move them.
Let’s see where the directory Gnubizz is located.
Start at your home directory and verify with pwd, /home/anne.
Execute ls to view your directory Gnubizz.
To find out the path of Gnubizz use locate command.
Now you w’ll see the path and submap path aswell of Gnubizz.
Before move directories we need to know the source path and the destination path of our directory.
Our syntax is as followed, mv + source directory + destination directory.
Typ locate + naam of directory + enter.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Gnubizz/Gnubizz1
/home/anne/Gnubizz/Gnubizz2
/home/anne/Gnubizz/OpenSource
anne@alfa:~$

Type mv ~/Gnubizz/Gnubizz1 + space + ~/Gnubizz/OpenSourceComputing + enter.
Verify with ls to see if Gnubizz1 has moved into the directory OpenSourceComputing.
Type ls Gnubizz/OpenSourceComputing.+ enter.
Notice Gnubizz1 has moved into OpenSourceComputing.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Gnubizz/Gnubizz1
/home/anne/Gnubizz/Gnubizz2
/home/anne/Gnubizz/OpenSource
anne@alfa:~$ mv ~/Gnubizz/Gnubizz1 ~/Gnubizz/OpenSourceComputing
anne@alfa:~$ ls Gnubizz/OpenSourceComputing
Gnubizz1
anne@alfa:~$

We can use the another description of our path to move our second directory Gnubizz2 into OpenSourceComputing.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Gnubizz/Gnubizz1
/home/anne/Gnubizz/Gnubizz2
/home/anne/Gnubizz/OpenSource
anne@alfa:~$ mv /home/anne/Gnubizz/Gnubizz2 /home/anne/Gnubizz/OpenSourceComputing
anne@alfa:~$ ls /Gnubizz/OpenSourceComputing
Gnubizz1  Gnubizz2
anne@alfa:~$

Sometimes we can have errors when we check this out.
The best way to check is use the ls command followed by the full path. In this example.
Type ls /home/anne/Gnubizz/OpenSourceComputing + enter.
Now our OpenSourceComputing contains two subdirectories Gnubizz1 and Gnubizz2.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Gnubizz/Gnubizz1
/home/anne/Gnubizz/Gnubizz2
/home/anne/Gnubizz/OpenSource
anne@alfa:~$ ls /home/anne/Gnubizz/OpenSourceComputing
Gnubizz1  Gnubizz2
anne@alfa:~$

The other description to the full path

anne@alfa:~$ ls ~/Gnubizz/OpenSourceComputing
Gnubizz1  Gnubizz2
anne@alfa:~$

We have seen how we can view, make, change names and move directories.
We’ll copy the whole directory Gnubizz on our Desktop.
As you have seen our directory Gnubizz contains subdirectory displayed below.
Type ls -R Gnubizz + enter.

anne@alfa:~$ ls -R Gnubizz
Gnubizz:
OpenSourceComputing

Gnubizz/OpenSourceComputing:
Gnubizz1  Gnubizz2

Gnubizz/OpenSourceComputing/Gnubizz1:

Gnubizz/OpenSourceComputing/Gnubizz2:

Now w’ll copy the directory Gnubizz and its contents on our Desktop by using the cp command.
You can advice the cp man or help pages to reveal more info.
Start at your home directory /home/anne.
We must know the source and destination path while using the cp command.
The syntax is as followed cp + source directory path + space  + destination directory path.
The -R will copy the whole directory into our Desktop. Notice the directory Gnubizz is copied into our Desktop.
Now we’ve two same Gnubizz directories, one in our Desktop and the other one in our home directory.
Type cp -R ~/Gnubizz ~/Desktop + enter.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ cp -R ~/Gnubizz ~/Desktop
anne@alfa:~$ ls Desktop
Gnubizz

Check this with the command ls from your home directory.
Notice you’ll see Gnubizz and it’s contents twice by Desktop and Your home directory.

anne@alfa:~$ ls -R
.:
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos

. /Desktop:
Gnubizz

. /Desktop/Gnubizz:
OpenSourceComputing

. /Desktop/Gnubizz/OpenSourceComputing:
Gnubizz1  Gnubizz2

. /Desktop/Gnubizz/OpenSourceComputin /Gnubizz1:

. /Desktop/Gnubizz/OpenSourceComputing/Gnubizz2:

. /Documents:
AJourneyIntoTheHeartOfDebianWheezy7..odt
DirectoryFileManagementUseTerminalDebianWheezy7..odt
TerminalExplorationInHomeDirectoryDebianWheezy7.odt

. /Downloads:

. /Gnubizz:
OpenSourceComputing

. /Gnubizz/OpenSourceComputing:
Gnubizz1  Gnubizz2

. /Gnubizz/OpenSourceComputing/Gnubizz1:

. /Gnubizz/OpenSourceComputing/Gnubizz2:

. /Music:

. /Pictures:
command1.png  debian.png  TOP.png

. /Public:

. /Templates:

. /Videos:
anne@alfa:~$

In our directories we have files. This file can be everything you like, video’s, documents, foto’s, songs etc…..
We have some files stored in our directory Documents and Pictures.
Start at your home directory.
Notice the file extensions stored at Documents and Pictures.
The pictures have the extension png and de documents odt.
Type ls -R + enter.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls -R
.:
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos

. /Desktop:
Gnubizz

. /Desktop/Gnubizz:
OpenSourceComputing

. /Desktop/Gnubizz/OpenSourceComputing:
Gnubizz1  Gnubizz2

. /Desktop/Gnubizz/OpenSourceComputing/Gnubizz1:

. /Desktop/Gnubizz/OpenSourceComputing/Gnubizz2:

. /Documents:
AJourneyIntoTheHeartOfDebianWheezy7..odt  A.odt  TerminalExplorationInHomeDirectoryDebianWheezy7.odt

. /Downloads:

. /Gnubizz:
OpenSourceComputing

. /Gnubizz/OpenSourceComputing:
Gnubizz1  Gnubizz2

. /Gnubizz/OpenSourceComputing/Gnubizz1:

. /Gnubizz/OpenSourceComputing/Gnubizz2:

. /Music:

. /Pictures:
command1.png  debian.png  TOP.png

. /Public:

. /Templates:

. /Videos:
anne@alfa:~$

w’ll make a text file using Pico in our terminal.
Go to the subdirectory Gnubizz in the directory Desktop.
To find the right path to Gnubizz you can use the command locate.
The path is /home/anne/Desktop/Gnubizz.
Type cd /home/anne/Desktop/Gnubizz

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Desktop/Gnubizz
/home/anne/Desktop/Gnubizz/OpenSourceComputing
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
/home/anne/Gnubizz/OpenSourceComputing
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz2
anne@alfa:~$ cd /home/anne/Desktop/Gnubizz
anne@alfa:~/Desktop/Gnubizz$

Our purpose is making a file into our Gnubizz directory.
Open Pico in your terminal and type some text you like.
Type pico + enter.

1

When you’re done editing you can press ctrl + x.
After ctrl + x you w’ll be asked what you want. If you like to save your file type Y.
If you press N your file w’ll be lost.

2

You will be asked to fill in your file name. Type your filename and press enter.
We’ve just created our file in Gnubizz.

3

Check in your Gnubizz directory using the ls commad.
Type ls + enter or if you prefer ls -l + enter.
Notice the new file in Gnubizz. In our example you w’ll see  our file named GnubizzSite.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Desktop/Gnubizz
/home/anne/Desktop/Gnubizz/OpenSourceComputing
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
/home/anne/Gnubizz/OpenSourceComputing
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz2
anne@alfa:~$ cd /home/anne/Desktop/Gnubizz
anne@alfa:~/Desktop/Gnubizz$ pico
anne@alfa:~/Desktop/Gnubizz$ ls
GnubizzSite  OpenSourceComputing
anne@alfa:~/Desktop/Gnubizz$ ls -l
total 8
-rw-r–r– 1 anne anne  450 Nov  5 18:43 GnubizzSite
drwxr-xr-x 4 anne anne 4096 Nov  4 16:09 OpenSourceComputing
anne@alfa:~/Desktop/Gnubizz$

Check the extension of our new file.
Our file Gnubizzsite has the extension ASCII text displayed below.
Type file GnubizzSite + enter.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Desktop/Gnubizz
/home/anne/Desktop/Gnubizz/OpenSourceComputing
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
/home/anne/Gnubizz/OpenSourceComputing
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz2
anne@alfa:~$ cd /home/anne/Desktop/Gnubizz
anne@alfa:~/Desktop/Gnubizz$ pico
anne@alfa:~/Desktop/Gnubizz$ ls
GnubizzSite  OpenSourceComputing
anne@alfa:~/Desktop/Gnubizz$ ls -l
total 8
-rw-r–r– 1 anne anne  450 Nov  5 18:43 GnubizzSite
drwxr-xr-x 4 anne anne 4096 Nov  4 16:09 OpenSourceComputing
anne@alfa:~/Desktop/Gnubizz$ file GnubizzSite
GnubizzSite: ASCII text
anne@alfa:~/Desktop/Gnubizz$

We’ll copy our file GnubizzSite to our subdirectories Gnubizz1 and Gnubizz2 in our Desktop.
Start at your Gnubizz directory and execute the locate command to display the path.
Type locate + Gnubizz1 + space + Gnubizz2 + enter to reveal the full path.
Copy our GnubizzSite file into our two subdirectories Gnubizz1 and Gnubizz2.
Type cp GnubizzSite + space + /home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
Repeat this command for the second directory.
You can use your arrow keys on your board to get your command back again.
Use your up arrow key and only change the 1 of Gbubizz1 to 2 like this:
cp GnubizzSite + space + /home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
Now we’ve three files named GnubizzSite in our dirctories, Gnubizz, Gnubizz1 and Gnubizz2 located in our Desktop.
Check this as followed. Type
ls /home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
and
ls /home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
and one more time.
type ls

anne@alfa:~/Desktop/Gnubizz$ locate Gnubizz1 Gnubizz2
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz2
anne@alfa:~/Desktop/Gnubizz$ ls
GnubizzSite  OpenSourceComputing
anne@alfa:~/Desktop/Gnubizz$ cp GnubizzSite /home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
anne@alfa:~/Desktop/Gnubizz$ cp GnubizzSite /home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
anne@alfa:~/Desktop/Gnubizz$ ls/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
GnubizzSite
anne@alfa:~/Desktop/Gnubizz$ ls/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
GnubizzSite
anne@alfa:~/Desktop/Gnubizz$ ls
GnubizzSite  OpenSourceComputing
anne@alfa:~/Desktop/Gnubizz$

Let’s open our file GnubizzSite in the directory Gnubizz1 in our Desktop. Start in the Gnubizz1 directory.
Type cd/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
Open your file GnubizzSite with pico.
Type Pico GnubizzSite
Modify your file by typing more text you like and save your file using the same name.
How to save your file you can follow the same procedure as the description above.
When you’ve done your modification press ctrl + x and than Y.
Keep the name GnubizzSite and press enter.
Our file is saved again after the modification.

4

We have made, moved, modified, and saved directories and files.
Now we’ll remove our directory Gnubizz in our home directory.
As you know we have two of them, one in our Desktop and one in our Home directory.
Start in the home directoy /home/anne.
Type ls if you’re not sure before removing directories or files.
Be aware when you remove it you can’t get it back!
Type rmdir Gnubizz + enter.
Notice we have a error, we can’t remove it because this directory contains subdirectories. (not displayed here!!)
We we’ll navigate through this directory and remove them.
Let’s do it ;-).
Type cd /home/anne/Gnubizz/OpenSourceComputing
Now we’re in OpenSourceComputing that contains the Gnubizz1 and Gnubizz2. Remove them.
Type rmdir Gnubizz1 Gnubizz2
Verify it with the ls command to see there’re gone now.
Type cd ..
We’re in the directory Gnubizz that contain the directory OpenSourceComputing.
Type rmdir OpenSourceComputing
Check it with ls and you w’ll see it’s gone.
Type cd .. again to go into you home directory.
Verify with ls command.
Type rmdir Gnubizz
Type one more time ls and you w’ll see everything is gone.

anne@alfa:~$ pwd
/home/anne
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ locate Gnubizz
/home/anne/Gnubizz
/home/anne/Desktop/Gnubizz
/home/anne/Desktop/Gnubizz/OpenSourceComputing
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Desktop/Gnubizz/OpenSourceComputing/Gnubizz2
/home/anne/Gnubizz/OpenSourceComputing
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz1
/home/anne/Gnubizz/OpenSourceComputing/Gnubizz2
anne@alfa:~$ cd /home/anne/Gnubizz/OpenSourceComputing
anne@alfa:~/Gnubizz/OpenSourceComputing$ ls
Gnubizz1  Gnubizz2
anne@alfa:~/Gnubizz/OpenSourceComputing$ rmdir Gnubizz1 Gnubizz2
anne@alfa:~/Gnubizz/OpenSourceComputing$ ls
anne@alfa:~/Gnubizz/OpenSourceComputing$ cd ..
anne@alfa:~/Gnubizz$ ls
OpenSourceComputing
anne@alfa:~/Gnubizz$ rmdir OpenSourceComputing
anne@alfa:~/Gnubizz$ ls
anne@alfa:~/Gnubizz$ cd ..
anne@alfa:~$ ls
Desktop  Documents  Downloads  Gnubizz  Music  Pictures  Public  Templates  Videos
anne@alfa:~$ rmdir Gnubizz
anne@alfa:~$ ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
anne@alfa:~$

Ok at the first time it’s hard to understand but over time you’ll get used to it.
Just try and play and you will loved it.

This was our journey through home directory.
By any doubts our questions don’t hesitate to leave a comment.
We hope you’ve enjoyed it.
See you next time. 😉