LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-09-2004, 10:16 PM   #1
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Rep: Reputation: 30
Question alias


how do I get alias to work.
Below is what I inputed, but it doesn't work.

Quote:
alias [cdrom[=mount /dev/cdrom /root/Desktop/cdrom]]

and

alias [ucdrom[=umount /dev/cdrom]]
 
Old 03-09-2004, 11:33 PM   #2
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Original Poster
Rep: Reputation: 30
i fixed my syntax with

Code:
alias ucdrom="umount /dev/cdrom"
i keep getting device is busy errors.
is there a reason for this?
 
Old 03-10-2004, 12:34 AM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Do 'mount' to see if it's already mounted.

And if any process (backgrounded shell, subshell, whatever) is in that directory, it's going to be 'busy'. Make sure that you cd all your shells/file managers/whatnot out of the mount point.

Do 'ps ux' if you still get it, because you probably missed a shell.

Might try making your alias point to '/mnt/cdrom' or whatever's in fstab, too, instead of the device directly.
 
Old 03-10-2004, 05:23 PM   #4
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Original Poster
Rep: Reputation: 30
Three questions...
(1)
How do we make the alias permanent.
It is gone after I logout.
None of the books I have give you a way to do this.
(2)
Do you mean to unmount the location I mounted my cdrom to?
I mounted it to /root/Desktop/cdrom.
So should I umount /root/Desktop/cdrom?
Quote:
Might try making your alias point to '/mnt/cdrom' or whatever's in fstab, too, instead of the device directly.
(3)
[edit1]
I just found the ps command in my book. Process reporting.
That is a good command to know. Thanks. Scratch the following question.
[/edit]
What is this?
Quote:
'ps ux'

Last edited by xviddivxoggmp3; 03-10-2004 at 05:27 PM.
 
Old 03-10-2004, 06:00 PM   #5
darkRoom
Member
 
Registered: Mar 2004
Location: Valencia, espaņa
Distribution: Slack, Gentoo, Custom
Posts: 162

Rep: Reputation: 30
hi
i put my alias's at the bottom of /etc/profile, of course that means that they are global. A workaround would be to add:

Code:
source ~/.bashrc
(in etc/profile)

and then make yorself a .bashrc in the home directory (if you dont already have one) in which you can put the alias's for each user.
 
Old 03-10-2004, 08:46 PM   #6
At0mic_PC
Member
 
Registered: Jul 2003
Location: Mississippi
Distribution: Slack9.1
Posts: 159

Rep: Reputation: 30
Here is my .bashrc:

alias dfh='df -h'
alias more='less'
alias pa='ps aux'
alias pkgname='ls -l /var/log/packages/ | grep $1'
alias rtfm='man'


It's small cause I just found the joy of using it.
 
Old 03-11-2004, 02:49 AM   #7
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Re:#2: Yeah.
Code:
~
1014>> alias | grep cdrom                                                      
alias mcdr='mount -v /mnt/cdrom'
alias ucdr='umount -v /mnt/cdrom'

~
1015>> cat /etc/fstab | grep cdrom                                             
/dev/cdrom       /mnt/cdrom       iso9660     noauto,user,ro   0   0

~
1016>> ls -l /dev/cdrom                                                        
lrwxrwxrwx    1 root     root            8 Nov 26 12:17 /dev/cdrom -> /dev/sr1

~
1017>> ls -l /dev/sr1                                                          
brw-r-----    1 root     disk      11,   1 Apr 13  1999 /dev/sr1
My alias means to substitute 'ucdr' with 'umount -v /mnt/cdrom' which references /etc/fstab, which tells umount '/mnt/cdrom' means 'unmount dev/cdrom from that mountpoint' and '/dev/cdrom' is actually a link to '/dev/sr1'. (I have scsi emulation, hence the funky device.)

Anyway - then I just issue 'mcdr' and 'ucdr'. But 'mount' should show whether it's mounted or not and 'ps' should show if any processes are running that might be 'in' it. You have to have a mounted device and be clear of the mountpoint in order to unmount it. If that's the case, then I dunno why it's saying it's busy and refusing to unmount. Could try 'lsof', too, to see if there's any open files. That could hang it up, too.

Re:#1: my .bashrc is just a symlink and I stick everything in ~/.bash_profile so I don't have to worry with it but that's not SOP for reasons I have yet to figure out.
 
Old 03-11-2004, 11:51 PM   #8
xviddivxoggmp3
Member
 
Registered: Feb 2004
Location: scanf
Distribution: Redhat Enterprise 4.4 AS
Posts: 236

Original Poster
Rep: Reputation: 30
ok i finally got the .bashrc to save aliases for reboot and login.
How do you reload the .bashrc into your box w/o rebooting?
I'm getting tired of recogniziing an error in my script and then having to wait for the reboot to test the new script.
and how do you make alias commands accesable to non-su user?
ever time i try to execute cdr from a non-su user it says request can only be made by root.

Last edited by xviddivxoggmp3; 03-11-2004 at 11:55 PM.
 
Old 03-12-2004, 10:34 AM   #9
At0mic_PC
Member
 
Registered: Jul 2003
Location: Mississippi
Distribution: Slack9.1
Posts: 159

Rep: Reputation: 30
Try shutting down the xterm. I found that if I had the xterm open when I changed something they wouldn't take.
 
Old 01-25-2005, 10:05 AM   #10
bullium
Member
 
Registered: Aug 2003
Location: Ohio
Distribution: Ubuntu 12.04, Mint 13, RHES 5.5, RHES 6
Posts: 146

Rep: Reputation: 17
You could just execute the .bashrc file.

Code:
. .bashrc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM
ip alias mindcry Linux - Networking 0 10-16-2003 07:41 PM
using alias intruptz Linux - General 5 09-17-2003 04:32 AM
alias booyah Slackware 3 05-06-2003 03:17 PM
alias nobu Slackware 5 01-11-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration