Another quick and dirty HowTo, this time we are showing you how to mount an ISO image under Linux. If you are just getting into Linux you will see that you will have to do this quite often as a Linux Admin/Engineer. In the example below I will use a CentOS ISO Image as an example.
The apropos Comand
apropos:
-Searches
for a given keyword in the top line (description) of all man pages then displays
all that
-Useful
if you do not know the name of a command but you have a specific task you want
to perform
Introduction to the Alias Command
alias
What:
-Linux allows a
complex (or commands with long names) to be given a shorter form using a simple
character string
-This is called an alias
-You create aliases
with the alias command
-This command is
built into the Bash shell, not a
separate program
Run Levels In Linux
RUN LEVELS
Background
-Linux can boot
into various configurations (much like with what you get with Windows when
hitting F8 while booting)
-Linux has 6 boot
levels but outside of specialized situations, only levels 3 & 5 are useful
-Runlevel 3 boots
to a command prompt –this is the default Runlevel for most servers
-Runlevel 5 boots
to a GUI interface similar to Windows – this is the default Runlevel for most
workstations
Mounting and Partitioning HowTo
I see this question in forums all
the time…. How do I mount a file system? How do I create a new
partition and a file system? How do I set it to mount automatically?
how do I set the permissions on the mount? Well I’m going to do my best
here and answer all the questions above.
andLinux beta 1 HowTo Part 2 – installing NMAP using Apt-Get and Apt-Cache
Ok. It’s been five days since the first installment of andLinux beta 1 exploration started. Hopefully you’ve spent all your spare time downloading andLinux beta 1, installing it and becoming a Linux expert by now. Not! No problem. Since you seem to move at my pace we’ll continue this ride together.
Continue reading “andLinux beta 1 HowTo Part 2 – installing NMAP using Apt-Get and Apt-Cache” »
Removing Multiple RPMs with Similar File Name
Removing
Multiple RPM’s with Similar File Names
Use
the rpm’s command -e (for remove) with the –allmatches option
"rpm
–e –allmatches <package-to-be-removed>"
i.e.:
"rpm -e –allmatches kernel-2.4.25-8tr"
The –allmatches
allows you to match all rpms with a given expression..
Install/Configure GPG (GNU Privacy Guard)
In this howto, we will show you how to Install/Configure GPG (GNU Privacy Guard)
For CentOS:
Step 1 -Install
As root (su -, then the root password):
yum install gpg
(select y)
It will then
install
Continue reading “Install/Configure GPG (GNU Privacy Guard)” »
Creating a virtual loopback device
Sometimes you will need to create a virtual loopback device for whatever reason. One possible need would be for a temporary filesystem to do some quick testing, or maybe to set up a larger /tmp partition on a server where /tmp is too small. To initially create the loopback device, run:
# dd if=/dev/zero of=/usr/local/tmpfs bs=50M count=10
dd if=<file to read from> of=<file to write to> bs=<byte size> count=<count to loop>
Using rsync to move files around
You can use rsync to transfer files from either one directory to another or from one server to another. When copying over large directory structures, rsync is usually better than using cp -av. The cp command copies files and directories blindly, while rsync compares the two directories and only copies the differences. This saves time, hard drive load, system load, and if copying across a network, bandwidth. It is very useful when backing up a hard drive or an entire server. The command to use is:
# rsync -avH –delete –exclude=/junk –exclude=/otherjunk /home /backup/
rsync -avH –delete –exclude=<file/directory to exclude> <source files/directories> <destination directory>
The "a" flag will preserve important settings such as permissions, ownership, symbolic links, etc., as well as recursively copy the entire directory tree. The "v" flag is optional, and will list each file as it is copied and will give a summary of how much data was transferred. The "H" flag preserves hard links (a standard linux installation is often full of these). If you are absolutely sure that you don’t have any hard links in the data you are copying, then you can omit it, but adding it won’t hurt. The "–delete" flag means "delete anything in the destination directory that doesn’t exist in the source directory". This is useful if you are backing up a hard drive and you want to make sure that files that you removed from the main drive are removed from the backup drive as well. The "–exclude" flag allows you to skip over certain directories that you don’t want copied over to the destination directory. You can have multiple "exclude" flags.
If you want to copy your data to another server, then you can use "rsync://<hostname>/<path>" as either the source or destination. The "hostname" is the IP or full hostname of the remote server, and "path" is the exported path that is set up in the rsync configuration on the remote server.
# rsync -avH –delete –exclude=/junk –exclude=/otherjunk /home rsync://backup.server/backup_path
rsync -avH –delete –exclude=<file/directory to exclude> <source files/directories> <rsync://hostname/path>
rsync -avH –delete –exclude=<file/directory to exclude> <rsync://hostname/path> <destination directory>