alias issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers alias issue
# 1  
Old 04-14-2010
alias issue

hi guys

I am trying to alias this

Code:
[root@xxxxxx~]# df -h | grep -vE 'boot|dev'
Filesystem            Size  Used Avail Use% Mounted on
                      114G  1.5G  107G   2% /
                      2.9G   69M  2.7G   3% /home
                      4.8G  138M  4.4G   4% /tmp
                      4.8G  1.7G  2.9G  37% /usr
                      2.9G  726M  2.0G  27% /var



the nornal command is with single quote but as soon as I use the single quote that alias requires it won't work

Code:
[root@xxxxxx ~]# alias disk1='df -h | grep -vE 'boot|dev''
-bash: dev: command not found

any idea how to fix that?

thanks a lot
# 2  
Old 04-14-2010
Hi.

Simplest would be to use double quotes around your grep command:

Code:
alias disk1='df -h | grep -vE "boot|dev"'

(or put your alias in double quotes)
Code:
alias disk1="df -h | grep -vE 'boot|dev'"

# 3  
Old 04-14-2010
Code:
alias disk1='df -h | grep -vE "boot|dev"'

# 4  
Old 04-14-2010
Quote:
Originally Posted by vgersh99
Code:
alias disk1='df -h | grep -vE "boot|dev"'

no way I thought I tried " " mmm aybe not

thanks a lot Smilie

---------- Post updated at 06:52 PM ---------- Previous update was at 06:45 PM ----------

Quote:
Originally Posted by scottn
Hi.

Simplest would be to use double quotes around your grep command:

Code:
alias disk1='df -h | grep -vE "boot|dev"'

(or put your alias in double quotes)
Code:
alias disk1="df -h | grep -vE 'boot|dev'"

thanks a lot guys
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Alias help

As part of my daily duties and to help me learn more about UNIX, I have to check a report to make sure all requested mksysb's completed each day. If the report doesn't show 100% completed, I have to use our NIM server and find the file. I use the commandls -l /<filename>. I am trying to use an... (7 Replies)
Discussion started by: Kentlee65
7 Replies

2. UNIX for Dummies Questions & Answers

IP Alias

Quick question Have a AIX system that has been up for years with a 192.9.x.x IP scheme and we want to add a second IP to the system. I setup the second IP 10.1.x.x as an alias via smit. Since these two IP's are on different VLANs will this be an issue? Reason I ask is that I cannot ping... (3 Replies)
Discussion started by: Chrisp
3 Replies

3. UNIX for Dummies Questions & Answers

Create alias files (not alias commands)

If one: $ find -name 'some expression' -type f > newfile and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory. I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies

4. UNIX for Dummies Questions & Answers

ALIAS

how to make alias perament? I have edited in .bashrc also but no use:(.How to manke it perament (3 Replies)
Discussion started by: kkalyan
3 Replies

5. UNIX for Dummies Questions & Answers

alias

Hello. Q:Is it possible to create an alias for "nedit *. ". If it is how does it look like? Tks. (1 Reply)
Discussion started by: geko
1 Replies

6. UNIX for Dummies Questions & Answers

using alias

I need to login to one server and then switch the user and set a number alias. But i cant modify the .profile file. I have one script avi1.sh $ more avi.sh sudo su - bil sh avi1.sh and in home directory of bil i have avi1.sh that says $ more avi1.sh alias l='ls -ltr' alias b='cd... (7 Replies)
Discussion started by: blackeyed
7 Replies

7. UNIX for Dummies Questions & Answers

alias issue for mailing purpose in linux

Hi all, I have a requirement for which i need to create an aliase for an username(userid) . suppose the user name is "sanjay.sahoo@localhost.localdomain " . If i will send to any user from this userid then all of them will see from: "the alias of the userid not the... (1 Reply)
Discussion started by: sanjay.login
1 Replies

8. UNIX for Dummies Questions & Answers

alias help

Hello again, what does \!* do int his line alias lookup 'grep -i \!* who.is.who' Thanks! (1 Reply)
Discussion started by: kris888
1 Replies

9. Shell Programming and Scripting

Alias

how implement functionality alias in the same way as in csh? (use Bourne type sh or bash) (3 Replies)
Discussion started by: sunhata
3 Replies
Login or Register to Ask a Question