|
|
|
|
|
-Current Notification
To receive notification of changes to the
Slackware -Current ChangeLog via email, send an
email to "mrgoblin@userlocal.com" with the subject
"subscribe slacklog" and your email address in the
body of the message.
|
|
|
|
|
|
Back to
Main Page
Go to Slackware Forums
|
Basic Linux and UNIX Commands
Author: Douglas (Doug) Palovick
Homepage:
Palovick.com
email: doug@palovick.com
Getting Started
Here are some basic commands to get you started in the wonderful world of Linux and other UNIX variants. Near the bottom are commands dealing with tar/gzip/bzip2, compiling, and Linux RPM management. All UNIX and Linux commands are case sensitive.
- cd
- Change directory. This is the command you use to change into different directories. An example would be "cd /mnt" (minus the quotes, always minus the quotes) now you will be the /mnt dir.
- mount
- Mounts a filesystem. ex, "mount /dev/hda4 /mnt" mounts hard drive partition 4 in your /mnt directory.
- cp
- Copies files. eg, "cp SomeFile /home/momo/" copies a SomeFile into user momo's home directory.
- mv
- Move. Does the same as cp except moves the file instead of copying it. You also use the mv command to rename files/directories ex, "mv file1 SomeNewFilename" renames file1 to SomeNewFilename.
- mkdir
- Make Directory. ex, "mkdir /home/momo/new" creates a directory named new in momo's home directory. If you are currently in the directory you want to make the the new directory in you can just do "mkdir new" to make a directory named "new".
- rm
- Removes files and directories. ex, "rm file1". To use rm without a hassle you may want to use "rm -rf". This way you won't be prompted to confirm the removal of the file. You can not use rm to remove directories which are not empty unless you use an option telling rm to do otherwise, the -rf option works well for this. Use "rm -rf" carefully ;-).
- rmdir
- Removes empty directories. ex, "rmdir new".
- man
- displays the man page for a paticular application or command. ex, "man rm". Man is your friend, please use it :-) .
Using tar, gzip, and bzip2
- untar/gzipping a file
- The following will decompress .tar.gz and .tgz files. cd into the dir with the file/s then type "tar zxvf yourfile.tar.gz" or "tar zxvf yourfile.tgz".
- un-tar a .tar
- cd into the dir with the file/s then type "tar xvf yourfile.tar".
- un-gzip a file
- Type "gzip -d filename.gz".
- un-bzip2 a file
- Type "bzip2 -d filename.bz2".
- tar plus gzip a dir/multiple files
- cd into the dir of the files you want to tar(warning, this will put ALL files of the current dir you're in into a tar file), type "tar cvf newTarFile.tar * ". Now to gzip the file, type "gzip -9 newTarFile.tar".
Compiling and Installing Software
- tar.gz or .tgz
- untar/gzip the file ("tar zxvf file.tar.gz"). cd into the dir. Most source packages will compile by doing "./configure" then "make" then su to root (type "su" press enter then enter in your root password then press enter) and do "make install". I always like to do "make install > /root/program-version" to keep better track of everything. You should always read the INSTALL file first, but the above instructions usually work fine. If you happen to be compiling and installing libs, be sure to type (as root) "ldconfig" after installing them.
- src.rpm
- You must be root and in the same dir as the src.rpm. Type "rpm --rebuild --target i586" (if you have a intel p2 or higher, you can do i686, if you have a 486 or lower do i486 or i386). Now watch for where the actual rpm was placed (look at last few lines on the screen or scroll up a tiny bit). cd into the dir with the new rpm or cp it to where you are at ("cp /path/to/rpm ."). Now do "rpm -Uvh file.rpm".
- Note for slackware users
- You can compile source rpms using the above instructions, but instead of installing the rpm, run "rpm2tgz file.rpm" (comes standard with slackware) and install using "installpkg file.tgz".
- Installing a regular RPM
- cd into the dir that the rpm you want to install is in. su to root (type "su" press enter, enter in your root password, press enter). Type "rpm -Uvh filename.rpm" and press enter, boom done ;-).
more to come
|
|
|
|
|