LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-04-2023, 10:13 PM   #1
Linuxwolf
LQ Newbie
 
Registered: Nov 2023
Posts: 3

Rep: Reputation: 0
"HELP" .bash_aliases on fedora linux


alias getdates='date | tee /home/name/fulldate.txt | cut -d " " -f 1 | tee /home/name/shortdate.txt | xargs echo hello'

I saved this in a (.bash_aliases) file. Then try to run getdates in the terminal. However, I get a response of bash: getdates: command not found...
 
Old 11-05-2023, 01:21 AM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 963

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Quote:
Originally Posted by Linuxwolf View Post
I saved this in a (.bash_aliases) file.
bash knows no such file, you should've placed it into ~/.bashrc. Read the "Invocation" section of bash man page for a full list of files bash executes automatically.
 
2 members found this post helpful.
Old 11-05-2023, 01:59 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Does .bash_aliases already exist? Does .bashrc contain code that uses it? Did you reload the file? Since those files are only read at login they must be reloaded or logout and then login again.

https://www.tecmint.com/create-and-u...ases-in-linux/

Last edited by michaelk; 11-05-2023 at 07:57 AM.
 
1 members found this post helpful.
Old 11-05-2023, 04:06 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,978

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
yes, you need to source that file either manually or by opening a new shell (if properly configured). Just putting anything into that file has no any effect on the running terminal immediately.
 
1 members found this post helpful.
Old 11-05-2023, 05:21 AM   #5
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
if you just trying to be told what to think ask away

but

we don't have a due date so yelling help won't help
 
Old 11-05-2023, 08:14 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
I do not know exactly what you are trying to accomplish but you can simplify your alias to just:

Code:
date '+Hello %a'
See the man pages for the date command.
 
1 members found this post helpful.
Old 11-05-2023, 11:24 AM   #7
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
I answered in the duplicate post with:
Code:
source ~/.bash_profile
to have bash read the updated file again.
 
1 members found this post helpful.
Old 11-05-2023, 02:11 PM   #8
Linuxwolf
LQ Newbie
 
Registered: Nov 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks everyone

I really appreciate the help and all the advice from everyone.
 
  


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
linux correct permissions for .bash_aliases L_Carver Linux - Newbie 1 06-16-2017 05:40 PM
modifying .bashrc and .bash_aliases asookazian Linux - Newbie 7 03-26-2010 07:36 AM
Aliases don't execute after placing them in .bashrc or .bash_aliases in 2.16 ubume2 Puppy 2 08-29-2008 11:41 AM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 06:02 PM
fluxbox doesn't consider bash_aliases Four Linux - Newbie 5 04-26-2007 07:59 PM

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

All times are GMT -5. The time now is 04:07 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