LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-07-2019, 03:46 PM   #1
HWDPlinux
Member
 
Registered: Mar 2014
Posts: 32

Rep: Reputation: Disabled
Questions about the alias command CentOS7


When I use the alias/unalias command everything works fine, I just want to know why I am seeing this.
Where does the alias command store the new alias?
Why do I get the following output if my ~/.bashrc file looks as such...

Code:
[root@localhost profile.d]# alias
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -lZ'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
Code:
[root@localhost profile.d]# cat ~/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
 
Old 03-07-2019, 04:24 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by HWDPlinux View Post
When I use the alias/unalias command everything works fine, I just want to know why I am seeing this.
Where does the alias command store the new alias?
Why do I get the following output if my ~/.bashrc file looks as such...
When you log on, your shell initializes itself from various system-wide and user-specific scripts, including /etc/profile, /etc/bashrc, .bash_profile, .bashrc and others. Aliases may be defined in any of these files, not only .bashrc.

Besides, you can also define aliases on the command line.
 
Old 03-07-2019, 04:26 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,799

Rep: Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953Reputation: 5953
It appears your in the /etc/profile.d directory have you looked at its contents? They are "loaded" by /etc/profile which is the system wide configuration and startup script.
 
  


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
Any problem if I install CENTOS7 Workstation over CENTOS7 Server? Rich Strebendt Linux - Software 5 05-03-2018 11:05 PM
Bash: how to avoid a command inside an alias being used as another alias? dedec0 Linux - Newbie 25 12-11-2017 10:20 AM
Wildcard email alias in /etc/alias file custangro Linux - Enterprise 1 10-02-2009 12:17 PM
IP alias? Machine name alias? JohnLocke Linux - Newbie 4 01-16-2008 12:21 PM
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:18 PM.

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