Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
Quote:
Originally posted by Darin why not just this:
make dep ; make clean ; make bzImage ; make modules ; make modules_install
Because, if any one of those fail, the others still run. It's not safe.
The ";" tells the shell to just continue, regardless of the exit status
of the previous command, which is dangerous. Say your
"make bzImage" command crashed. The above command would
go on to make modules and then make modules_install, and the
error message from make bzImage would be buried under all the
other messages about making the modules. Maybe make modules
or make modules_install would finish successfully, and you'd think
you had a good kernel, and try to boot with it. Not good.
# Basic piping
some_command | another_command
See Linux and the tools philosophy
# Basic re-direction:
command > textfile_name
See this Text Manipulation Article
# Basic concantenation:
If you don't want to overwrite a file but add to the bottom of an existing file, concantenate it:
command >> exisiting_text_file
Handy bash commands for finding out stuff in Linux:
# Find CPU specifications
cat /proc/cpuinfo
# What pci cards are installed and what irq/port is used
cat /proc/pci
# Memory and swap information
free
# How is the hard drive partitioned
fdisk /dev/hd<X> -l
# How much free drive space
df -h
# Show disk usage by current directory and all subdirectories
du | less
# Find running kernel version
uname -r
# Find X server version
X -showconfig
# What is the distribution
cat /etc/.product
cat /etc/.issue
cat /etc/issue
cat /etc/issue.net
sysinfo
# For finding or locating files
find
locate
which
whereis
# Use dmesg to view the kernel ring buffer (error messages)
dmesg | less
# Watch error messages as they happen (sysklog needed)
as root, tail -f /var/log/messages (shows last 10 lines, use a number in front of f for more lines)
# What processes are running
ps -A
# Find a process by name
ps -ef | grep -i <plain text>
For example, XCDroast
ps -ef | grep -i xcdroast
# See current environment list, or pipe to file
env | more
env > environmentvariablelist.txt
# Show current userid and assigned groups
id
# See all command aliases for the current user
alias
# See rpms installed on current system
rpmquery --all | more
rpmquery --all > <filename>
rpmquery --all | grep -i <plaintext>
# What directory am I using
pwd
# What takes up so much space on your box
# Run from the directory in question and the largest chunk shows up last
find $1 -type d | xargs du -sm | sort -g
Look at man <command> or info <command> for the flags I used and for other options you can use for bash commands.
Last edited by fancypiper; 02-14-2003 at 04:35 PM.
# CD burning info
Is it configured and what is the device? Command this to find out:
cdrecord -scanbus Adding an IDE CD-Writer to Linux CD Writing HOWTO
# Burn an ISO to disk
cdrecord -v speed=<burning speed> dev=<your device> /path/to/foo.iso
# Burn from disk to disk
cdrecord -v dev=<your device> speed=<burning speed> -isosize /dev/cdrom
# Generate an ISO from a directory.
mkisofs -Jr -o foo.iso /path/to/directory
mkisofs -vrTJUV "Label" -o foo.iso /path/to/directory
# Generate an ISO from a CD
dd if=/dev/cdrom of=foo.iso Linux MP3 CD Burning mini-HOWTO
# Convert mp3 to wav with lame
for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
# Burn a CD from wav files
cdrecord -v -audio -pad speed=<burning speed> dev=<your device> /path/to/*.wav
# Erase a CDRW
cdrecord -v dev=<your device> speed=<burning speed> blank=fast
# Mount CD iso images
mount /path/to/foo.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0
Last edited by fancypiper; 06-13-2003 at 02:18 AM.
Heh heh,wondered when you'd get around to posting that "cdrecord" bit. I saved it to file and canned all those GUI frontends a while back. Thanks again.
Originally posted by Allen614 Heh heh,wondered when you'd get around to posting that "cdrecord" bit. I saved it to file and canned all those GUI frontends a while back. Thanks again.
My doctor (mandrake user because he thought he wanted gui stuff) is starting to use those commands now as he created quite a few coasters using that gui stuff that hides everything from you.
It seems that the commands work as advertized and gui front ends can be flakey in my experience.
#!/bin/sh
# Redhat /etc/rc.d/rc.local file
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
# configure modem
setserial /dev/ttyS2 irq 5 port 0xc400 uart 16550a
Do a lot of parsing log lines using cut, awk etc etc?
Adding this function to your functionlib or .bashrc
function sepsp() { tr -s" "|cut -d " " -f$@; }
and now you can "cat <someFile> | sepsp 2,6-".
Saves you typing 19 chars each time.
Originally posted by Thymox As far as I'm concerened, with only a couple of exceptions, most British politicians are theives, liars and conmen. But, again, this is taking things (just a little) off topic.
You will need to have installed:
1. The developmental packages (compiler)
2. The kernel source code that matches your running kernel
3. The module source or install code
Check out your system and see what's under the hood and see if you installed the stuff you need to do the job. Open an x terminal and type in this sequence of commands to see what kernel we are running and see if you have the kernel source installed:
Code:
[phil@uilleann phil]$ su -
Password:
[root@uilleann root]# uname -r
2.4.18-3
I am running kernel version 2.4.18-3. Do I have the proper source code?
Code:
[root@uilleann root]# cd /usr/src
[root@uilleann src]# ls -alc
total 3
drwxr-xr-x 4 root root 136 Jun 12 14:53 .
drwxr-xr-x 16 root root 424 Jun 4 12:04 ..
lrwxrwxrwx 1 root root 14 Jun 4 12:11 linux-2.4 -> linux-2.4.18-3
drwxr-xr-x 16 root root 584 Jun 4 12:11 linux-2.4.18-3
drwxr-xr-x 7 root root 168 Jun 4 12:08 redhat
[root@uilleann src]#
I do have the same kernel version source code installed in the directory /usr/src/linux-2.4.18-3 and there is a symbolic link named linux-2.4 pointing to it.
If you don't see something similiar to this (but in color), you will need to install the kernel source.
NOTE: I noticed that Red Hat didn't make the symbolic link /usr/src/linux that all of the INSTALL files that I have read mentioned that I need, so I may as well make one now to save editing the files in the source code to install.So, I'll make it just now:
Code:
[root@uilleann src]# ln -s linux-2.4.18-3 linux
[root@uilleann src]# ls -alc
total 3
drwxr-xr-x 4 root root 160 Jun 12 15:46 .
drwxr-xr-x 16 root root 424 Jun 4 12:04 ..
lrwxrwxrwx 1 root root 14 Jun 12 15:46 linux -> linux-2.4.18-3
lrwxrwxrwx 1 root root 14 Jun 4 12:11 linux-2.4 -> linux-2.4.18-3
drwxr-xr-x 16 root root 584 Jun 4 12:11 linux-2.4.18-3
drwxr-xr-x 7 root root 168 Jun 4 12:08 redhat
[root@uilleann src]#
Ah, there it is, so that's done.
Next, did I install the compiler?
Code:
[root@uilleann src]# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[root@uilleann src]#
Yes, I have a compiler installed.
If you don't have those two things installed, you have to install them first off your install CD.
If they are installed, download the source and happy comiling. Make sure you carefully read the README and INSTALL files after extracting and before compiling/installing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.