Chapter 1 Part 2
Chapter 1 Part 2
administration
Windows
First the directory structure may seem
unlogical and strange and you have no idea
where all the programs, icons, config files, and
others are.
There are two types of Linux's directory
structure: full/absolute path and relative path
hierarchy of directories.
resources.
/rootRepresents the root users home
directory. The home directory for root does not
reside beneath /home for security reasons.
/sbinContains administrative commands and
daemon processes.
applications.
/usrContains user documentation, games,
graphical files (X11), libraries (lib), and a variety
of other user and administrative commands and
files.
/varContains directories of data used by
various applications. In particular, this is where
you would place files that you share as an FTP
server (/var/ftp) or a Web server (/var/www). It
also contains all system log files (/var/log) and
spool files in /var/spool (such as mail, cups, and
news).
login session
echo To find out the name of your home
directory,
pwd - To find out what your current directory (the
present working directory)
cd - To get back to your home directory, just type
the change directory (cd) command. (Although
cd followed by a directory name changes the
current directory to the directory that you
choose, simply typing cd with no directory name
takes you to your home directory.)
systems
du - To find out how much space is being
consumed by a particular directory (and its
subdirectories)
man - To learn more about a particular
command, type man command. (Replace
command with the command name you want.)
A description of the command and its options
appears on the screen.
You also can always see other option for every
command by typing command --help, e.g. ls
--help
chmod
> ls -l
x = execute
The first character on the line shows what
type of file or directory it is, and can be one
of these things...
- = file
d = directory
l = symbolic link
b = block-type special file
c = character-type special file
p = named pipe
S = socket
s = XENIX semaphore
m = XENIX shared data (memory) file
D = Solaris door
n = HP-UX network special file
chown
> chown izwan file.txt
This will cause file.txt to now be owned by
izwan.
chgrp
>ls -l
files.
E.g.
mv file1 file3 rename file1 to file3
mv file3 home/user/directory move file 3 into
directory
cp - Copy files
cp source destination
E.g. cp files1 files2
Copy file1 as file2 in same directory
"filename".
standard output
tail - print the last 10 lines of each file to standard
output
cat concatenate (combine) files and print on the
standard output
tac - write each file to standard output, last line
first. With no file or file is -, read standard output
more filter for paging through text one screenful
at a time. This version is especially primitive
less opposite of more
tar.bz2
tar.gz
Uncompress tarball
# 1: Uncompress tarball
To uncompress them, execute the following
$ ls
$ cd path-to-software/
# 2: Build and install software
Generally you need to type 3 commands as
# ./configure
# make
# make install
Where,
./configure will configure the software to
ensure your system has the necessary
functionality and libraries to successfully
compile the package
make will compile all the source files into
executable binaries.
Finally, make install will install the binaries
and any supporting files into the
appropriate locations.
$ vi INSTALL